From 9c0a6a162b33877e5d523c8925d08fc2c8f58e49 Mon Sep 17 00:00:00 2001 From: Nevio Di Gennaro Date: Tue, 14 Jan 2025 14:36:36 +0100 Subject: [PATCH] run formatter --- .../java/ch/puzzle/okr/controller/ObjectiveController.java | 3 ++- .../authorization/ObjectiveAuthorizationServiceTest.java | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/ch/puzzle/okr/controller/ObjectiveController.java b/backend/src/main/java/ch/puzzle/okr/controller/ObjectiveController.java index 64e8dea0cc..6350a85275 100644 --- a/backend/src/main/java/ch/puzzle/okr/controller/ObjectiveController.java +++ b/backend/src/main/java/ch/puzzle/okr/controller/ObjectiveController.java @@ -101,7 +101,8 @@ public ResponseEntity createObjective(@io.swagger.v3.oas.annotatio @ApiResponses(value = { @ApiResponse(responseCode = "201", description = "Duplicated a given Objective", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectiveDto.class)) }) }) @PostMapping("/duplicate") - public ResponseEntity duplicateObjective(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The Objective which should be duplicated as JSON", required = true) @RequestBody DuplicateObjectiveDto duplicateObjectiveDto) { + public ResponseEntity duplicateObjective(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The Objective which should be duplicated as JSON", required = true) + @RequestBody DuplicateObjectiveDto duplicateObjectiveDto) { Objective objective = objectiveMapper.toObjective(duplicateObjectiveDto.objective()); List keyResultIds = duplicateObjectiveDto.keyResultIds(); ObjectiveDto duplicatedObjectiveDto = objectiveMapper diff --git a/backend/src/test/java/ch/puzzle/okr/service/authorization/ObjectiveAuthorizationServiceTest.java b/backend/src/test/java/ch/puzzle/okr/service/authorization/ObjectiveAuthorizationServiceTest.java index b5de35060d..409611fdb7 100644 --- a/backend/src/test/java/ch/puzzle/okr/service/authorization/ObjectiveAuthorizationServiceTest.java +++ b/backend/src/test/java/ch/puzzle/okr/service/authorization/ObjectiveAuthorizationServiceTest.java @@ -171,8 +171,7 @@ void shouldThrowExceptionWhenNotAuthorizedToDuplicateObjective() { ResponseStatusException exception = assertThrows(ResponseStatusException.class, () -> objectiveAuthorizationService - .duplicateEntity(objective, - new ArrayList<>())); + .duplicateEntity(objective, new ArrayList<>())); assertEquals(UNAUTHORIZED, exception.getStatusCode()); assertEquals(reason, exception.getReason()); @@ -203,8 +202,7 @@ void shouldReturnDuplicatedObjectiveWhenAuthorized() { .thenReturn(newObjectiveWithKeyResults); Objective objective = objectiveAuthorizationService - .duplicateEntity(newObjectiveWithoutKeyResults, - keyResults.stream().map(KeyResult::getId).toList()); + .duplicateEntity(newObjectiveWithoutKeyResults, keyResults.stream().map(KeyResult::getId).toList()); assertEquals(newObjectiveWithKeyResults, objective); }