-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug/1255 Duplicating a objective does not bring all properties of the KeyResults #1294
base: main
Are you sure you want to change the base?
Bug/1255 Duplicating a objective does not bring all properties of the KeyResults #1294
Conversation
d8561be
to
f090a48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks already quite good. There are a couple of minor things and also the the organization of the code that should be improved.
backend/src/main/java/ch/puzzle/okr/service/business/ObjectiveBusinessService.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/ch/puzzle/okr/service/persistence/ActionPersistenceService.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/ch/puzzle/okr/service/business/ActionBusinessService.java
Outdated
Show resolved
Hide resolved
backend/src/test/java/ch/puzzle/okr/service/persistence/ActionPersistenceServiceIT.java
Outdated
Show resolved
Hide resolved
BDDMockito.given(keyResultMapper.toDto(any(KeyResultMetric.class), any())).willReturn(keyResultMetricDto); | ||
BDDMockito.given(keyResultMapper.toDto(any(KeyResultOrdinal.class), any())).willReturn(keyResultOrdinalDto); | ||
BDDMockito.given(objectiveAuthorizationService.getAuthorizationService()).willReturn(authorizationService); | ||
BDDMockito.given(objectiveMapper.toDto(objective1)).willReturn(objective1Dto); | ||
BDDMockito.given(objectiveMapper.toDto(any())).willReturn(objective1Dto); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be careful using any here, could lead to unexpected behavior. Generally it's considered to be best practice to mock as precise as possible.
CompletedBusinessService completedBusinessService) { | ||
CompletedBusinessService completedBusinessService, | ||
ActionPersistenceService actionPersistenceService, | ||
ActionBusinessService actionBusinessService) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action business service should be enough there should be no need to use action persisstence service here
} | ||
|
||
List<Action> copiedActions = actionBusinessService.createDuplicateOfActions(keyResult, newKeyResult); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle the entity in the actionBusinessService
No description provided.