Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public String getAccessToken(String clientId, String clientSecret, String scope)
HttpEntity<MultiValueMap<String, String>> request =
new HttpEntity<>(body, headers);

var tokenRestUrl = azureAdTokenServiceProps.getTokenRestUrl();
var tokenRestUrl = azureAdTokenServiceProps.getUrl();

ResponseEntity<AzureTokenResponse> response =
restTemplate.postForEntity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void getAccessToken_shouldReturnToken_whenResponseIsSuccessful() {

ResponseEntity<AzureTokenResponse> 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);
Expand Down
Loading