Skip to content

Commit 330c6ed

Browse files
authored
Bump gridsuite dependencies to 32 (#141)
Signed-off-by: Seddik Yengui <[email protected]>
1 parent 93c0f1e commit 330c6ed

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
<properties>
4545
<jib.from.image>powsybl/java-dynawo:2.1.0</jib.from.image>
46-
<gridsuite-dependencies.version>31</gridsuite-dependencies.version>
46+
<gridsuite-dependencies.version>32</gridsuite-dependencies.version>
4747
<liquibase-hibernate-package>org.gridsuite.securityanalysis.server</liquibase-hibernate-package>
4848
<db-util.version>1.0.5</db-util.version>
4949
<powsybl-network-store.version>1.16.0</powsybl-network-store.version>

src/main/java/org/gridsuite/securityanalysis/server/SecurityAnalysisController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ public ResponseEntity<Void> invalidateStatus(@Parameter(description = "Result uu
229229
@Operation(summary = "Stop a security analysis computation")
230230
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "The security analysis has been stopped")})
231231
public ResponseEntity<Void> stop(@Parameter(description = "Result UUID") @PathVariable("resultUuid") UUID resultUuid,
232-
@Parameter(description = "Result receiver") @RequestParam(name = "receiver", required = false) String receiver) {
233-
securityAnalysisService.stop(resultUuid, receiver);
232+
@Parameter(description = "Result receiver") @RequestParam(name = "receiver", required = false) String receiver,
233+
@RequestHeader(HEADER_USER_ID) String userId) {
234+
securityAnalysisService.stop(resultUuid, receiver, userId);
234235
return ResponseEntity.ok().build();
235236
}
236237

src/main/resources/config/application.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ spring:
3232
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.stopped
3333
publishFailed-out-0:
3434
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.failed
35-
output-bindings: publishRun-out-0;publishResult-out-0;publishCancel-out-0;publishStopped-out-0;publishFailed-out-0
35+
publishCancelFailed-out-0:
36+
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.cancelfailed
37+
output-bindings: publishRun-out-0;publishResult-out-0;publishCancel-out-0;publishStopped-out-0;publishFailed-out-;publishCancelFailed-out-0
3638

3739
powsybl-ws:
3840
database:

src/test/java/org/gridsuite/securityanalysis/server/SecurityAnalysisControllerTest.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,8 @@ public void stopTest() throws Exception {
648648
// wait for security analysis to actually run before trying to stop it
649649
countDownLatch.await();
650650

651-
mockMvc.perform(put("/" + VERSION + "/results/" + RESULT_UUID + "/stop"
652-
+ "?receiver=me"))
651+
mockMvc.perform(put("/" + VERSION + "/results/" + RESULT_UUID + "/stop" + "?receiver=me")
652+
.header(HEADER_USER_ID, "testUserId"))
653653
.andExpect(status().isOk());
654654

655655
Message<byte[]> message = output.receive(TIMEOUT * 3, "sa.stopped");
@@ -658,6 +658,19 @@ public void stopTest() throws Exception {
658658
assertEquals(getCancelMessage(COMPUTATION_TYPE), message.getHeaders().get("message"));
659659
}
660660

661+
@Test
662+
public void testStopAndFail() throws Exception {
663+
UUID randomUuid = UUID.randomUUID();
664+
mockMvc.perform(put("/" + VERSION + "/results/" + randomUuid + "/stop" + "?receiver=me")
665+
.header(HEADER_USER_ID, "testUserId"))
666+
.andExpect(status().isOk());
667+
668+
Message<byte[]> message = output.receive(TIMEOUT * 3, "sa.cancelfailed");
669+
assertEquals(randomUuid.toString(), message.getHeaders().get("resultUuid"));
670+
assertEquals("me", message.getHeaders().get("receiver"));
671+
assertEquals(getCancelFailedMessage(COMPUTATION_TYPE), message.getHeaders().get("message"));
672+
}
673+
661674
@Test
662675
public void runTestWithError() throws Exception {
663676
MvcResult mvcResult;

0 commit comments

Comments
 (0)