Skip to content

Commit

Permalink
springboot 3.1.2 (#90)
Browse files Browse the repository at this point in the history
Signed-off-by: Abdelsalem <[email protected]>
Co-authored-by: HARPER Jon <[email protected]>
  • Loading branch information
AbdelHedhili and jonenst authored Sep 22, 2023
1 parent ba40cb8 commit 6448dee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-parent-ws</artifactId>
<version>12</version>
<version>15</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -49,7 +49,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<powsybl-ws-dependencies.version>2.3.0</powsybl-ws-dependencies.version>
<powsybl-ws-dependencies.version>2.4.0</powsybl-ws-dependencies.version>
</properties>

<build>
Expand All @@ -72,8 +72,8 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
Expand Down Expand Up @@ -128,7 +128,7 @@
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>

<!-- Runtime dependencies -->
Expand Down
34 changes: 17 additions & 17 deletions src/test/java/com/powsybl/sld/server/SingleLineDiagramTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void test() throws Exception {
given(networkStoreService.getNetwork(testNetworkId, null)).willReturn(createNetwork());
given(networkStoreService.getNetwork(notFoundNetworkId, null)).willThrow(new PowsyblException());

MvcResult result = mvc.perform(get("/v1/svg/{networkUuid}/{voltageLevelId}/", testNetworkId, "vlFr1A"))
MvcResult result = mvc.perform(get("/v1/svg/{networkUuid}/{voltageLevelId}", testNetworkId, "vlFr1A"))
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(SingleLineDiagramController.IMAGE_SVG_PLUS_XML))
.andReturn();
Expand All @@ -133,18 +133,18 @@ public void test() throws Exception {
assertEquals("<?xml", result.getResponse().getContentAsString().substring(0, 5));

//voltage level not existing
mvc.perform(get("/v1/svg/{networkUuid}/{voltageLevelId}/", testNetworkId, "notFound"))
mvc.perform(get("/v1/svg/{networkUuid}/{voltageLevelId}", testNetworkId, "notFound"))
.andExpect(status().isNotFound());

//network not existing
mvc.perform(get("/v1/svg/{networkUuid}/{voltageLevelId}/", notFoundNetworkId, "vlFr1A"))
mvc.perform(get("/v1/svg/{networkUuid}/{voltageLevelId}", notFoundNetworkId, "vlFr1A"))
.andExpect(status().isNotFound());

//variant not existing
mvc.perform(get("/v1/svg/{networkUuid}/{voltageLevelId}?variantId=" + VARIANT_NOT_FOUND_ID, testNetworkId, "vlFr1A"))
.andExpect(status().isNotFound());

mvc.perform(get("/v1/metadata/{networkUuid}/{voltageLevelId}/", testNetworkId, "vlFr1A"))
mvc.perform(get("/v1/metadata/{networkUuid}/{voltageLevelId}", testNetworkId, "vlFr1A"))
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON));

Expand All @@ -153,18 +153,18 @@ public void test() throws Exception {
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON));

//voltage level not existing
mvc.perform(get("/v1/metadata/{networkUuid}/{voltageLevelId}/", testNetworkId, "NotFound"))
mvc.perform(get("/v1/metadata/{networkUuid}/{voltageLevelId}", testNetworkId, "NotFound"))
.andExpect(status().isNotFound());

//network not existing
mvc.perform(get("/v1/metadata/{networkUuid}/{voltageLevelId}/", notFoundNetworkId, "vlFr1A"))
mvc.perform(get("/v1/metadata/{networkUuid}/{voltageLevelId}", notFoundNetworkId, "vlFr1A"))
.andExpect(status().isNotFound());

//variant not existing
mvc.perform(get("/v1/metadata/{networkUuid}/{voltageLevelId}?variantId=" + VARIANT_NOT_FOUND_ID, testNetworkId, "vlFr1A"))
.andExpect(status().isNotFound());

mvc.perform(get("/v1/svg-and-metadata/{networkUuid}/{voltageLevelId}/", testNetworkId, "vlFr1A"))
mvc.perform(get("/v1/svg-and-metadata/{networkUuid}/{voltageLevelId}", testNetworkId, "vlFr1A"))
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON));

Expand All @@ -177,11 +177,11 @@ public void test() throws Exception {
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON));

