-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use notifications to manage parameter changes #614
Conversation
Signed-off-by: AAJELLAL <[email protected]>
Signed-off-by: AAJELLAL <[email protected]>
… handle-params-notification
… handle-params-notification
Signed-off-by: AAJELLAL <[email protected]>
Signed-off-by: AAJELLAL <[email protected]>
… handle-params-notification
Signed-off-by: AAJELLAL <[email protected]>
src/main/java/org/gridsuite/study/server/service/StudyService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: AAJELLAL <[email protected]>
… handle-params-notification
Signed-off-by: AAJELLAL <[email protected]>
@@ -80,6 +82,7 @@ public class NotificationService { | |||
public static final String UPDATE_TYPE_STATE_ESTIMATION_FAILED = "stateEstimation_failed"; | |||
public static final String UPDATE_TYPE_STATE_ESTIMATION_RESULT = "stateEstimationResult"; | |||
public static final String UPDATE_TYPE_STATE_ESTIMATION_STATUS = "stateEstimation_status"; | |||
public static final String UPDATE_TYPE_COMPUTATION_PARAMETERS = "computationParameters"; |
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.
Rename by computationParametersUpdated
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.
Done.
@@ -166,6 +169,15 @@ public void emitStudyChanged(UUID studyUuid, UUID nodeUuid, String updateType) { | |||
.build()); | |||
} | |||
|
|||
@PostCompletion | |||
public void emitStudyComputationParamsChanged(UUID studyUuid, ComputationType computationType) { |
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.
Rename by emitComputationParamsChanged
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.
Done.
Signed-off-by: AAJELLAL <[email protected]>
@@ -643,6 +644,9 @@ private void createOrUpdateParametersAndDoChecks(UUID studyNameUserIdUuid, Strin | |||
|
|||
message = output.receive(TIMEOUT, elementUpdateDestination); | |||
assertEquals(studyNameUserIdUuid, message.getHeaders().get(NotificationService.HEADER_ELEMENT_UUID)); | |||
message = output.receive(TIMEOUT, studyUpdateDestination); | |||
assertEquals(UPDATE_TYPE_COMPUTATION_PARAMETERS, message.getHeaders().get(NotificationService.HEADER_UPDATE_TYPE)); | |||
|
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.
could assert that it's certainly LOADFLOW in HEADER_COMPUTATION_TYPE here as well
@@ -656,6 +657,8 @@ public void testNonEvacuatedEnergyParameters() throws Exception { | |||
.contentType(MediaType.APPLICATION_JSON) | |||
.content(myBodyJson)).andExpect( | |||
status().isOk()); | |||
Message<byte[]> message = output.receive(TIMEOUT, studyUpdateDestination); | |||
assertEquals(UPDATE_TYPE_COMPUTATION_PARAMETERS, message.getHeaders().get(NotificationService.HEADER_UPDATE_TYPE)); | |||
|
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.
same, you don't test HEADER_COMPUTATION_TYPE here and elsewhere
…into handle-params-notification
Quality Gate passedIssues Measures |
In order to correct the first Circular dependency I extracted the computations notification types to a specific class : #620 They are not used anymore in NotificationService anyway and there are so many static string there that some structuration might be better. Do as you wish. |
No description provided.