Skip to content

Commit

Permalink
update backend config tests to test new attr
Browse files Browse the repository at this point in the history
  • Loading branch information
nevio18324 committed Nov 19, 2024
1 parent 019c6b8 commit 8faea69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void shouldGetClientConfig() throws Exception {

mvc.perform(get("/config").contentType(MediaType.APPLICATION_JSON))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(jsonPath(JSON_PATH_ROOT, Matchers.aMapWithSize(9)))
.andExpect(jsonPath(JSON_PATH_ROOT, Matchers.aMapWithSize(10)))
.andExpect(jsonPath("$.activeProfile", Matchers.is("Active_Profile")))
.andExpect(jsonPath("$.issuer", Matchers.is("Issuer")))
.andExpect(jsonPath("$.clientId", Matchers.is("Client_Id")))
Expand All @@ -47,14 +47,15 @@ void shouldGetClientConfig() throws Exception {
.andExpect(jsonPath("$.triangles", Matchers.is("Triangles")))
.andExpect(jsonPath("$.backgroundLogo", Matchers.is("Background_Logo")))
.andExpect(jsonPath("$.title", Matchers.is("Title")))
.andExpect(jsonPath("$.supportSiteUrl", Matchers.is("supportSiteUrl")))
.andExpect(jsonPath("$.customStyles.font-family", Matchers.is("verdana")))
.andExpect(jsonPath("$.customStyles.font-size", Matchers.is("20px")));
}

private ClientConfigDto createClientConfigDto() {
Map<String, String> customStyles = Map.of("font-family", "verdana", "font-size", "20px");
return new ClientConfigDto("Active_Profile", "Issuer", "Client_Id", "Favicon", "Logo", "Triangles",
"Background_Logo", "Title", customStyles);
"Background_Logo", "Title", "supportSiteUrl", customStyles);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class TenantClientCustomizationProviderTestIT {
private static final String BACKGROUND_LOGO = "background-logo";
private static final String FAVICON = "favicon";
private static final String TITLE = "title";
private static final String SUPPORT_SITE_URL = "supportSiteUrl";

private static final String CUSTOM_STYLE_NAME = "okr-topbar-background-color";
private static final String CUSTOM_STYLE_VALUE = "css-custom-value";
Expand All @@ -43,6 +44,7 @@ private void setupPropertiesForTenantWithId(String id) {
mockProperty("okr.tenants.{0}.clientcustomization.background-logo", BACKGROUND_LOGO, id);
mockProperty("okr.tenants.{0}.clientcustomization.favicon", FAVICON, id);
mockProperty("okr.tenants.{0}.clientcustomization.title", TITLE, id);
mockProperty("okr.tenants.{0}.clientcustomization.supportSiteUrl", SUPPORT_SITE_URL, id);
mockProperty("okr.tenants.{0}.clientcustomization.customstyles.okr-topbar-background-color", CUSTOM_STYLE_VALUE,
id);
}
Expand Down Expand Up @@ -77,6 +79,7 @@ private void assertTenantClientCustomization(TenantClientCustomization customiza
assertEquals(prefix(tenantId) + TRIANGLES, customization.triangles());
assertEquals(prefix(tenantId) + BACKGROUND_LOGO, customization.backgroundLogo());
assertEquals(prefix(tenantId) + TITLE, customization.title());
assertEquals(prefix(tenantId) + SUPPORT_SITE_URL, customization.supportSiteUrl());
assertCustomStyles(customization, tenantId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ private TenantClientCustomization getTenantClientCustomization(String tenantId)
prefix(tenantId) + "triangles", //
prefix(tenantId) + "backgroundLogo", //
prefix(tenantId) + "title", //
prefix(tenantId) + "supportSiteUrl", //
new HashMap<>());
}

Expand Down

0 comments on commit 8faea69

Please sign in to comment.