//voltage level not existing
mvc.perform(get("/v1/svg-and-metadata/{networkUuid}/{voltageLevelId}/", testNetworkId, "NotFound"))
mvc.perform(get("/v1/svg-and-metadata/{networkUuid}/{voltageLevelId}", testNetworkId, "NotFound"))
.andExpect(status().isNotFound());

//network not existing
mvc.perform(get("/v1/svg-and-metadata/{networkUuid}/{voltageLevelId}/", notFoundNetworkId, "vlFr1A"))
mvc.perform(get("/v1/svg-and-metadata/{networkUuid}/{voltageLevelId}", notFoundNetworkId, "vlFr1A"))
.andExpect(status().isNotFound());

//variant not existing
Expand All @@ -197,7 +197,7 @@ public void testSubstations() throws Exception {
given(networkStoreService.getNetwork(testNetworkId, null)).willReturn(createNetwork());
given(networkStoreService.getNetwork(notFoundNetworkId, null)).willThrow(new PowsyblException());

MvcResult result = mvc.perform(get("/v1/substation-svg/{networkUuid}/{substationId}/", testNetworkId, "subFr1"))
MvcResult result = mvc.perform(get("/v1/substation-svg/{networkUuid}/{substationId}", testNetworkId, "subFr1"))
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(SingleLineDiagramController.IMAGE_SVG_PLUS_XML))
.andReturn();
Expand All @@ -210,18 +210,18 @@ public void testSubstations() throws Exception {
assertEquals("<?xml", result.getResponse().getContentAsString().substring(0, 5));

// substation not existing
mvc.perform(get("/v1/substation-svg/{networkUuid}/{substationId}/", testNetworkId, "notFound"))
mvc.perform(get("/v1/substation-svg/{networkUuid}/{substationId}", testNetworkId, "notFound"))
.andExpect(status().isNotFound());

// network not existing
mvc.perform(get("/v1/substation-svg/{networkUuid}/{substationId}/", notFoundNetworkId, "subFr1"))
mvc.perform(get("/v1/substation-svg/{networkUuid}/{substationId}", notFoundNetworkId, "subFr1"))
.andExpect(status().isNotFound());

// variant not existing
mvc.perform(get("/v1/substation-svg/{networkUuid}/{substationId}?variantId=" + VARIANT_NOT_FOUND_ID, testNetworkId, "subFr1"))
.andExpect(status().isNotFound());

mvc.perform(get("/v1/substation-metadata/{networkUuid}/{substationId}/", testNetworkId, "subFr1"))
mvc.perform(get("/v1/substation-metadata/{networkUuid}/{substationId}", testNetworkId, "subFr1"))
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON));

Expand All @@ -230,11 +230,11 @@ public void testSubstations() throws Exception {
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON));

// substation not existing
mvc.perform(get("/v1/substation-metadata/{networkUuid}/{substationId}/", testNetworkId, "NotFound"))
mvc.perform(get("/v1/substation-metadata/{networkUuid}/{substationId}", testNetworkId, "NotFound"))
.andExpect(status().isNotFound());

// network not existing
mvc.perform(get("/v1/substation-metadata/{networkUuid}/{substationId}/", notFoundNetworkId, "subFr2"))
mvc.perform(get("/v1/substation-metadata/{networkUuid}/{substationId}", notFoundNetworkId, "subFr2"))
.andExpect(status().isNotFound());

// variant not existing
Expand All @@ -258,11 +258,11 @@ public void testSubstations() throws Exception {
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON));

// substation not existing
mvc.perform(get("/v1/substation-svg-and-metadata/{networkUuid}/{substationId}/", testNetworkId, "NotFound"))
mvc.perform(get("/v1/substation-svg-and-metadata/{networkUuid}/{substationId}", testNetworkId, "NotFound"))
.andExpect(status().isNotFound());

// network not existing
mvc.perform(get("/v1/substation-svg-and-metadata/{networkUuid}/{substationId}/", notFoundNetworkId, "subFr2"))
mvc.perform(get("/v1/substation-svg-and-metadata/{networkUuid}/{substationId}", notFoundNetworkId, "subFr2"))
.andExpect(status().isNotFound());

// variant not existing
Expand Down

0 comments on commit 6448dee

Please sign in to comment.