Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Piszmog committed Oct 24, 2024
1 parent a5d81cd commit c03e5a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<!--Dependency Management-->
<spring-cloud-services-dependencies.version>3.5.0</spring-cloud-services-dependencies.version>
<spring-cloud-services-dependencies.version>4.1.5</spring-cloud-services-dependencies.version>
<spring-boot-dependencies.version>3.3.4</spring-boot-dependencies.version>
<pitest-junit5-plugin.version>1.1.2</pitest-junit5-plugin.version>
<!-- Sonar -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void testInit_header() {
template.init();
assertThat(template).extracting("restTemplate")
.extracting("interceptors")
.asList()
.asInstanceOf(InstanceOfAssertFactories.LIST)
.hasSize(1)
.first()
.isInstanceOf(ConfigServicePropertySourceLocator.GenericRequestHeaderInterceptor.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.pivotal.spring.cloud.config.client.ConfigClientOAuth2Properties;
import io.pivotal.spring.cloud.config.client.OAuth2AuthorizedClientHttpRequestInterceptor;
import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.jupiter.api.Test;
import org.springframework.cloud.config.client.ConfigClientProperties;
import org.springframework.core.env.StandardEnvironment;
Expand All @@ -22,11 +23,15 @@ public void testInit() {
template.init();
assertThat(template).extracting("restTemplate")
.extracting("interceptors")
.asList()
.asInstanceOf(InstanceOfAssertFactories.LIST)
.hasSize(1)
.first()
.isInstanceOf(OAuth2AuthorizedClientHttpRequestInterceptor.class)
.extracting("clientRegistration")
.extracting("authorizedManager")
.extracting("authorizedClientService")
.extracting("clientRegistrationRepository")
.extracting("registrations")
.extracting("cloud-config-client")
.hasFieldOrPropertyWithValue("registrationId", "cloud-config-client")
.hasFieldOrPropertyWithValue("clientId", "clientId")
.hasFieldOrPropertyWithValue("clientSecret", "secret")
Expand Down

0 comments on commit c03e5a2

Please sign in to comment.