From f42e5a5c550dfaa5cc9490b7509dfd0a0c739c15 Mon Sep 17 00:00:00 2001 From: "Vila,Jordi (IT EDP)" Date: Fri, 15 May 2026 11:21:58 +0200 Subject: [PATCH 1/2] Fix azure token rest url references --- .../config/ApplicationPropertiesConfiguration.java | 2 +- src/main/resources/application.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opendevstack/component_provisioner/config/ApplicationPropertiesConfiguration.java b/src/main/java/org/opendevstack/component_provisioner/config/ApplicationPropertiesConfiguration.java index 6bde0f2..22dadf9 100644 --- a/src/main/java/org/opendevstack/component_provisioner/config/ApplicationPropertiesConfiguration.java +++ b/src/main/java/org/opendevstack/component_provisioner/config/ApplicationPropertiesConfiguration.java @@ -65,7 +65,7 @@ public ExternalServiceProps projectsInfoServiceServiceProps() { } @Bean("azureAdTokenServiceProps") - @ConfigurationProperties(prefix = "component-provisioner.azure.token.url") + @ConfigurationProperties(prefix = "component-provisioner.azure.token") public AzureAdTokenServiceProps azureAdTokenServiceProps() { return AzureAdTokenServiceProps.builder().build(); } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1371de4..1a83bfa 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -50,7 +50,7 @@ user-actions: component-provisioner: azure: token: - url: ${AZURE_TOKEN_URL} + tokenRestUrl: ${AZURE_TOKEN_URL} caching: projects-info-services-cache: enabled: true From c371578a06a3e6cf6c43ed43881c64bc2852b906 Mon Sep 17 00:00:00 2001 From: "Vila,Jordi (IT EDP)" Date: Fri, 15 May 2026 11:32:27 +0200 Subject: [PATCH 2/2] Rename property to be less redundant --- .../config/ApplicationPropertiesConfiguration.java | 2 +- .../server/services/AzureAdTokenService.java | 2 +- src/main/resources/application.yml | 2 +- .../server/services/AzureAdTokenServiceTest.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/opendevstack/component_provisioner/config/ApplicationPropertiesConfiguration.java b/src/main/java/org/opendevstack/component_provisioner/config/ApplicationPropertiesConfiguration.java index 22dadf9..304795d 100644 --- a/src/main/java/org/opendevstack/component_provisioner/config/ApplicationPropertiesConfiguration.java +++ b/src/main/java/org/opendevstack/component_provisioner/config/ApplicationPropertiesConfiguration.java @@ -123,7 +123,7 @@ public static class OdsApiServerServiceProps { @Builder // useful for unit testing @Data public static class AzureAdTokenServiceProps { - private String tokenRestUrl; + private String url; } @Builder // useful for unit testing diff --git a/src/main/java/org/opendevstack/component_provisioner/server/services/AzureAdTokenService.java b/src/main/java/org/opendevstack/component_provisioner/server/services/AzureAdTokenService.java index 3d4f90a..a67ab6a 100644 --- a/src/main/java/org/opendevstack/component_provisioner/server/services/AzureAdTokenService.java +++ b/src/main/java/org/opendevstack/component_provisioner/server/services/AzureAdTokenService.java @@ -30,7 +30,7 @@ public String getAccessToken(String clientId, String clientSecret, String scope) HttpEntity> request = new HttpEntity<>(body, headers); - var tokenRestUrl = azureAdTokenServiceProps.getTokenRestUrl(); + var tokenRestUrl = azureAdTokenServiceProps.getUrl(); ResponseEntity response = restTemplate.postForEntity( diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1a83bfa..1371de4 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -50,7 +50,7 @@ user-actions: component-provisioner: azure: token: - tokenRestUrl: ${AZURE_TOKEN_URL} + url: ${AZURE_TOKEN_URL} caching: projects-info-services-cache: enabled: true diff --git a/src/test/java/org/opendevstack/component_provisioner/server/services/AzureAdTokenServiceTest.java b/src/test/java/org/opendevstack/component_provisioner/server/services/AzureAdTokenServiceTest.java index 40ae3e4..7c72835 100644 --- a/src/test/java/org/opendevstack/component_provisioner/server/services/AzureAdTokenServiceTest.java +++ b/src/test/java/org/opendevstack/component_provisioner/server/services/AzureAdTokenServiceTest.java @@ -43,7 +43,7 @@ void getAccessToken_shouldReturnToken_whenResponseIsSuccessful() { ResponseEntity responseEntity = new ResponseEntity<>(mockResponse, HttpStatus.OK); - when(azureAdTokenServiceProps.getTokenRestUrl()).thenReturn("https://login.microsoftonline.com/example-tenant/oauth2/v2.0/token"); + when(azureAdTokenServiceProps.getUrl()).thenReturn("https://login.microsoftonline.com/example-tenant/oauth2/v2.0/token"); when(restTemplate.postForEntity(anyString(), any(), eq(AzureTokenResponse.class))) .thenReturn(responseEntity);