Skip to content

Commit d5fa703

Browse files
committed
HTM-1875: update viewer API model to provide styles to viewer
1 parent 2a47f06 commit d5fa703

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/main/resources/openapi/viewer-schemas.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ components:
165165
nullable: true
166166
hiddenFunctionality:
167167
$ref: './common-schemas.yaml#/components/schemas/HiddenLayerFunctionality'
168+
styles:
169+
description: 'Configured styles for this layer (if supported by the service)'
170+
type: array
171+
items:
172+
$ref: './common-schemas.yaml#/components/schemas/WMSStyle'
173+
168174

169175
LayerTreeNode:
170176
description: Grouping of layers in a tree structure.

src/test/java/org/tailormap/api/controller/ViewerControllerIntegrationTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import static org.junit.jupiter.api.Assertions.assertEquals;
1313
import static org.junit.jupiter.api.Assertions.assertTrue;
1414
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
15+
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
1516
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
1617
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
1718
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -195,16 +196,21 @@ void should_not_contain_proxied_secured_service_layer_on_public_app_when_unautho
195196
}
196197

197198
@Test
198-
void should_contain_description() throws Exception {
199+
void should_contain_description_and_styles() throws Exception {
199200
final String path = apiBasePath + "/app/default/map";
200201
mockMvc.perform(get(path).accept(MediaType.APPLICATION_JSON).with(setServletPath(path)))
201202
.andExpect(status().isOk())
203+
.andDo(print())
202204
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
203205
.andExpect(
204206
// Application layer description
205207
jsonPath(
206208
"$.appLayers[?(@.id === 'lyr:snapshot-geoserver:postgis:begroeidterreindeel')].description")
207-
.value(contains(startsWith("This layer shows data from https://www.postgis.net"))));
209+
.value(contains(startsWith("This layer shows data from https://www.postgis.net"))))
210+
.andExpect(
211+
// Application layer configured styles
212+
jsonPath("$.appLayers[?(@.id === 'lyr:snapshot-geoserver:postgis:begroeidterreindeel')].styles")
213+
.isArray());
208214
}
209215

210216
@Test

0 commit comments

Comments
 (0)