Skip to content

Commit

Permalink
Merge branch 'main' into modification_by_filter_no_migration_data
Browse files Browse the repository at this point in the history
  • Loading branch information
thangqp authored Oct 3, 2024
2 parents 6638553 + 6ab069a commit ec90b8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,6 @@ public ResponseEntity<Optional<NetworkModificationResult>> applyModifications(@P
@Parameter(description = "the report uuid") @RequestParam(value = "reportUuid", required = false) UUID reportUuid,
@Parameter(description = "the reporter id") @RequestParam(value = "reporterId", required = false) String reporterId,
@RequestBody List<UUID> modificationsUuidList) {
return ResponseEntity.ok().body(networkModificationService.applyModificationsFromUuids(networkUuid, variantId, new ReportInfos(reportUuid, UUID.fromString(reporterId)), modificationsUuidList));
return ResponseEntity.ok().body(networkModificationService.applyModificationsFromUuids(networkUuid, variantId, new ReportInfos(reportUuid, reporterId != null ? UUID.fromString(reporterId) : null), modificationsUuidList));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1634,10 +1634,10 @@ public void testApplyModificationsFromUuids() throws Exception {
assertNotNull(sw);
assertFalse(sw.isOpen()); // switch is closed

// apply the modification on the network
// apply the modification on the network with a reporterId
mvcResult = mockMvc.perform(
put("/v1/networks/" + TEST_NETWORK_ID + "/apply"
+ "?variantId=" + NetworkCreation.VARIANT_ID + "&reporterId=" + UUID.randomUUID().toString())
+ "?variantId=" + NetworkCreation.VARIANT_ID + "&reporterId=" + UUID.randomUUID())
.content(objectWriter.writeValueAsString(modificationUuidList))
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk()).andReturn();
Expand All @@ -1651,5 +1651,14 @@ public void testApplyModificationsFromUuids() throws Exception {
assertEquals(modificationUuidList, newModificationUuidList);

assertTrue(sw.isOpen()); // switch is opened

// apply the modification on the network without reporterId
mvcResult = mockMvc.perform(
put("/v1/networks/" + TEST_NETWORK_ID + "/apply"
+ "?variantId=" + NetworkCreation.VARIANT_ID)
.content(objectWriter.writeValueAsString(modificationUuidList))
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk()).andReturn();
assertApplicationStatusOK(mvcResult);
}
}

0 comments on commit ec90b8f

Please sign in to comment.