Polish
This commit is contained in:
parent
ee45fd2fc8
commit
3d203d0215
|
|
@ -38,6 +38,7 @@ public class DeployedPlugin implements Plugin<Project> {
|
||||||
public static final String GENERATE_POM_TASK_NAME = "generatePomFileForMavenPublication";
|
public static final String GENERATE_POM_TASK_NAME = "generatePomFileForMavenPublication";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void apply(Project project) {
|
public void apply(Project project) {
|
||||||
project.getPlugins().apply(MavenPublishPlugin.class);
|
project.getPlugins().apply(MavenPublishPlugin.class);
|
||||||
project.getPlugins().apply(MavenRepositoryPlugin.class);
|
project.getPlugins().apply(MavenRepositoryPlugin.class);
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import java.util.Map;
|
||||||
|
|
||||||
import org.gradle.api.DefaultTask;
|
import org.gradle.api.DefaultTask;
|
||||||
import org.gradle.api.GradleException;
|
import org.gradle.api.GradleException;
|
||||||
|
import org.gradle.api.Task;
|
||||||
import org.gradle.api.file.DirectoryProperty;
|
import org.gradle.api.file.DirectoryProperty;
|
||||||
import org.gradle.api.tasks.Input;
|
import org.gradle.api.tasks.Input;
|
||||||
import org.gradle.api.tasks.OutputDirectory;
|
import org.gradle.api.tasks.OutputDirectory;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -84,6 +84,7 @@ public class UpgradeBom extends DefaultTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
void upgradeDependencies() {
|
void upgradeDependencies() {
|
||||||
GitHubRepository repository = createGitHub().getRepository(this.bom.getUpgrade().getGitHub().getOrganization(),
|
GitHubRepository repository = createGitHub().getRepository(this.bom.getUpgrade().getGitHub().getOrganization(),
|
||||||
this.bom.getUpgrade().getGitHub().getRepository());
|
this.bom.getUpgrade().getGitHub().getRepository());
|
||||||
|
|
|
||||||
|
|
@ -241,10 +241,6 @@ public class IncludeExcludeEndpointFilter<E extends ExposableEndpoint<?>> implem
|
||||||
return this.matchesAll || this.endpointIds.contains(endpointId);
|
return this.matchesAll || this.endpointIds.contains(endpointId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static EndpointPatterns forExposure(EndpointExposure exposure) {
|
|
||||||
return (exposure != null) ? new EndpointPatterns(exposure.getDefaultIncludes()) : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -62,6 +62,7 @@ class CompositeHandlerAdapter implements HandlerAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public long getLastModified(HttpServletRequest request, Object handler) {
|
public long getLastModified(HttpServletRequest request, Object handler) {
|
||||||
Optional<HandlerAdapter> adapter = getAdapter(handler);
|
Optional<HandlerAdapter> adapter = getAdapter(handler);
|
||||||
return adapter.map((handlerAdapter) -> handlerAdapter.getLastModified(request, handler)).orElse(0L);
|
return adapter.map((handlerAdapter) -> handlerAdapter.getLastModified(request, handler)).orElse(0L);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -125,7 +125,7 @@ class MvcWebEndpointIntegrationTests
|
||||||
private RequestMatchResult getMatchResult(String servletPath, boolean isPatternParser) {
|
private RequestMatchResult getMatchResult(String servletPath, boolean isPatternParser) {
|
||||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||||
request.setServletPath(servletPath);
|
request.setServletPath(servletPath);
|
||||||
AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext();
|
try (AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext()) {
|
||||||
if (isPatternParser) {
|
if (isPatternParser) {
|
||||||
context.register(WebMvcConfiguration.class);
|
context.register(WebMvcConfiguration.class);
|
||||||
}
|
}
|
||||||
|
|
@ -146,6 +146,7 @@ class MvcWebEndpointIntegrationTests
|
||||||
}
|
}
|
||||||
return bean.match(request, "/spring");
|
return bean.match(request, "/spring");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getPort(AnnotationConfigServletWebServerApplicationContext context) {
|
protected int getPort(AnnotationConfigServletWebServerApplicationContext context) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -17,10 +17,11 @@
|
||||||
package org.springframework.boot.autoconfigure.data.redis;
|
package org.springframework.boot.autoconfigure.data.redis;
|
||||||
|
|
||||||
import io.lettuce.core.resource.ClientResources;
|
import io.lettuce.core.resource.ClientResources;
|
||||||
|
import io.lettuce.core.resource.ClientResources.Builder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback interface that can be implemented by beans wishing to customize the
|
* Callback interface that can be implemented by beans wishing to customize the
|
||||||
* {@link ClientResources} via a {@link ClientResources.Builder} whilst retaining default
|
* {@link ClientResources} via a {@link Builder} whilst retaining default
|
||||||
* auto-configuration.
|
* auto-configuration.
|
||||||
*
|
*
|
||||||
* @author Stephane Nicoll
|
* @author Stephane Nicoll
|
||||||
|
|
@ -29,9 +30,9 @@ import io.lettuce.core.resource.ClientResources;
|
||||||
public interface ClientResourcesBuilderCustomizer {
|
public interface ClientResourcesBuilderCustomizer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customize the {@link ClientResources.Builder}.
|
* Customize the {@link Builder}.
|
||||||
* @param clientResourcesBuilder the builder to customize
|
* @param clientResourcesBuilder the builder to customize
|
||||||
*/
|
*/
|
||||||
void customize(ClientResources.Builder clientResourcesBuilder);
|
void customize(Builder clientResourcesBuilder);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2020 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
package org.springframework.boot.autoconfigure.elasticsearch;
|
package org.springframework.boot.autoconfigure.elasticsearch;
|
||||||
|
|
||||||
import org.apache.http.client.config.RequestConfig;
|
import org.apache.http.client.config.RequestConfig;
|
||||||
|
import org.apache.http.client.config.RequestConfig.Builder;
|
||||||
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
|
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
|
||||||
import org.elasticsearch.client.RestClientBuilder;
|
import org.elasticsearch.client.RestClientBuilder;
|
||||||
|
|
||||||
|
|
@ -52,11 +53,11 @@ public interface RestClientBuilderCustomizer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customize the {@link RequestConfig.Builder}.
|
* Customize the {@link Builder}.
|
||||||
* @param builder the builder
|
* @param builder the builder
|
||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
*/
|
*/
|
||||||
default void customize(RequestConfig.Builder builder) {
|
default void customize(Builder builder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -18,11 +18,12 @@ package org.springframework.boot.autoconfigure.mongo.embedded;
|
||||||
|
|
||||||
import de.flapdoodle.embed.process.config.store.DownloadConfig;
|
import de.flapdoodle.embed.process.config.store.DownloadConfig;
|
||||||
import de.flapdoodle.embed.process.config.store.ImmutableDownloadConfig;
|
import de.flapdoodle.embed.process.config.store.ImmutableDownloadConfig;
|
||||||
|
import de.flapdoodle.embed.process.config.store.ImmutableDownloadConfig.Builder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback interface that can be implemented by beans wishing to customize the
|
* Callback interface that can be implemented by beans wishing to customize the
|
||||||
* {@link DownloadConfig} via an {@link ImmutableDownloadConfig.Builder} whilst retaining
|
* {@link DownloadConfig} via a {@link Builder} whilst retaining default
|
||||||
* default auto-configuration.
|
* auto-configuration.
|
||||||
*
|
*
|
||||||
* @author Michael Gmeiner
|
* @author Michael Gmeiner
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
|
|
@ -31,9 +32,8 @@ import de.flapdoodle.embed.process.config.store.ImmutableDownloadConfig;
|
||||||
public interface DownloadConfigBuilderCustomizer {
|
public interface DownloadConfigBuilderCustomizer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customize the {@link ImmutableDownloadConfig.Builder}.
|
* Customize the {@link Builder}.
|
||||||
* @param downloadConfigBuilder the {@link ImmutableDownloadConfig.Builder} to
|
* @param downloadConfigBuilder the {@link Builder} to customize
|
||||||
* customize
|
|
||||||
*/
|
*/
|
||||||
void customize(ImmutableDownloadConfig.Builder downloadConfigBuilder);
|
void customize(ImmutableDownloadConfig.Builder downloadConfigBuilder);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -28,15 +28,15 @@ import org.springframework.boot.r2dbc.EmbeddedDatabaseConnection;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize a {@link ConnectionFactoryOptions.Builder} based on {@link R2dbcProperties}.
|
* Initialize a {@link Builder} based on {@link R2dbcProperties}.
|
||||||
*
|
*
|
||||||
* @author Stephane Nicoll
|
* @author Stephane Nicoll
|
||||||
*/
|
*/
|
||||||
class ConnectionFactoryOptionsInitializer {
|
class ConnectionFactoryOptionsInitializer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize a {@link io.r2dbc.spi.ConnectionFactoryOptions.Builder
|
* Initialize a {@link Builder ConnectionFactoryOptions.Builder} using the specified
|
||||||
* ConnectionFactoryOptions.Builder} using the specified properties.
|
* properties.
|
||||||
* @param properties the properties to use to initialize the builder
|
* @param properties the properties to use to initialize the builder
|
||||||
* @param embeddedDatabaseConnection the embedded connection to use as a fallback
|
* @param embeddedDatabaseConnection the embedded connection to use as a fallback
|
||||||
* @return an initialized builder
|
* @return an initialized builder
|
||||||
|
|
|
||||||
|
|
@ -432,6 +432,7 @@ class KafkaAutoConfigurationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
void logOnlyRecordMetadataProperty() {
|
void logOnlyRecordMetadataProperty() {
|
||||||
this.contextRunner.withPropertyValues("spring.kafka.listener.only-log-record-metadata=true").run((context) -> {
|
this.contextRunner.withPropertyValues("spring.kafka.listener.only-log-record-metadata=true").run((context) -> {
|
||||||
AbstractKafkaListenerContainerFactory<?, ?, ?> kafkaListenerContainerFactory = (AbstractKafkaListenerContainerFactory<?, ?, ?>) context
|
AbstractKafkaListenerContainerFactory<?, ?, ?> kafkaListenerContainerFactory = (AbstractKafkaListenerContainerFactory<?, ?, ?>) context
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -148,7 +148,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests {
|
||||||
.getBean(SupplierReactiveJwtDecoder.class);
|
.getBean(SupplierReactiveJwtDecoder.class);
|
||||||
Mono<ReactiveJwtDecoder> reactiveJwtDecoderSupplier = (Mono<ReactiveJwtDecoder>) ReflectionTestUtils
|
Mono<ReactiveJwtDecoder> reactiveJwtDecoderSupplier = (Mono<ReactiveJwtDecoder>) ReflectionTestUtils
|
||||||
.getField(supplierReactiveJwtDecoder, "jwtDecoderMono");
|
.getField(supplierReactiveJwtDecoder, "jwtDecoderMono");
|
||||||
ReactiveJwtDecoder reactiveJwtDecoder = reactiveJwtDecoderSupplier.block();
|
reactiveJwtDecoderSupplier.block();
|
||||||
});
|
});
|
||||||
// The last request is to the JWK Set endpoint to look up the algorithm
|
// The last request is to the JWK Set endpoint to look up the algorithm
|
||||||
assertThat(this.server.getRequestCount()).isEqualTo(1);
|
assertThat(this.server.getRequestCount()).isEqualTo(1);
|
||||||
|
|
@ -171,7 +171,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests {
|
||||||
.getBean(SupplierReactiveJwtDecoder.class);
|
.getBean(SupplierReactiveJwtDecoder.class);
|
||||||
Mono<ReactiveJwtDecoder> reactiveJwtDecoderSupplier = (Mono<ReactiveJwtDecoder>) ReflectionTestUtils
|
Mono<ReactiveJwtDecoder> reactiveJwtDecoderSupplier = (Mono<ReactiveJwtDecoder>) ReflectionTestUtils
|
||||||
.getField(supplierReactiveJwtDecoder, "jwtDecoderMono");
|
.getField(supplierReactiveJwtDecoder, "jwtDecoderMono");
|
||||||
ReactiveJwtDecoder reactiveJwtDecoder = reactiveJwtDecoderSupplier.block();
|
reactiveJwtDecoderSupplier.block();
|
||||||
});
|
});
|
||||||
// The last request is to the JWK Set endpoint to look up the algorithm
|
// The last request is to the JWK Set endpoint to look up the algorithm
|
||||||
assertThat(this.server.getRequestCount()).isEqualTo(2);
|
assertThat(this.server.getRequestCount()).isEqualTo(2);
|
||||||
|
|
@ -194,7 +194,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests {
|
||||||
.getBean(SupplierReactiveJwtDecoder.class);
|
.getBean(SupplierReactiveJwtDecoder.class);
|
||||||
Mono<ReactiveJwtDecoder> reactiveJwtDecoderSupplier = (Mono<ReactiveJwtDecoder>) ReflectionTestUtils
|
Mono<ReactiveJwtDecoder> reactiveJwtDecoderSupplier = (Mono<ReactiveJwtDecoder>) ReflectionTestUtils
|
||||||
.getField(supplierReactiveJwtDecoder, "jwtDecoderMono");
|
.getField(supplierReactiveJwtDecoder, "jwtDecoderMono");
|
||||||
ReactiveJwtDecoder reactiveJwtDecoder = reactiveJwtDecoderSupplier.block();
|
reactiveJwtDecoderSupplier.block();
|
||||||
});
|
});
|
||||||
// The last request is to the JWK Set endpoint to look up the algorithm
|
// The last request is to the JWK Set endpoint to look up the algorithm
|
||||||
assertThat(this.server.getRequestCount()).isEqualTo(3);
|
assertThat(this.server.getRequestCount()).isEqualTo(3);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -144,7 +144,7 @@ class OAuth2ResourceServerAutoConfigurationTests {
|
||||||
SupplierJwtDecoder supplierJwtDecoderBean = context.getBean(SupplierJwtDecoder.class);
|
SupplierJwtDecoder supplierJwtDecoderBean = context.getBean(SupplierJwtDecoder.class);
|
||||||
Supplier<JwtDecoder> jwtDecoderSupplier = (Supplier<JwtDecoder>) ReflectionTestUtils
|
Supplier<JwtDecoder> jwtDecoderSupplier = (Supplier<JwtDecoder>) ReflectionTestUtils
|
||||||
.getField(supplierJwtDecoderBean, "jwtDecoderSupplier");
|
.getField(supplierJwtDecoderBean, "jwtDecoderSupplier");
|
||||||
JwtDecoder jwtDecoder = jwtDecoderSupplier.get();
|
jwtDecoderSupplier.get();
|
||||||
});
|
});
|
||||||
// The last request is to the JWK Set endpoint to look up the algorithm
|
// The last request is to the JWK Set endpoint to look up the algorithm
|
||||||
assertThat(this.server.getRequestCount()).isEqualTo(2);
|
assertThat(this.server.getRequestCount()).isEqualTo(2);
|
||||||
|
|
@ -166,7 +166,7 @@ class OAuth2ResourceServerAutoConfigurationTests {
|
||||||
SupplierJwtDecoder supplierJwtDecoderBean = context.getBean(SupplierJwtDecoder.class);
|
SupplierJwtDecoder supplierJwtDecoderBean = context.getBean(SupplierJwtDecoder.class);
|
||||||
Supplier<JwtDecoder> jwtDecoderSupplier = (Supplier<JwtDecoder>) ReflectionTestUtils
|
Supplier<JwtDecoder> jwtDecoderSupplier = (Supplier<JwtDecoder>) ReflectionTestUtils
|
||||||
.getField(supplierJwtDecoderBean, "jwtDecoderSupplier");
|
.getField(supplierJwtDecoderBean, "jwtDecoderSupplier");
|
||||||
JwtDecoder jwtDecoder = jwtDecoderSupplier.get();
|
jwtDecoderSupplier.get();
|
||||||
});
|
});
|
||||||
// The last request is to the JWK Set endpoint to look up the algorithm
|
// The last request is to the JWK Set endpoint to look up the algorithm
|
||||||
assertThat(this.server.getRequestCount()).isEqualTo(3);
|
assertThat(this.server.getRequestCount()).isEqualTo(3);
|
||||||
|
|
@ -189,7 +189,7 @@ class OAuth2ResourceServerAutoConfigurationTests {
|
||||||
SupplierJwtDecoder supplierJwtDecoderBean = context.getBean(SupplierJwtDecoder.class);
|
SupplierJwtDecoder supplierJwtDecoderBean = context.getBean(SupplierJwtDecoder.class);
|
||||||
Supplier<JwtDecoder> jwtDecoderSupplier = (Supplier<JwtDecoder>) ReflectionTestUtils
|
Supplier<JwtDecoder> jwtDecoderSupplier = (Supplier<JwtDecoder>) ReflectionTestUtils
|
||||||
.getField(supplierJwtDecoderBean, "jwtDecoderSupplier");
|
.getField(supplierJwtDecoderBean, "jwtDecoderSupplier");
|
||||||
JwtDecoder jwtDecoder = jwtDecoderSupplier.get();
|
jwtDecoderSupplier.get();
|
||||||
});
|
});
|
||||||
// The last request is to the JWK Set endpoint to look up the algorithm
|
// The last request is to the JWK Set endpoint to look up the algorithm
|
||||||
assertThat(this.server.getRequestCount()).isEqualTo(4);
|
assertThat(this.server.getRequestCount()).isEqualTo(4);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -257,11 +257,13 @@ class Saml2RelyingPartyAutoConfigurationTests {
|
||||||
|
|
||||||
private void setupMockResponse(MockWebServer server, Resource resourceBody) throws Exception {
|
private void setupMockResponse(MockWebServer server, Resource resourceBody) throws Exception {
|
||||||
try (InputStream metadataSource = resourceBody.getInputStream()) {
|
try (InputStream metadataSource = resourceBody.getInputStream()) {
|
||||||
Buffer metadataBuffer = new Buffer().readFrom(metadataSource);
|
try (Buffer metadataBuffer = new Buffer()) {
|
||||||
|
metadataBuffer.readFrom(metadataSource);
|
||||||
MockResponse metadataResponse = new MockResponse().setBody(metadataBuffer);
|
MockResponse metadataResponse = new MockResponse().setBody(metadataBuffer);
|
||||||
server.enqueue(metadataResponse);
|
server.enqueue(metadataResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@Configuration(proxyBeanMethods = false)
|
||||||
static class RegistrationRepositoryConfiguration {
|
static class RegistrationRepositoryConfiguration {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -17,8 +17,6 @@
|
||||||
package org.springframework.boot.autoconfigure.web.reactive;
|
package org.springframework.boot.autoconfigure.web.reactive;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
|
@ -44,9 +42,6 @@ class ReactiveMultipartAutoConfigurationTests {
|
||||||
private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner()
|
private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner()
|
||||||
.withConfiguration(AutoConfigurations.of(ReactiveMultipartAutoConfiguration.class));
|
.withConfiguration(AutoConfigurations.of(ReactiveMultipartAutoConfiguration.class));
|
||||||
|
|
||||||
private static final Path DEFAULT_FILE_STORAGE_DIRECTORY = Paths.get(System.getProperty("java.io.tmpdir"),
|
|
||||||
"spring-multipart");
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void shouldNotProvideCustomizerForNonReactiveApp() {
|
void shouldNotProvideCustomizerForNonReactiveApp() {
|
||||||
new WebApplicationContextRunner()
|
new WebApplicationContextRunner()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -836,6 +836,7 @@ class WebMvcAutoConfigurationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
void useSuffixPatternMatch() {
|
void useSuffixPatternMatch() {
|
||||||
this.contextRunner.withPropertyValues("spring.mvc.pathmatch.matching-strategy=ant-path-matcher",
|
this.contextRunner.withPropertyValues("spring.mvc.pathmatch.matching-strategy=ant-path-matcher",
|
||||||
"spring.mvc.pathmatch.use-suffix-pattern:true",
|
"spring.mvc.pathmatch.use-suffix-pattern:true",
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import org.springframework.web.context.WebApplicationContext;
|
||||||
|
|
||||||
public class MyDemoBean implements ApplicationListener<ApplicationStartedEvent> {
|
public class MyDemoBean implements ApplicationListener<ApplicationStartedEvent> {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private ServletContext servletContext;
|
private ServletContext servletContext;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2020 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -28,12 +28,15 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||||
/**
|
/**
|
||||||
* Tests for {@link MockBean} with abstract class and generics.
|
* Tests for {@link MockBean} with abstract class and generics.
|
||||||
*
|
*
|
||||||
|
* @param <T> type of thing
|
||||||
|
* @param <U> type of something
|
||||||
* @author Madhura Bhave
|
* @author Madhura Bhave
|
||||||
*/
|
*/
|
||||||
@SpringBootTest(classes = AbstractMockBeanOnGenericTests.TestConfiguration.class)
|
@SpringBootTest(classes = AbstractMockBeanOnGenericTests.TestConfiguration.class)
|
||||||
abstract class AbstractMockBeanOnGenericTests<T extends AbstractMockBeanOnGenericTests.Thing<U>, U extends AbstractMockBeanOnGenericTests.Something> {
|
abstract class AbstractMockBeanOnGenericTests<T extends AbstractMockBeanOnGenericTests.Thing<U>, U extends AbstractMockBeanOnGenericTests.Something> {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private T thing;
|
private T thing;
|
||||||
|
|
||||||
@MockBean
|
@MockBean
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2020 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -59,7 +59,8 @@ public class InspectedContent implements Content {
|
||||||
FileCopyUtils.copy((byte[]) this.content, outputStream);
|
FileCopyUtils.copy((byte[]) this.content, outputStream);
|
||||||
}
|
}
|
||||||
else if (this.content instanceof File) {
|
else if (this.content instanceof File) {
|
||||||
FileCopyUtils.copy(new FileInputStream((File) this.content), outputStream);
|
InputStream inputStream = new FileInputStream((File) this.content);
|
||||||
|
FileCopyUtils.copy(inputStream, outputStream);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new IllegalStateException("Unknown content type");
|
throw new IllegalStateException("Unknown content type");
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -113,7 +113,7 @@ public class Repackager extends Packager {
|
||||||
public void repackage(File destination, Libraries libraries, LaunchScript launchScript, FileTime lastModifiedTime)
|
public void repackage(File destination, Libraries libraries, LaunchScript launchScript, FileTime lastModifiedTime)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Assert.isTrue(destination != null && !destination.isDirectory(), "Invalid destination");
|
Assert.isTrue(destination != null && !destination.isDirectory(), "Invalid destination");
|
||||||
Layout layout = getLayout(); // get layout early
|
getLayout(); // get layout early
|
||||||
destination = destination.getAbsoluteFile();
|
destination = destination.getAbsoluteFile();
|
||||||
File source = getSource();
|
File source = getSource();
|
||||||
if (isAlreadyPackaged() && source.equals(destination)) {
|
if (isAlreadyPackaged() && source.equals(destination)) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -149,12 +149,9 @@ public class ValidationBindHandler extends AbstractBindHandler {
|
||||||
|
|
||||||
private final ConfigurationPropertyName name;
|
private final ConfigurationPropertyName name;
|
||||||
|
|
||||||
private final Object target;
|
|
||||||
|
|
||||||
protected ValidationResult(ConfigurationPropertyName name, Object target) {
|
protected ValidationResult(ConfigurationPropertyName name, Object target) {
|
||||||
super(target, null);
|
super(target, null);
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.target = target;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -75,6 +75,7 @@ class ConfigDataTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
void getDeprecatedOptionsWhenUsingPropertySourceOptionsThrowsException() {
|
void getDeprecatedOptionsWhenUsingPropertySourceOptionsThrowsException() {
|
||||||
MapPropertySource source = new MapPropertySource("test", Collections.emptyMap());
|
MapPropertySource source = new MapPropertySource("test", Collections.emptyMap());
|
||||||
PropertySourceOptions propertySourceOptions = (propertySource) -> Options.NONE;
|
PropertySourceOptions propertySourceOptions = (propertySource) -> Options.NONE;
|
||||||
|
|
|
||||||
|
|
@ -477,7 +477,6 @@ class ConfigurationPropertiesTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
void loadWhenEnvironmentPrefixSetShouldBind() {
|
void loadWhenEnvironmentPrefixSetShouldBind() {
|
||||||
MutablePropertySources sources = this.context.getEnvironment().getPropertySources();
|
MutablePropertySources sources = this.context.getEnvironment().getPropertySources();
|
||||||
sources.replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,
|
sources.replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,
|
||||||
|
|
|
||||||
|
|
@ -439,6 +439,7 @@ class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
|
||||||
*/
|
*/
|
||||||
static class Nested {
|
static class Nested {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private static final Log logger = LogFactory.getLog(Nested.class);
|
private static final Log logger = LogFactory.getLog(Nested.class);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,8 @@ class PaketoBuilderTests {
|
||||||
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
||||||
BuildResult result = buildImage(imageName);
|
BuildResult result = buildImage(imageName);
|
||||||
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||||
try (GenericContainer<?> container = new GenericContainer<>(imageName).withExposedPorts(8080)) {
|
try (GenericContainer<?> container = new GenericContainer<>(imageName)) {
|
||||||
|
container.withExposedPorts(8080);
|
||||||
container.waitingFor(Wait.forHttp("/test")).start();
|
container.waitingFor(Wait.forHttp("/test")).start();
|
||||||
ContainerConfig config = container.getContainerInfo().getConfig();
|
ContainerConfig config = container.getContainerInfo().getConfig();
|
||||||
assertLabelsMatchManifestAttributes(config);
|
assertLabelsMatchManifestAttributes(config);
|
||||||
|
|
@ -106,8 +107,9 @@ class PaketoBuilderTests {
|
||||||
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
||||||
BuildResult result = buildImage(imageName);
|
BuildResult result = buildImage(imageName);
|
||||||
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||||
try (GenericContainer<?> container = new GenericContainer<>(imageName).withCommand("--server.port=9090")
|
try (GenericContainer<?> container = new GenericContainer<>(imageName)) {
|
||||||
.withExposedPorts(9090)) {
|
container.withCommand("--server.port=9090");
|
||||||
|
container.withExposedPorts(9090);
|
||||||
container.waitingFor(Wait.forHttp("/test")).start();
|
container.waitingFor(Wait.forHttp("/test")).start();
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|
@ -122,14 +124,16 @@ class PaketoBuilderTests {
|
||||||
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
||||||
BuildResult result = buildImage(imageName);
|
BuildResult result = buildImage(imageName);
|
||||||
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||||
try (GenericContainer<?> container = new GenericContainer<>(imageName).withExposedPorts(8080)) {
|
try (GenericContainer<?> container = new GenericContainer<>(imageName)) {
|
||||||
|
container.withExposedPorts(8080);
|
||||||
container.waitingFor(Wait.forHttp("/test")).start();
|
container.waitingFor(Wait.forHttp("/test")).start();
|
||||||
container.stop();
|
container.stop();
|
||||||
}
|
}
|
||||||
this.gradleBuild.expectDeprecationMessages("BOM table is deprecated");
|
this.gradleBuild.expectDeprecationMessages("BOM table is deprecated");
|
||||||
result = buildImage(imageName);
|
result = buildImage(imageName);
|
||||||
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||||
try (GenericContainer<?> container = new GenericContainer<>(imageName).withExposedPorts(8080)) {
|
try (GenericContainer<?> container = new GenericContainer<>(imageName)) {
|
||||||
|
container.withExposedPorts(8080);
|
||||||
container.waitingFor(Wait.forHttp("/test")).start();
|
container.waitingFor(Wait.forHttp("/test")).start();
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|
@ -145,7 +149,8 @@ class PaketoBuilderTests {
|
||||||
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
||||||
BuildResult result = buildImage(imageName, "assemble", "bootDistZip");
|
BuildResult result = buildImage(imageName, "assemble", "bootDistZip");
|
||||||
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||||
try (GenericContainer<?> container = new GenericContainer<>(imageName).withExposedPorts(8080)) {
|
try (GenericContainer<?> container = new GenericContainer<>(imageName)) {
|
||||||
|
container.withExposedPorts(8080);
|
||||||
container.waitingFor(Wait.forHttp("/test")).start();
|
container.waitingFor(Wait.forHttp("/test")).start();
|
||||||
ContainerConfig config = container.getContainerInfo().getConfig();
|
ContainerConfig config = container.getContainerInfo().getConfig();
|
||||||
ImageAssertions.assertThat(config).buildMetadata().buildpacks().contains(
|
ImageAssertions.assertThat(config).buildMetadata().buildpacks().contains(
|
||||||
|
|
@ -173,7 +178,8 @@ class PaketoBuilderTests {
|
||||||
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
||||||
BuildResult result = buildImage(imageName, "assemble", "bootDistZip");
|
BuildResult result = buildImage(imageName, "assemble", "bootDistZip");
|
||||||
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||||
try (GenericContainer<?> container = new GenericContainer<>(imageName).withExposedPorts(8080)) {
|
try (GenericContainer<?> container = new GenericContainer<>(imageName)) {
|
||||||
|
container.withExposedPorts(8080);
|
||||||
container.waitingFor(Wait.forHttp("/test")).start();
|
container.waitingFor(Wait.forHttp("/test")).start();
|
||||||
ContainerConfig config = container.getContainerInfo().getConfig();
|
ContainerConfig config = container.getContainerInfo().getConfig();
|
||||||
ImageAssertions.assertThat(config).buildMetadata().buildpacks().contains(
|
ImageAssertions.assertThat(config).buildMetadata().buildpacks().contains(
|
||||||
|
|
@ -204,7 +210,8 @@ class PaketoBuilderTests {
|
||||||
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
||||||
BuildResult result = buildImage(imageName);
|
BuildResult result = buildImage(imageName);
|
||||||
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||||
try (GenericContainer<?> container = new GenericContainer<>(imageName).withExposedPorts(8080)) {
|
try (GenericContainer<?> container = new GenericContainer<>(imageName)) {
|
||||||
|
container.withExposedPorts(8080);
|
||||||
container.waitingFor(Wait.forHttp("/test")).start();
|
container.waitingFor(Wait.forHttp("/test")).start();
|
||||||
ContainerConfig config = container.getContainerInfo().getConfig();
|
ContainerConfig config = container.getContainerInfo().getConfig();
|
||||||
assertLabelsMatchManifestAttributes(config);
|
assertLabelsMatchManifestAttributes(config);
|
||||||
|
|
@ -231,7 +238,8 @@ class PaketoBuilderTests {
|
||||||
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
ImageReference imageReference = ImageReference.of(ImageName.of(imageName));
|
||||||
BuildResult result = buildImage(imageName);
|
BuildResult result = buildImage(imageName);
|
||||||
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||||
try (GenericContainer<?> container = new GenericContainer<>(imageName).withExposedPorts(8080)) {
|
try (GenericContainer<?> container = new GenericContainer<>(imageName)) {
|
||||||
|
container.withExposedPorts(8080);
|
||||||
container.waitingFor(Wait.forHttp("/test")).start();
|
container.waitingFor(Wait.forHttp("/test")).start();
|
||||||
ContainerConfig config = container.getContainerInfo().getConfig();
|
ContainerConfig config = container.getContainerInfo().getConfig();
|
||||||
ImageAssertions.assertThat(config).buildMetadata().buildpacks().contains(
|
ImageAssertions.assertThat(config).buildMetadata().buildpacks().contains(
|
||||||
|
|
@ -352,20 +360,6 @@ class PaketoBuilderTests {
|
||||||
return new File(this.gradleBuild.getProjectDir(), "build/libs").listFiles()[0];
|
return new File(this.gradleBuild.getProjectDir(), "build/libs").listFiles()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
private String javaMajorVersion() {
|
|
||||||
String javaVersion = System.getProperty("java.version");
|
|
||||||
if (javaVersion.startsWith("1.")) {
|
|
||||||
return javaVersion.substring(2, 3);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
int firstDotIndex = javaVersion.indexOf(".");
|
|
||||||
if (firstDotIndex != -1) {
|
|
||||||
return javaVersion.substring(0, firstDotIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return javaVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean startsWithOneOf(String actual, List<String> expectedPrefixes) {
|
private boolean startsWithOneOf(String actual, List<String> expectedPrefixes) {
|
||||||
for (String prefix : expectedPrefixes) {
|
for (String prefix : expectedPrefixes) {
|
||||||
if (actual.startsWith(prefix)) {
|
if (actual.startsWith(prefix)) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2020 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -38,9 +38,6 @@ class SampleHazelcast4ApplicationTests {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CacheManager cacheManager;
|
private CacheManager cacheManager;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private CountryRepository countryRepository;
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void cacheManagerIsUsingHazelcast() {
|
void cacheManagerIsUsingHazelcast() {
|
||||||
assertThat(this.cacheManager).isInstanceOf(HazelcastCacheManager.class);
|
assertThat(this.cacheManager).isInstanceOf(HazelcastCacheManager.class);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -26,6 +26,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||||
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
@ -81,12 +82,13 @@ class SampleSessionHazelcastApplicationTests {
|
||||||
return "Basic " + Base64.getEncoder().encodeToString("user:password".getBytes());
|
return "Basic " + Base64.getEncoder().encodeToString("user:password".getBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private ResponseEntity<Map<String, Object>> getSessions() {
|
private ResponseEntity<Map<String, Object>> getSessions() {
|
||||||
HttpHeaders headers = getHeaders(null);
|
HttpHeaders headers = getHeaders(null);
|
||||||
RequestEntity<Object> request = new RequestEntity<>(headers, HttpMethod.GET,
|
RequestEntity<Object> request = new RequestEntity<>(headers, HttpMethod.GET,
|
||||||
URI.create("/actuator/sessions?username=user"));
|
URI.create("/actuator/sessions?username=user"));
|
||||||
return (ResponseEntity<Map<String, Object>>) (ResponseEntity) this.restTemplate.exchange(request, Map.class);
|
ParameterizedTypeReference<Map<String, Object>> stringObjectMap = new ParameterizedTypeReference<Map<String, Object>>() {
|
||||||
|
};
|
||||||
|
return this.restTemplate.exchange(request, stringObjectMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -26,6 +26,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||||
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
@ -94,12 +95,13 @@ class SampleSessionJdbcApplicationTests {
|
||||||
return "Basic " + Base64.getEncoder().encodeToString("user:password".getBytes());
|
return "Basic " + Base64.getEncoder().encodeToString("user:password".getBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private ResponseEntity<Map<String, Object>> getSessions() {
|
private ResponseEntity<Map<String, Object>> getSessions() {
|
||||||
HttpHeaders headers = getHeaders(null);
|
HttpHeaders headers = getHeaders(null);
|
||||||
RequestEntity<Object> request = new RequestEntity<>(headers, HttpMethod.GET,
|
RequestEntity<Object> request = new RequestEntity<>(headers, HttpMethod.GET,
|
||||||
URI.create("/actuator/sessions?username=user"));
|
URI.create("/actuator/sessions?username=user"));
|
||||||
return (ResponseEntity<Map<String, Object>>) (ResponseEntity) this.restTemplate.exchange(request, Map.class);
|
ParameterizedTypeReference<Map<String, Object>> stringObjectMap = new ParameterizedTypeReference<Map<String, Object>>() {
|
||||||
|
};
|
||||||
|
return this.restTemplate.exchange(request, stringObjectMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||||
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
@ -83,10 +84,11 @@ public class SampleSessionMongoApplicationTests {
|
||||||
return new RequestEntity<>(headers, HttpMethod.GET, uri);
|
return new RequestEntity<>(headers, HttpMethod.GET, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private ResponseEntity<Map<String, Object>> getSessions() {
|
private ResponseEntity<Map<String, Object>> getSessions() {
|
||||||
RequestEntity<Object> request = getRequestEntity(URI.create("/actuator/sessions?username=user"));
|
RequestEntity<Object> request = getRequestEntity(URI.create("/actuator/sessions?username=user"));
|
||||||
return (ResponseEntity<Map<String, Object>>) (ResponseEntity) this.restTemplate.exchange(request, Map.class);
|
ParameterizedTypeReference<Map<String, Object>> stringObjectMap = new ParameterizedTypeReference<Map<String, Object>>() {
|
||||||
|
};
|
||||||
|
return this.restTemplate.exchange(request, stringObjectMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -28,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||||
import org.springframework.boot.testsupport.testcontainers.RedisContainer;
|
import org.springframework.boot.testsupport.testcontainers.RedisContainer;
|
||||||
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
@ -81,10 +82,11 @@ public class SampleSessionRedisApplicationTests {
|
||||||
return new RequestEntity<>(headers, HttpMethod.GET, uri);
|
return new RequestEntity<>(headers, HttpMethod.GET, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private ResponseEntity<Map<String, Object>> getSessions() {
|
private ResponseEntity<Map<String, Object>> getSessions() {
|
||||||
RequestEntity<Object> request = getRequestEntity(URI.create("/actuator/sessions?username=user"));
|
RequestEntity<Object> request = getRequestEntity(URI.create("/actuator/sessions?username=user"));
|
||||||
return (ResponseEntity<Map<String, Object>>) (ResponseEntity) this.restTemplate.exchange(request, Map.class);
|
ParameterizedTypeReference<Map<String, Object>> stringObjectMap = new ParameterizedTypeReference<Map<String, Object>>() {
|
||||||
|
};
|
||||||
|
return this.restTemplate.exchange(request, stringObjectMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,4 @@
|
||||||
<url-pattern>/</url-pattern>
|
<url-pattern>/</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- Disables Servlet Container welcome file handling. Needed for compatibility
|
|
||||||
with Servlet 3.0 and Tomcat 7.0 -->
|
|
||||||
<welcome-file-list>
|
|
||||||
<welcome-file></welcome-file>
|
|
||||||
</welcome-file-list>
|
|
||||||
|
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue