diff --git a/layout-server/src/test/java/org/finos/vuu/layoutserver/integration/ApplicationLayoutIntegrationTest.java b/layout-server/src/test/java/org/finos/vuu/layoutserver/integration/ApplicationLayoutIntegrationTest.java index 5874b0e1c8..7dfee983aa 100644 --- a/layout-server/src/test/java/org/finos/vuu/layoutserver/integration/ApplicationLayoutIntegrationTest.java +++ b/layout-server/src/test/java/org/finos/vuu/layoutserver/integration/ApplicationLayoutIntegrationTest.java @@ -95,15 +95,9 @@ public void getApplicationLayout_layoutExists_returns200WithPersistedLayout() th public void persistApplicationLayout_noLayoutExists_returns201AndPersistsLayout() throws Exception { String user = "user"; String definition = "{\"key\": \"value\"}"; - String settings = "{\"settingsKey\": \"settingsValue\"}"; - - String requestBody = "{" + - "\"applicationLayout\": " + definition + "," + - "\"settings\": " + settings + - "}"; mockMvc.perform(put(BASE_URL).header("username", user) - .content(requestBody) + .content(definition) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isCreated()) .andExpect(jsonPath("$").doesNotExist()); @@ -111,7 +105,7 @@ public void persistApplicationLayout_noLayoutExists_returns201AndPersistsLayout( ApplicationLayout persistedLayout = repository.findById(user).orElseThrow(); assertThat(persistedLayout.getUsername()).isEqualTo(user); - assertThat(persistedLayout.getApplicationLayout()).isEqualTo(objectMapper.readTree(requestBody)); + assertThat(persistedLayout.getApplicationLayout()).isEqualTo(objectMapper.readTree(definition)); } @Test @@ -124,15 +118,9 @@ public void persistApplicationLayout_layoutExists_returns201AndOverwritesLayout( persistApplicationLayout(user, initialDefinition); String newDefinition = "{\"new-key\": \"new-value\"}"; - String settings = "{\"settingsKey\": \"settingsValue\"}"; - - String requestBody = "{" + - "\"applicationLayout\": " + newDefinition + "," + - "\"settings\": " + settings + - "}"; mockMvc.perform(put(BASE_URL).header("username", user) - .content(requestBody) + .content(newDefinition) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isCreated()) .andExpect(jsonPath("$").doesNotExist()); @@ -142,7 +130,7 @@ public void persistApplicationLayout_layoutExists_returns201AndOverwritesLayout( ApplicationLayout retrievedLayout = repository.findById(user).orElseThrow(); assertThat(retrievedLayout.getUsername()).isEqualTo(user); - assertThat(retrievedLayout.getApplicationLayout()).isEqualTo(objectMapper.readTree(requestBody)); + assertThat(retrievedLayout.getApplicationLayout()).isEqualTo(objectMapper.readTree(newDefinition)); } @Test diff --git a/layout-server/src/test/java/org/finos/vuu/layoutserver/service/ApplicationLayoutServiceTest.java b/layout-server/src/test/java/org/finos/vuu/layoutserver/service/ApplicationLayoutServiceTest.java index 7276bf0254..3ed272f42b 100644 --- a/layout-server/src/test/java/org/finos/vuu/layoutserver/service/ApplicationLayoutServiceTest.java +++ b/layout-server/src/test/java/org/finos/vuu/layoutserver/service/ApplicationLayoutServiceTest.java @@ -41,7 +41,8 @@ public void getApplicationLayout_noLayout_returnsDefault() { ApplicationLayout actualLayout = service.getApplicationLayout("new user"); // Expecting application layout as defined in /test/resources/defaultApplicationLayout.json - ObjectNode expectedDefinition = objectNodeConverter.convertToEntityAttribute("{\"defaultLayoutKey\":\"default-layout-value\"}"); + ObjectNode expectedDefinition = + objectNodeConverter.convertToEntityAttribute("{\"defaultLayoutKey\":\"default-layout-value\"}"); assertThat(actualLayout.getUsername()).isNull(); assertThat(actualLayout.getApplicationLayout()).isEqualTo(expectedDefinition); diff --git a/vuu-ui/cypress/e2e/layout-management/api/application-layouts.cy.ts b/vuu-ui/cypress/e2e/layout-management/api/application-layouts.cy.ts index 9d9976b72a..91af92cc62 100644 --- a/vuu-ui/cypress/e2e/layout-management/api/application-layouts.cy.ts +++ b/vuu-ui/cypress/e2e/layout-management/api/application-layouts.cy.ts @@ -98,7 +98,7 @@ describe("Application Layouts", () => { JSON.stringify(requestBody) ); - expect(response.body.applicationLayout).to.not.contain( + expect(response.body.applicationLayout).to.not.equal( originalApplicationLayout ); expect(response.body.settings).to.not.equal(