From c3ddc70905a7b9aca298714a0334325e402b6e57 Mon Sep 17 00:00:00 2001 From: Giannin Date: Thu, 19 Dec 2024 09:53:36 +0100 Subject: [PATCH] Fix displayname annotation for parameterized test in the service.clientconfig package --- .../okr/service/clientconfig/ClientConfigServiceIT.java | 6 +++--- .../service/clientconfig/ClientConfigServiceTest.java | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceIT.java b/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceIT.java index 973341ddb2..44465e0f68 100644 --- a/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceIT.java +++ b/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceIT.java @@ -23,7 +23,7 @@ class ClientConfigServiceIT { @Autowired private ClientConfigService clientConfigService; - @ParameterizedTest(name = "should get correct config on getConfigBasedOnActiveEnv() based on the hostname {0}, active profile {1}, issuer {2} and client id {3}") + @ParameterizedTest(name = "Should get correct config on getConfigBasedOnActiveEnv() based on the hostname {0}, active profile {1}, issuer {2} and client id {3}") @MethodSource("tenantConfigs") void getConfigBasedOnActiveEnvWithValidSubdomainReturnsCorrectTenantConfig(String hostname, String activeProfile, String issuer, String clientId) { @@ -43,14 +43,14 @@ private static Stream tenantConfigs() { Arguments.of("acme.okr.puzzle.ch", "prod", "http://localhost:8544/realms/pitc", "acme_okr_staging")); } - @DisplayName("should throw exception on getConfigBasedOnActiveEnv() when subdomain is invalid") + @DisplayName("Should throw exception on getConfigBasedOnActiveEnv() when subdomain is invalid") @Test void getConfigBasedOnActiveEnvWithInvalidSubdomainThrowsException() { assertThrowsExactly(EntityNotFoundException.class, () -> clientConfigService.getConfigBasedOnActiveEnv("foobar.okr.puzzle.ch")); } - @DisplayName("should return config with correct values on getConfigBasedOnActiveEnv()") + @DisplayName("Should return config with correct values on getConfigBasedOnActiveEnv()") @Test void getClientConfigWithOtherValuesReturnsCorrectValues() { // arrange + act diff --git a/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceTest.java b/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceTest.java index c7326920de..02119fa743 100644 --- a/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceTest.java +++ b/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceTest.java @@ -18,8 +18,7 @@ public class ClientConfigServiceTest { - @DisplayName("should be successful on getConfigBasedOnActiveEnv() when tenant is configured properly") - @ParameterizedTest + @ParameterizedTest(name = "Should be successful on getConfigBasedOnActiveEnv() when tenant is configured properly with tenant {0} and hostname {1}") @CsvSource({ "pitc,pitc.ork.ch", "acme,acme-ork.ch" }) void getConfigBasedOnActiveEnvShouldBeSuccessfulWhenTenantIsConfiguredProperly(String tenant, String hostname) { // arrange @@ -34,8 +33,7 @@ void getConfigBasedOnActiveEnvShouldBeSuccessfulWhenTenantIsConfiguredProperly(S assertClientConfigDto(configBasedOnActiveEnv, tenant); } - @DisplayName("should throw exception on getConfigBasedOnActiveEnv() when client customization is not found") - @ParameterizedTest + @ParameterizedTest(name = "Should throw exception on getConfigBasedOnActiveEnv() when client customization is not found for tenant {0}, hostname {1} and subdomain {2}") @CsvSource({ "pitc,pitc.okr.ch,pitc", "acme,acme-okr.ch,acme-okr" }) void getConfigBasedOnActiveEnvShouldThrowExceptionIfClientCustomizationIsNotFound(String tenant, String hostname, String subdomain) { @@ -51,8 +49,7 @@ void getConfigBasedOnActiveEnvShouldThrowExceptionIfClientCustomizationIsNotFoun assertEquals(expectedErrorMessage, entityNotFoundException.getMessage()); } - @DisplayName("should throw exception getConfigBasedOnActiveEnv when client config is not found") - @ParameterizedTest + @ParameterizedTest(name = "Should throw exception getConfigBasedOnActiveEnv when client config is not found for tenant {0}, hostname {1} and subdomain {2} ") @CsvSource({ "pitc,pitc.okr.ch,pitc", "acme,acme-okr.ch,acme-okr" }) void getConfigBasedOnActiveEnvShouldThrowExceptionIfClientConfigIsNotFound(String tenant, String hostname, String subdomain) {