Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1981,11 +1981,11 @@ public ResponseEntity<List<TimelineEventInfos>> getDynamicSimulationTimelineResu
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "The status of dynamic simulation result"),
@ApiResponse(responseCode = "204", description = "No dynamic simulation status"),
@ApiResponse(responseCode = "404", description = "The dynamic simulation has not been found")})
public ResponseEntity<DynamicSimulationStatus> getDynamicSimulationStatus(@Parameter(description = "study UUID") @PathVariable("studyUuid") UUID studyUuid,
public ResponseEntity<String> getDynamicSimulationStatus(@Parameter(description = "study UUID") @PathVariable("studyUuid") UUID studyUuid,
@Parameter(description = "rootNetworkUuid") @PathVariable("rootNetworkUuid") UUID rootNetworkUuid,
@Parameter(description = "nodeUuid") @PathVariable("nodeUuid") UUID nodeUuid) {
DynamicSimulationStatus result = rootNetworkNodeInfoService.getDynamicSimulationStatus(nodeUuid, rootNetworkUuid);
return result != null ? ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(result) :
return result != null ? ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(result.name()) :
ResponseEntity.noContent().build();
}

Expand Down Expand Up @@ -2031,11 +2031,11 @@ public ResponseEntity<Void> runDynamicSecurityAnalysis(@Parameter(description =
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "The status of dynamic security analysis result"),
@ApiResponse(responseCode = "204", description = "No dynamic security analysis status"),
@ApiResponse(responseCode = "404", description = "The dynamic security analysis has not been found")})
public ResponseEntity<DynamicSecurityAnalysisStatus> getDynamicSecurityAnalysisStatus(@Parameter(description = "study UUID") @PathVariable("studyUuid") UUID studyUuid,
public ResponseEntity<String> getDynamicSecurityAnalysisStatus(@Parameter(description = "study UUID") @PathVariable("studyUuid") UUID studyUuid,
@Parameter(description = "root network id") @PathVariable("rootNetworkUuid") UUID rootNetworkUuid,
@Parameter(description = "nodeUuid") @PathVariable("nodeUuid") UUID nodeUuid) {
DynamicSecurityAnalysisStatus result = rootNetworkNodeInfoService.getDynamicSecurityAnalysisStatus(nodeUuid, rootNetworkUuid);
return result != null ? ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(result) :
return result != null ? ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(result.name()) :
ResponseEntity.noContent().build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ void testGetDynamicSecurityAnalysisStatus() throws Exception {
STUDY_UUID, ROOT_NETWORK_UUID, NODE_UUID)
.header(HEADER_USER_ID_NAME, HEADER_USER_ID_VALUE))
.andExpect(status().isOk()).andReturn();
DynamicSecurityAnalysisStatus statusResult = objectMapper.readValue(result.getResponse().getContentAsString(), DynamicSecurityAnalysisStatus.class);
DynamicSecurityAnalysisStatus statusResult = DynamicSecurityAnalysisStatus.valueOf(result.getResponse().getContentAsString());

// --- check result --- //
DynamicSecurityAnalysisStatus statusExpected = DynamicSecurityAnalysisStatus.FAILED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ void testGetDynamicSimulationStatus() throws Exception {
STUDY_UUID, ROOT_NETWORK_UUID, NODE_UUID)
.header(HEADER_USER_ID_NAME, HEADER_USER_ID_VALUE))
.andExpect(status().isOk()).andReturn();
DynamicSimulationStatus statusResult = objectMapper.readValue(result.getResponse().getContentAsString(), DynamicSimulationStatus.class);
DynamicSimulationStatus statusResult = DynamicSimulationStatus.valueOf(result.getResponse().getContentAsString());

// --- check result --- //
DynamicSimulationStatus statusExpected = DynamicSimulationStatus.DIVERGED;
Expand Down