Skip to content

Commit 7b51075

Browse files
authored
HTM-1755: update test expectations after adding extra tables and layers
1 parent ef00f91 commit 7b51075

9 files changed

+1
-29
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import static org.hamcrest.Matchers.matchesPattern;
99
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
10-
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
1110
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
1211
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
1312
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -159,7 +158,6 @@ void finds_3d_application() throws Exception {
159158
String path = basePath + "/app/3d_utrecht";
160159
mockMvc.perform(get(path).accept(MediaType.APPLICATION_JSON).with(setServletPath(path)))
161160
.andExpect(status().isOk())
162-
.andDo(print())
163161
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
164162
.andExpect(jsonPath("$.kind").value("app"))
165163
.andExpect(jsonPath("$.name").value("3d_utrecht"))

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
99
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
10-
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
1110
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
1211
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
1312
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
@@ -168,7 +167,6 @@ void addAttachmentsNotSupported() throws Exception {
168167
.with(setServletPath(url))
169168
.accept(MediaType.APPLICATION_JSON))
170169
.andExpect(status().isBadRequest())
171-
.andDo(print())
172170
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
173171
.andExpect(jsonPath("$.message").value("Layer does not support attachments"));
174172
}
@@ -195,7 +193,6 @@ void addAttachmentsToNonEditableLayer() throws Exception {
195193
.with(setServletPath(url))
196194
.accept(MediaType.APPLICATION_JSON))
197195
.andExpect(status().isBadRequest())
198-
.andDo(print())
199196
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
200197
.andExpect(jsonPath("$.message").value("Layer is not editable"));
201198
}

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
1515
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
1616
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
17-
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
1817
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
1918
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
2019
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -108,7 +107,6 @@ void get_preexisting_drawing() throws Exception {
108107

109108
mockMvc.perform(get(url).accept(MediaType.APPLICATION_JSON).with(setServletPath(url)))
110109
.andExpect(status().isOk())
111-
.andDo(print())
112110
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
113111
.andExpect(jsonPath("$.id").value(KNOWN_DRAWING_ID))
114112
.andExpect(jsonPath("$.id", matchesPattern(UUID_REGEX)))
@@ -141,7 +139,6 @@ void create_drawing_by_admin() throws Exception {
141139
.with(setServletPath(url))
142140
.contentType(MediaType.APPLICATION_JSON)
143141
.content(NEW_DRAWING_JSON))
144-
.andDo(print())
145142
.andExpect(status().isCreated())
146143
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
147144
// API created values
@@ -253,7 +250,6 @@ void update_drawing_by_admin() throws Exception {
253250
.contentType(MediaType.APPLICATION_JSON)
254251
.characterEncoding(Charset.defaultCharset())
255252
.content(updatedDrawing))
256-
.andDo(print())
257253
.andExpect(status().isOk())
258254
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
259255
// API-created values
@@ -316,7 +312,6 @@ void get_private_drawing_other_user() throws Exception {
316312

317313
mockMvc.perform(get(url).accept(MediaType.APPLICATION_JSON).with(setServletPath(url)))
318314
.andExpect(status().isUnauthorized())
319-
.andDo(print())
320315
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
321316
.andExpect(jsonPath("$.code").value(401))
322317
.andExpect(jsonPath("$.url").value("/login"));
@@ -359,7 +354,6 @@ void get_drawing_in_default_application_srs() throws Exception {
359354
mockMvc.perform(get(getDrawingUrl).accept(MediaType.APPLICATION_JSON).with(setServletPath(getDrawingUrl)))
360355
.andExpect(status().is2xxSuccessful())
361356
.andExpect(status().is(200))
362-
.andDo(print())
363357
.andExpect(jsonPath("$.id").value(drawingId))
364358
.andExpect(jsonPath("$.createdBy").value("tm-admin"))
365359
.andExpect(jsonPath("$.updatedBy").value("tm-admin"))
@@ -404,7 +398,6 @@ void get_drawing_in_foreign_application_srs() throws Exception {
404398
final String getDrawingUrl = apiBasePath + "/app/austria/drawing/" + drawingId;
405399

406400
mockMvc.perform(get(getDrawingUrl).accept(MediaType.APPLICATION_JSON).with(setServletPath(getDrawingUrl)))
407-
.andDo(print())
408401
.andExpect(status().is2xxSuccessful())
409402
.andExpect(status().is(200))
410403
.andExpect(jsonPath("$.id").value(drawingId))

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.springframework.security.test.context.support.WithMockUser;
3838
import org.springframework.test.web.servlet.MockMvc;
3939
import org.springframework.test.web.servlet.MvcResult;
40-
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
4140
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
4241
import org.springframework.web.context.WebApplicationContext;
4342
import org.tailormap.api.StaticTestData;
@@ -441,7 +440,6 @@ void testPostOrcl() throws Exception {
441440
.with(setServletPath(url))
442441
.contentType(MediaType.APPLICATION_JSON)
443442
.content(content))
444-
.andDo(MockMvcResultHandlers.print())
445443
.andExpect(status().is2xxSuccessful())
446444
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
447445
.andExpect(jsonPath("$.__fid").value(fid))
@@ -558,7 +556,6 @@ void testPatchOrcl() throws Exception {
558556
.content("{\"attributes\":{\"INONDERZOEK\":true,\"CLASS\":\"woeste bergbeek\",\"GEOM\":\""
559557
+ StaticTestData.get("waterdeel__edit_geom")
560558
+ "\"}}"))
561-
.andDo(MockMvcResultHandlers.print())
562559
.andExpect(status().is2xxSuccessful())
563560
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
564561
.andExpect(jsonPath("$.__fid").value(StaticTestData.get("waterdeel__fid_edit")))
@@ -685,7 +682,6 @@ void testDeleteExistingFeaturePG() throws Exception {
685682
void testDeleteExistingFeatureOrcl() throws Exception {
686683
final String url = apiBasePath + waterdeelUrlOracle + "/" + StaticTestData.get("waterdeel__fid_delete");
687684
mockMvc.perform(delete(url).accept(MediaType.APPLICATION_JSON).with(setServletPath(url)))
688-
.andDo(MockMvcResultHandlers.print())
689685
.andExpect(status().is2xxSuccessful())
690686
.andExpect(status().is(204));
691687
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
3030
import org.springframework.http.MediaType;
3131
import org.springframework.test.web.servlet.MockMvc;
32-
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
3332
import org.tailormap.api.annotation.PostgresIntegrationTest;
3433

3534
@PostgresIntegrationTest
@@ -193,7 +192,6 @@ void shouldNotExportHiddenAttributesInGeoJSON() throws Exception {
193192
.with(setServletPath(url))
194193
.param("outputFormat", MediaType.APPLICATION_JSON_VALUE)
195194
.param("filter", "(identificatie = 'P0026.8abeacd54c5b7500047b2112796cab56')"))
196-
.andDo(MockMvcResultHandlers.print())
197195
.andExpect(status().isOk())
198196
.andExpect(jsonPath("$.type").value("FeatureCollection"))
199197
.andExpect(jsonPath("$.features.length()").value(1))

src/test/java/org/tailormap/api/controller/admin/ApplicationAdminControllerIntegrationTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.springframework.test.jdbc.JdbcTestUtils;
3030
import org.springframework.test.web.servlet.MockMvc;
3131
import org.springframework.test.web.servlet.MvcResult;
32-
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
3332
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
3433
import org.springframework.web.context.WebApplicationContext;
3534
import org.tailormap.api.annotation.PostgresIntegrationTest;
@@ -121,7 +120,6 @@ void testCantCreateApplicationWithDuplicateName() throws Exception {
121120
mockMvc.perform(post(adminBasePath + "/applications")
122121
.contentType(MediaType.APPLICATION_JSON)
123122
.content(getTestApplicationJson(appName)))
124-
.andDo(MockMvcResultHandlers.print())
125123
.andExpect(status().isBadRequest())
126124
.andExpect(content().json(getDuplicateNameErrorJson(appName)));
127125
}

src/test/java/org/tailormap/api/controller/admin/FeatureSourceAdminControllerIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class FeatureSourceAdminControllerIntegrationTest {
4141
authorities = {Group.ADMIN})
4242
void refreshJdbcFeatureSourceCapabilities() throws Exception {
4343
MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(context).build(); // Required for Spring Data Rest APIs
44-
final int expectedTotal = 32;
44+
final int expectedTotal = 38;
4545

4646
String host = "localhost";
4747
int port = 54322;

src/test/java/org/tailormap/api/controller/admin/TaskAdminControllerIntegrationTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
1313
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
1414
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
15-
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
1615
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
1716
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
1817
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -99,7 +98,6 @@ void listTasksForExistingType() throws Exception {
9998
MvcResult result = mockMvc.perform(get(adminBasePath + "/tasks")
10099
.queryParam(TYPE_KEY, TEST_TASK_TYPE)
101100
.accept(MediaType.APPLICATION_JSON))
102-
.andDo(print())
103101
.andExpect(status().isOk())
104102
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
105103
.andExpect(jsonPath("$.tasks").isArray())
@@ -124,7 +122,6 @@ void listTasksForNonExistentType() throws Exception {
124122
mockMvc.perform(get(adminBasePath + "/tasks")
125123
.queryParam(TYPE_KEY, "does-not-exist")
126124
.accept(MediaType.APPLICATION_JSON))
127-
.andDo(print())
128125
.andExpect(status().isOk())
129126
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
130127
.andExpect(jsonPath("$.tasks").isArray())
@@ -150,7 +147,6 @@ void detailsOfTask() throws Exception {
150147

151148
mockMvc.perform(get(adminBasePath + "/tasks/{type}/{uuid}", detailsType, detailsUUID)
152149
.accept(MediaType.APPLICATION_JSON))
153-
.andDo(print())
154150
.andExpect(status().isOk())
155151
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
156152
.andExpect(jsonPath("$.uuid").value(detailsUUID))
@@ -167,7 +163,6 @@ void startNonExistentTask() throws Exception {
167163
TEST_TASK_TYPE,
168164
"6308d26e-fe1e-4268-bb28-20db2cd06914")
169165
.accept(MediaType.APPLICATION_JSON))
170-
.andDo(print())
171166
.andExpect(status().isNotFound())
172167
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
173168
.andExpect(jsonPath("$.message").value("Task not found"));
@@ -243,7 +238,6 @@ void deleteSearchIndexTask() throws Exception {
243238
MvcResult result = mockMvc.perform(get(adminBasePath + "/tasks")
244239
.queryParam(TYPE_KEY, TaskType.INDEX.getValue())
245240
.accept(MediaType.APPLICATION_JSON))
246-
.andDo(print())
247241
.andExpect(status().isOk())
248242
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
249243
.andExpect(jsonPath("$.tasks").isArray())

src/test/java/org/tailormap/api/controller/admin/UnreachableSolrAdminControllerIntegrationTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
1111
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
1212
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
13-
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
1413
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
1514
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
1615
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -89,7 +88,6 @@ void failClearingIndex() throws Exception {
8988
@Order(3)
9089
void failRecreatingIndex() throws Exception {
9190
mockMvc.perform(put(adminBasePath + "/index/1").accept(MediaType.APPLICATION_JSON))
92-
.andDo(print())
9391
.andExpect(status().isInternalServerError())
9492
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
9593
.andExpect(jsonPath("$.code").value(500))

0 commit comments

Comments
 (0)