Skip to content

Commit

Permalink
fix duplicate keyresult tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nevio18324 committed Jan 14, 2025
1 parent dc85487 commit be380b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public KeyResult makeCopyOfKeyResultOrdinal(KeyResult keyResult, Objective dupli

public List<Action> duplicateActionList(KeyResult oldKeyResult, KeyResult newKeyResult) {
List<Action> actionList = oldKeyResult.getActionList();
if (!actionList.isEmpty()) {
if (actionList != null) {
actionList = actionList
.stream()
.map(e -> Action.Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,11 @@ void shouldDuplicateMetricKeyResult() {
.build();
KeyResult keyResultMetric = KeyResultMetric.Builder.builder().withTitle("Metric").build();
objectiveBusinessService.duplicateKeyResult(authorizationUser, keyResultMetric, objective);
verify(objectiveBusinessService.makeCopyOfKeyResultMetric(keyResultMetric, objective), times(1));
verify(keyResultBusinessService.createEntity(keyResultMetric, authorizationUser), times(1));
verify(objectiveBusinessService, times(1))
.makeCopyOfKeyResultMetric(keyResultMetric, objective);

verify(keyResultBusinessService, times(1))
.createEntity(any(KeyResult.class), any(AuthorizationUser.class));
}

@DisplayName("Should duplicate ordinal key result")
Expand All @@ -275,8 +278,11 @@ void shouldDuplicateOrdinalKeyResult() {
.build();
KeyResult keyResultOrdinal = KeyResultOrdinal.Builder.builder().withTitle("Ordinal").build();
objectiveBusinessService.duplicateKeyResult(authorizationUser, keyResultOrdinal, objective);
verify(objectiveBusinessService.makeCopyOfKeyResultMetric(keyResultOrdinal, objective), times(1));
verify(keyResultBusinessService.createEntity(keyResultOrdinal, authorizationUser), times(1));
verify(objectiveBusinessService, times(1))
.makeCopyOfKeyResultOrdinal(keyResultOrdinal, objective);

verify(keyResultBusinessService, times(1))
.createEntity(any(KeyResult.class), any(AuthorizationUser.class));
}

@DisplayName("Should duplicate ActionList")
Expand Down

0 comments on commit be380b4

Please sign in to comment.