Skip to content
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

Merged
merged 13 commits into from
Oct 8, 2024

Conversation

AAJELLAL
Copy link
Contributor

No description provided.

@@ -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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename by computationParametersUpdated

Copy link
Contributor Author

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename by emitComputationParamsChanged

Copy link
Contributor Author

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));

Copy link
Contributor

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));

Copy link
Contributor

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

Copy link

sonarcloud bot commented Oct 7, 2024

@Mathieu-Deharbe
Copy link
Contributor

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.

@sBouzols sBouzols merged commit 67d82ab into main Oct 8, 2024
3 checks passed
@sBouzols sBouzols deleted the handle-params-notification branch October 8, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants