Polish
This commit is contained in:
@@ -107,8 +107,8 @@ public class OAuth2RestOperationsConfiguration {
|
||||
|
||||
private final AccessTokenRequest accessTokenRequest;
|
||||
|
||||
public ClientContextConfiguration(@Qualifier("accessTokenRequest")
|
||||
ObjectProvider<AccessTokenRequest> accessTokenRequest) {
|
||||
public ClientContextConfiguration(
|
||||
@Qualifier("accessTokenRequest") ObjectProvider<AccessTokenRequest> accessTokenRequest) {
|
||||
this.accessTokenRequest = accessTokenRequest.getIfAvailable();
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public class ResourceProperties implements ResourceLoaderAware {
|
||||
String[] normalized = new String[staticLocations.length];
|
||||
for (int i = 0; i < staticLocations.length; i++) {
|
||||
String location = staticLocations[i];
|
||||
normalized[i] = location.endsWith("/") ? location : location + "/";
|
||||
normalized[i] = (location.endsWith("/") ? location : location + "/");
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,8 @@ public class Neo4jPropertiesTests {
|
||||
Neo4jProperties properties = load(true,
|
||||
"spring.data.neo4j.uri=https://localhost:7474");
|
||||
Configuration configuration = properties.createConfiguration();
|
||||
assertDriver(configuration, Neo4jProperties.HTTP_DRIVER, "https://localhost:7474");
|
||||
assertDriver(configuration, Neo4jProperties.HTTP_DRIVER,
|
||||
"https://localhost:7474");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -47,13 +47,18 @@ public class OAuth2RestOperationsConfigurationTests {
|
||||
public void clientIdConditionMatches() throws Exception {
|
||||
EnvironmentTestUtils.addEnvironment(this.environment,
|
||||
"security.oauth2.client.client-id=acme");
|
||||
this.context = new SpringApplicationBuilder(OAuth2RestOperationsConfiguration.class).environment(this.environment).web(false).run();
|
||||
assertThat(this.context.getBean(OAuth2RestOperationsConfiguration.class)).isNotNull();
|
||||
this.context = new SpringApplicationBuilder(
|
||||
OAuth2RestOperationsConfiguration.class).environment(this.environment)
|
||||
.web(false).run();
|
||||
assertThat(this.context.getBean(OAuth2RestOperationsConfiguration.class))
|
||||
.isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clientIdConditionDoesNotMatch() throws Exception {
|
||||
this.context = new SpringApplicationBuilder(OAuth2RestOperationsConfiguration.class).environment(this.environment).web(false).run();
|
||||
this.context = new SpringApplicationBuilder(
|
||||
OAuth2RestOperationsConfiguration.class).environment(this.environment)
|
||||
.web(false).run();
|
||||
this.thrown.expect(NoSuchBeanDefinitionException.class);
|
||||
this.context.getBean(OAuth2RestOperationsConfiguration.class);
|
||||
}
|
||||
|
||||
@@ -63,9 +63,8 @@ public class ResourcePropertiesTests {
|
||||
@Test
|
||||
public void customStaticLocationsAreNormalizedToEndWithTrailingSlash() {
|
||||
this.properties.setStaticLocations(new String[] { "/foo", "/bar", "/baz/" });
|
||||
assertThat(this.properties.getStaticLocations()).containsExactly("/foo/", "/bar/",
|
||||
"/baz/");
|
||||
|
||||
String[] actual = this.properties.getStaticLocations();
|
||||
assertThat(actual).containsExactly("/foo/", "/bar/", "/baz/");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user