Merge pull request #21009 from dreis2211

* pr/21009:
  Update copyright year of changed file
  Polish

Closes gh-21009
This commit is contained in:
Stephane Nicoll 2020-04-25 08:56:57 +02:00
commit 3907fb9e02
35 changed files with 71 additions and 71 deletions

View File

@ -58,7 +58,7 @@ public class OptionalDependenciesPlugin implements Plugin<Project> {
.all((javadoc) -> javadoc.setClasspath(javadoc.getClasspath().plus(optional))); .all((javadoc) -> javadoc.setClasspath(javadoc.getClasspath().plus(optional)));
}); });
project.getPlugins().withType(EclipsePlugin.class, project.getPlugins().withType(EclipsePlugin.class,
(eclipePlugin) -> project.getExtensions().getByType(EclipseModel.class) (eclipsePlugin) -> project.getExtensions().getByType(EclipseModel.class)
.classpath((classpath) -> classpath.getPlusConfigurations().add(optional))); .classpath((classpath) -> classpath.getPlusConfigurations().add(optional)));
} }

View File

@ -38,7 +38,7 @@ public class DependencyVersionTests {
} }
@Test @Test
void parseWhenMavenLikeVersionWithNumericQualifieShouldReturnNumericQualifierDependencyVersion() { void parseWhenMavenLikeVersionWithNumericQualifierShouldReturnNumericQualifierDependencyVersion() {
assertThat(DependencyVersion.parse("1.2.3.4")).isInstanceOf(NumericQualifierDependencyVersion.class); assertThat(DependencyVersion.parse("1.2.3.4")).isInstanceOf(NumericQualifierDependencyVersion.class);
} }

View File

@ -64,7 +64,7 @@ class AvailabilityProbesAutoConfigurationTests {
} }
@Test @Test
void probesWhenKuberntesAndPropertyDisabledAddsNotBeans() { void probesWhenKubernetesAndPropertyDisabledAddsNotBeans() {
this.contextRunner this.contextRunner
.withPropertyValues("spring.main.cloud-platform=kubernetes", "management.health.probes.enabled=false") .withPropertyValues("spring.main.cloud-platform=kubernetes", "management.health.probes.enabled=false")
.run((context) -> assertThat(context).hasSingleBean(ApplicationAvailability.class) .run((context) -> assertThat(context).hasSingleBean(ApplicationAvailability.class)

View File

@ -56,7 +56,7 @@ class AvailabilityProbesHealthEndpointGroupTests {
} }
@Test @Test
void getStatusAggregattorReturnsDefaultStatusAggregator() { void getStatusAggregatorReturnsDefaultStatusAggregator() {
assertThat(this.group.getStatusAggregator()).isEqualTo(StatusAggregator.DEFAULT); assertThat(this.group.getStatusAggregator()).isEqualTo(StatusAggregator.DEFAULT);
} }

View File

@ -96,7 +96,7 @@ class AvailabilityProbesHealthEndpointGroupsTests {
} }
@Test @Test
void getRedinessProbeHasOnlyReadinessStateAsMember() { void getReadinessProbeHasOnlyReadinessStateAsMember() {
HealthEndpointGroups availabilityProbes = new AvailabilityProbesHealthEndpointGroups(this.delegate); HealthEndpointGroups availabilityProbes = new AvailabilityProbesHealthEndpointGroups(this.delegate);
HealthEndpointGroup probeGroup = availabilityProbes.get("readiness"); HealthEndpointGroup probeGroup = availabilityProbes.get("readiness");
assertThat(probeGroup.isMember("livenessState")).isFalse(); assertThat(probeGroup.isMember("livenessState")).isFalse();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 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.
@ -76,7 +76,7 @@ class CloudFoundrySecurityServiceTests {
} }
@Test @Test
void doNotskipSslValidationWhenFalse() { void doNotSkipSslValidationWhenFalse() {
RestTemplateBuilder builder = new RestTemplateBuilder(); RestTemplateBuilder builder = new RestTemplateBuilder();
this.securityService = new CloudFoundrySecurityService(builder, CLOUD_CONTROLLER, false); this.securityService = new CloudFoundrySecurityService(builder, CLOUD_CONTROLLER, false);
RestTemplate restTemplate = (RestTemplate) ReflectionTestUtils.getField(this.securityService, "restTemplate"); RestTemplate restTemplate = (RestTemplate) ReflectionTestUtils.getField(this.securityService, "restTemplate");

View File

@ -103,7 +103,7 @@ class AutoConfiguredHealthEndpointGroupsTests {
} }
@Test @Test
void createWhenHasStatusAggregatorBeanReturnsInstanceWithAgregatorUsedForAllGroups() { void createWhenHasStatusAggregatorBeanReturnsInstanceWithAggregatorUsedForAllGroups() {
this.contextRunner.withUserConfiguration(CustomStatusAggregatorConfiguration.class) this.contextRunner.withUserConfiguration(CustomStatusAggregatorConfiguration.class)
.withPropertyValues("management.endpoint.health.status.order=up,down", .withPropertyValues("management.endpoint.health.status.order=up,down",
"management.endpoint.health.group.a.include=*") "management.endpoint.health.group.a.include=*")

View File

@ -61,12 +61,12 @@ public class HealthIndicatorRegistryInjectionIntegrationTests {
MeterRegistry registry) { MeterRegistry registry) {
CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(healthAggregator, CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(healthAggregator,
healthIndicatorRegistry); healthIndicatorRegistry);
Gauge.builder("health", healthIndicator, this::getGuageValue) Gauge.builder("health", healthIndicator, this::getGaugeValue)
.description("Spring boot health indicator. 3=UP, 2=OUT_OF_SERVICE, 1=DOWN, 0=UNKNOWN") .description("Spring boot health indicator. 3=UP, 2=OUT_OF_SERVICE, 1=DOWN, 0=UNKNOWN")
.strongReference(true).register(registry); .strongReference(true).register(registry);
} }
private double getGuageValue(CompositeHealthIndicator health) { private double getGaugeValue(CompositeHealthIndicator health) {
Status status = health.health().getStatus(); Status status = health.health().getStatus();
switch (status.getCode()) { switch (status.getCode()) {
case "UP": case "UP":

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 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.
@ -90,7 +90,7 @@ abstract class DefaultContributorRegistryTests {
} }
@Test @Test
void registerContributorRegisteresContributors() { void registerContributorRegistersContributors() {
this.registry.registerContributor("one", this.one); this.registry.registerContributor("one", this.one);
this.registry.registerContributor("two", this.two); this.registry.registerContributor("two", this.two);
assertThat(this.registry).hasSize(2); assertThat(this.registry).hasSize(2);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 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.
@ -396,7 +396,7 @@ class HibernateJpaAutoConfigurationTests extends AbstractJpaAutoConfigurationTes
} }
@Test @Test
void whenLocalContanerEntityManagerFactoryBeanHasNoJpaVendorAdapterAutoConfigurationSucceeds() { void whenLocalContainerEntityManagerFactoryBeanHasNoJpaVendorAdapterAutoConfigurationSucceeds() {
contextRunner() contextRunner()
.withUserConfiguration( .withUserConfiguration(
TestConfigurationWithLocalContainerEntityManagerFactoryBeanWithNoJpaVendorAdapter.class) TestConfigurationWithLocalContainerEntityManagerFactoryBeanWithNoJpaVendorAdapter.class)

View File

@ -468,7 +468,7 @@ class TomcatWebServerFactoryCustomizerTests {
} }
@Test @Test
void accessLogwithIpv6CanonicalSet() { void accessLogWithIpv6CanonicalSet() {
bind("server.tomcat.accesslog.enabled=true", "server.tomcat.accesslog.ipv6-canonical=true"); bind("server.tomcat.accesslog.enabled=true", "server.tomcat.accesslog.ipv6-canonical=true");
TomcatServletWebServerFactory factory = customizeAndGetFactory(); TomcatServletWebServerFactory factory = customizeAndGetFactory();
assertThat(((AccessLogValve) factory.getEngineValves().iterator().next()).getIpv6Canonical()).isTrue(); assertThat(((AccessLogValve) factory.getEngineValves().iterator().next()).getIpv6Canonical()).isTrue();

View File

@ -50,7 +50,7 @@ class AetherGrapeEngineTests {
private final RepositoryConfiguration springMilestone = new RepositoryConfiguration("spring-milestone", private final RepositoryConfiguration springMilestone = new RepositoryConfiguration("spring-milestone",
URI.create("https://repo.spring.io/milestone"), false); URI.create("https://repo.spring.io/milestone"), false);
private final RepositoryConfiguration springSnaphot = new RepositoryConfiguration("spring-snapshot", private final RepositoryConfiguration springSnapshot = new RepositoryConfiguration("spring-snapshot",
URI.create("https://repo.spring.io/snapshot"), true); URI.create("https://repo.spring.io/snapshot"), true);
private AetherGrapeEngine createGrapeEngine(RepositoryConfiguration... additionalRepositories) { private AetherGrapeEngine createGrapeEngine(RepositoryConfiguration... additionalRepositories) {
@ -67,7 +67,7 @@ class AetherGrapeEngineTests {
@Test @Test
void dependencyResolution() { void dependencyResolution() {
Map<String, Object> args = new HashMap<>(); Map<String, Object> args = new HashMap<>();
createGrapeEngine(this.springMilestone, this.springSnaphot).grab(args, createGrapeEngine(this.springMilestone, this.springSnapshot).grab(args,
createDependency("org.springframework", "spring-jdbc", null)); createDependency("org.springframework", "spring-jdbc", null));
assertThat(this.groovyClassLoader.getURLs()).hasSize(5); assertThat(this.groovyClassLoader.getURLs()).hasSize(5);
} }
@ -107,7 +107,7 @@ class AetherGrapeEngineTests {
Map<String, Object> args = new HashMap<>(); Map<String, Object> args = new HashMap<>();
args.put("excludes", Arrays.asList(createExclusion("org.springframework", "spring-core"))); args.put("excludes", Arrays.asList(createExclusion("org.springframework", "spring-core")));
createGrapeEngine(this.springMilestone, this.springSnaphot).grab(args, createGrapeEngine(this.springMilestone, this.springSnapshot).grab(args,
createDependency("org.springframework", "spring-jdbc", "3.2.4.RELEASE"), createDependency("org.springframework", "spring-jdbc", "3.2.4.RELEASE"),
createDependency("org.springframework", "spring-beans", "3.2.4.RELEASE")); createDependency("org.springframework", "spring-beans", "3.2.4.RELEASE"));
@ -129,7 +129,7 @@ class AetherGrapeEngineTests {
GroovyClassLoader customClassLoader = new GroovyClassLoader(); GroovyClassLoader customClassLoader = new GroovyClassLoader();
args.put("classLoader", customClassLoader); args.put("classLoader", customClassLoader);
createGrapeEngine(this.springMilestone, this.springSnaphot).grab(args, createGrapeEngine(this.springMilestone, this.springSnapshot).grab(args,
createDependency("org.springframework", "spring-jdbc", null)); createDependency("org.springframework", "spring-jdbc", null));
assertThat(this.groovyClassLoader.getURLs()).isEmpty(); assertThat(this.groovyClassLoader.getURLs()).isEmpty();

View File

@ -93,7 +93,7 @@ Spring Boot Loader-compatible jar and war archives can include additional index
A `classpath.idx` file can be provided for both jars and wars, it provides the ordering that jars should be added to the classpath. A `classpath.idx` file can be provided for both jars and wars, it provides the ordering that jars should be added to the classpath.
The `layers.idx` file can be used only for jars, it allows a jar to be split into logical layers for Docker/OCI image creation. The `layers.idx` file can be used only for jars, it allows a jar to be split into logical layers for Docker/OCI image creation.
Index files follow a YAML compatible syntax so that they can be eaily parsed by third-party tools. Index files follow a YAML compatible syntax so that they can be easily parsed by third-party tools.
These files, however, are _not_ parsed internally as YAML and they must be written in exactly the formats described below in order to be used. These files, however, are _not_ parsed internally as YAML and they must be written in exactly the formats described below in order to be used.

View File

@ -93,7 +93,7 @@ If a misconfigured bean is initialized lazily, a failure will no longer occur du
Care must also be taken to ensure that the JVM has sufficient memory to accommodate all of the application's beans and not just those that are initialized during startup. Care must also be taken to ensure that the JVM has sufficient memory to accommodate all of the application's beans and not just those that are initialized during startup.
For these reasons, lazy initialization is not enabled by default and it is recommended that fine-tuning of the JVM's heap size is done before enabling lazy initialization. For these reasons, lazy initialization is not enabled by default and it is recommended that fine-tuning of the JVM's heap size is done before enabling lazy initialization.
Lazy initialization can be enabled programatically using the `lazyInitialization` method on `SpringApplicationBuilder` or the `setLazyInitialization` method on `SpringApplication`. Lazy initialization can be enabled programmatically using the `lazyInitialization` method on `SpringApplicationBuilder` or the `setLazyInitialization` method on `SpringApplication`.
Alternatively, it can be enabled using the configprop:spring.main.lazy-initialization[] property as shown in the following example: Alternatively, it can be enabled using the configprop:spring.main.lazy-initialization[] property as shown in the following example:
[source,properties,indent=0,configprops] [source,properties,indent=0,configprops]

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 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.
@ -69,7 +69,7 @@ class OutputCaptureTests {
} }
@Test @Test
void pushWhenHasExistingStartesNewCapture() { void pushWhenHasExistingStartsNewCapture() {
System.out.print("A"); System.out.print("A");
this.output.push(); this.output.push();
System.out.print("B"); System.out.print("B");

View File

@ -102,7 +102,7 @@ class LifecycleTests {
} }
@Test @Test
void executeWhenAleadyRunThrowsException() throws Exception { void executeWhenAlreadyRunThrowsException() throws Exception {
given(this.docker.container().create(any())).willAnswer(answerWithGeneratedContainerId()); given(this.docker.container().create(any())).willAnswer(answerWithGeneratedContainerId());
given(this.docker.container().create(any(), any())).willAnswer(answerWithGeneratedContainerId()); given(this.docker.container().create(any(), any())).willAnswer(answerWithGeneratedContainerId());
given(this.docker.container().wait(any())).willReturn(ContainerStatus.of(0, null)); given(this.docker.container().wait(any())).willReturn(ContainerStatus.of(0, null));
@ -211,9 +211,9 @@ class LifecycleTests {
static class TestLifecycle extends Lifecycle { static class TestLifecycle extends Lifecycle {
TestLifecycle(BuildLog log, DockerApi docker, BuildRequest request, ImageReference runImageReferece, TestLifecycle(BuildLog log, DockerApi docker, BuildRequest request, ImageReference runImageReference,
EphemeralBuilder builder) { EphemeralBuilder builder) {
super(log, docker, request, runImageReferece, builder); super(log, docker, request, runImageReference, builder);
} }
@Override @Override

View File

@ -190,7 +190,7 @@ class DockerApiTests {
} }
@Test @Test
void removeWhenReferenceIsNulllThrowsException() { void removeWhenReferenceIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.api.remove(null, true)) assertThatIllegalArgumentException().isThrownBy(() -> this.api.remove(null, true))
.withMessage("Reference must not be null"); .withMessage("Reference must not be null");
} }

View File

@ -36,7 +36,7 @@ abstract class ProgressUpdateEventTests {
} }
@Test @Test
void getProgressDetailsReturnsProgresssDetails() { void getProgressDetailsReturnsProgressDetails() {
ProgressUpdateEvent event = createEvent(); ProgressUpdateEvent event = createEvent();
assertThat(event.getProgressDetail().getCurrent()).isEqualTo(1); assertThat(event.getProgressDetail().getCurrent()).isEqualTo(1);
assertThat(event.getProgressDetail().getTotal()).isEqualTo(2); assertThat(event.getProgressDetail().getTotal()).isEqualTo(2);

View File

@ -177,7 +177,7 @@ class HttpClientTransportTests {
} }
@Test @Test
void executeWhenResposeIsIn400RangeShouldThrowDockerException() throws IOException { void executeWhenResponseIsIn400RangeShouldThrowDockerException() throws IOException {
given(this.entity.getContent()).willReturn(getClass().getResourceAsStream("errors.json")); given(this.entity.getContent()).willReturn(getClass().getResourceAsStream("errors.json"));
given(this.statusLine.getStatusCode()).willReturn(404); given(this.statusLine.getStatusCode()).willReturn(404);
assertThatExceptionOfType(DockerEngineException.class).isThrownBy(() -> this.http.get(this.uri)) assertThatExceptionOfType(DockerEngineException.class).isThrownBy(() -> this.http.get(this.uri))
@ -185,7 +185,7 @@ class HttpClientTransportTests {
} }
@Test @Test
void executeWhenResposeIsIn500RangeShouldThrowDockerException() { void executeWhenResponseIsIn500RangeShouldThrowDockerException() {
given(this.statusLine.getStatusCode()).willReturn(500); given(this.statusLine.getStatusCode()).willReturn(500);
assertThatExceptionOfType(DockerEngineException.class).isThrownBy(() -> this.http.get(this.uri)) assertThatExceptionOfType(DockerEngineException.class).isThrownBy(() -> this.http.get(this.uri))
.satisfies((ex) -> assertThat(ex.getErrors()).isNull()); .satisfies((ex) -> assertThat(ex.getErrors()).isNull());

View File

@ -45,8 +45,8 @@ class ImageConfigTests extends AbstractJsonTests {
@Test @Test
void getLabelsReturnsLabels() throws Exception { void getLabelsReturnsLabels() throws Exception {
ImageConfig imageConfig = getImageConfig(); ImageConfig imageConfig = getImageConfig();
Map<String, String> lables = imageConfig.getLabels(); Map<String, String> labels = imageConfig.getLabels();
assertThat(lables).hasSize(4).contains(entry("io.buildpacks.stack.id", "org.cloudfoundry.stacks.cflinuxfs3")); assertThat(labels).hasSize(4).contains(entry("io.buildpacks.stack.id", "org.cloudfoundry.stacks.cflinuxfs3"));
} }
@Test @Test

View File

@ -46,8 +46,8 @@ class ImageTests extends AbstractJsonTests {
@Test @Test
void getConfigLabelsReturnsLabels() throws Exception { void getConfigLabelsReturnsLabels() throws Exception {
Image image = getImage(); Image image = getImage();
Map<String, String> lables = image.getConfig().getLabels(); Map<String, String> labels = image.getConfig().getLabels();
assertThat(lables).contains(entry("io.buildpacks.stack.id", "org.cloudfoundry.stacks.cflinuxfs3")); assertThat(labels).contains(entry("io.buildpacks.stack.id", "org.cloudfoundry.stacks.cflinuxfs3"));
} }
@Test @Test

View File

@ -129,7 +129,7 @@ class BootJarTests extends AbstractBootArchiveTests<TestBootJar> {
} }
@Test @Test
void whenJarIsLayeredWithCustomStrategiesThenLayersIndexIsPresentAndCorrent() throws IOException { void whenJarIsLayeredWithCustomStrategiesThenLayersIndexIsPresentAndCorrect() throws IOException {
File jar = createLayeredJar((layered) -> { File jar = createLayeredJar((layered) -> {
layered.application((application) -> { layered.application((application) -> {
application.intoLayer("resources", (spec) -> spec.include("static/**")); application.intoLayer("resources", (spec) -> spec.include("static/**"));

View File

@ -68,7 +68,7 @@ class LayerToolsJarModeTests {
} }
@Test @Test
void mainWithNoParamersShowsHelp() { void mainWithNoParametersShowsHelp() {
new LayerToolsJarMode().run("layertools", NO_ARGS); new LayerToolsJarMode().run("layertools", NO_ARGS);
assertThat(this.out).hasSameContentAsResource("help-output.txt"); assertThat(this.out).hasSameContentAsResource("help-output.txt");
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 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.
@ -167,8 +167,8 @@ class CentralDirectoryEndRecord {
private int numberOfRecords; private int numberOfRecords;
private Zip64End(RandomAccessData data, int centratDirectoryEndOffset) throws IOException { private Zip64End(RandomAccessData data, int centralDirectoryEndOffset) throws IOException {
this(data, new Zip64Locator(data, centratDirectoryEndOffset)); this(data, new Zip64Locator(data, centralDirectoryEndOffset));
} }
private Zip64End(RandomAccessData data, Zip64Locator locator) throws IOException { private Zip64End(RandomAccessData data, Zip64Locator locator) throws IOException {

View File

@ -238,7 +238,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests {
} }
@TestTemplate @TestTemplate
void whenADependendencyHasTestScopeItIsNotIncludedInTheRepackagedJar(MavenBuild mavenBuild) { void whenADependencyHasTestScopeItIsNotIncludedInTheRepackagedJar(MavenBuild mavenBuild) {
mavenBuild.project("jar-test-scope").execute((project) -> { mavenBuild.project("jar-test-scope").execute((project) -> {
File main = new File(project, "target/jar-test-scope-0.0.1.BUILD-SNAPSHOT.jar"); File main = new File(project, "target/jar-test-scope-0.0.1.BUILD-SNAPSHOT.jar");
assertThat(jar(main)).doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/log4j") assertThat(jar(main)).doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/log4j")

View File

@ -41,21 +41,21 @@ class ImageTests {
@Test @Test
void getBuildRequestWhenNameIsNullDeducesName() { void getBuildRequestWhenNameIsNullDeducesName() {
BuildRequest request = new Image().getBuildRequest(createArtifact(), mockAplicationContent()); BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1-SNAPSHOT"); assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1-SNAPSHOT");
} }
@Test @Test
void getBuildEquestWhenNameIsSetUsesName() { void getBuildRequestWhenNameIsSetUsesName() {
Image image = new Image(); Image image = new Image();
image.name = "demo"; image.name = "demo";
BuildRequest request = image.getBuildRequest(createArtifact(), mockAplicationContent()); BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getName().toString()).isEqualTo("docker.io/library/demo:latest"); assertThat(request.getName().toString()).isEqualTo("docker.io/library/demo:latest");
} }
@Test @Test
void getBuildRequestWhenNoCustomizationsUsesDefaults() { void getBuildRequestWhenNoCustomizationsUsesDefaults() {
BuildRequest request = new Image().getBuildRequest(createArtifact(), mockAplicationContent()); BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1-SNAPSHOT"); assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1-SNAPSHOT");
assertThat(request.getBuilder().toString()).contains("docker.io/cloudfoundry/cnb:bionic-platform-api"); assertThat(request.getBuilder().toString()).contains("docker.io/cloudfoundry/cnb:bionic-platform-api");
assertThat(request.getEnv()).isEmpty(); assertThat(request.getEnv()).isEmpty();
@ -67,7 +67,7 @@ class ImageTests {
void getBuildRequestWhenHasBuilderUsesBuilder() { void getBuildRequestWhenHasBuilderUsesBuilder() {
Image image = new Image(); Image image = new Image();
image.builder = "springboot/builder:2.2.x"; image.builder = "springboot/builder:2.2.x";
BuildRequest request = image.getBuildRequest(createArtifact(), mockAplicationContent()); BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getBuilder().toString()).isEqualTo("docker.io/springboot/builder:2.2.x"); assertThat(request.getBuilder().toString()).isEqualTo("docker.io/springboot/builder:2.2.x");
} }
@ -75,7 +75,7 @@ class ImageTests {
void getBuildRequestWhenHasEnvUsesEnv() { void getBuildRequestWhenHasEnvUsesEnv() {
Image image = new Image(); Image image = new Image();
image.env = Collections.singletonMap("test", "test"); image.env = Collections.singletonMap("test", "test");
BuildRequest request = image.getBuildRequest(createArtifact(), mockAplicationContent()); BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getEnv()).containsExactly(entry("test", "test")); assertThat(request.getEnv()).containsExactly(entry("test", "test"));
} }
@ -83,7 +83,7 @@ class ImageTests {
void getBuildRequestWhenHasCleanCacheUsesCleanCache() { void getBuildRequestWhenHasCleanCacheUsesCleanCache() {
Image image = new Image(); Image image = new Image();
image.cleanCache = true; image.cleanCache = true;
BuildRequest request = image.getBuildRequest(createArtifact(), mockAplicationContent()); BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.isCleanCache()).isTrue(); assertThat(request.isCleanCache()).isTrue();
} }
@ -91,7 +91,7 @@ class ImageTests {
void getBuildRequestWhenHasVerboseLoggingUsesVerboseLogging() { void getBuildRequestWhenHasVerboseLoggingUsesVerboseLogging() {
Image image = new Image(); Image image = new Image();
image.verboseLogging = true; image.verboseLogging = true;
BuildRequest request = image.getBuildRequest(createArtifact(), mockAplicationContent()); BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.isVerboseLogging()).isTrue(); assertThat(request.isVerboseLogging()).isTrue();
} }
@ -100,7 +100,7 @@ class ImageTests {
"jar", null, new DefaultArtifactHandler()); "jar", null, new DefaultArtifactHandler());
} }
private Function<Owner, TarArchive> mockAplicationContent() { private Function<Owner, TarArchive> mockApplicationContent() {
return (owner) -> null; return (owner) -> null;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 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.
@ -40,7 +40,7 @@ class Ansi8BitColorTests {
} }
@Test @Test
void forgroundWhenOutsideBoundsThrowsException() { void foregroundWhenOutsideBoundsThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> Ansi8BitColor.foreground(-1)) assertThatIllegalArgumentException().isThrownBy(() -> Ansi8BitColor.foreground(-1))
.withMessage("Code must be between 0 and 255"); .withMessage("Code must be between 0 and 255");
assertThatIllegalArgumentException().isThrownBy(() -> Ansi8BitColor.foreground(256)) assertThatIllegalArgumentException().isThrownBy(() -> Ansi8BitColor.foreground(256))

View File

@ -57,7 +57,7 @@ class EventPublishingRunListenerTests {
} }
@Test @Test
void shouldPublishLifecyleEvents() { void shouldPublishLifecycleEvents() {
StaticApplicationContext context = new StaticApplicationContext(); StaticApplicationContext context = new StaticApplicationContext();
assertThat(this.eventListener.receivedEvents()).isEmpty(); assertThat(this.eventListener.receivedEvents()).isEmpty();
this.runListener.starting(); this.runListener.starting();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 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.
@ -44,7 +44,7 @@ class ConfigurationPropertiesScanRegistrarTests {
new MockEnvironment(), null); new MockEnvironment(), null);
@Test @Test
void registerBeanDefintionsShouldScanForConfigurationProperties() throws IOException { void registerBeanDefinitionsShouldScanForConfigurationProperties() throws IOException {
this.registrar.registerBeanDefinitions(getAnnotationMetadata(ConfigurationPropertiesScanConfiguration.class), this.registrar.registerBeanDefinitions(getAnnotationMetadata(ConfigurationPropertiesScanConfiguration.class),
this.beanFactory); this.beanFactory);
BeanDefinition bingDefinition = this.beanFactory.getBeanDefinition( BeanDefinition bingDefinition = this.beanFactory.getBeanDefinition(
@ -70,7 +70,7 @@ class ConfigurationPropertiesScanRegistrarTests {
} }
@Test @Test
void scanWhenBasePackagesAndBasePackcageClassesProvidedShouldUseThat() throws IOException { void scanWhenBasePackagesAndBasePackageClassesProvidedShouldUseThat() throws IOException {
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
beanFactory.setAllowBeanDefinitionOverriding(false); beanFactory.setAllowBeanDefinitionOverriding(false);
this.registrar.registerBeanDefinitions( this.registrar.registerBeanDefinitions(

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 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,8 +84,8 @@ class ConversionServiceDeducerTests {
@Bean @Bean
@ConfigurationPropertiesBinding @ConfigurationPropertiesBinding
TestConveter testConveter() { TestConverter testConverter() {
return new TestConveter(); return new TestConverter();
} }
} }
@ -94,7 +94,7 @@ class ConversionServiceDeducerTests {
} }
private static class TestConveter implements Converter<InputStream, OutputStream> { private static class TestConverter implements Converter<InputStream, OutputStream> {
@Override @Override
public OutputStream convert(InputStream source) { public OutputStream convert(InputStream source) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 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,7 +75,7 @@ class ApplicationContextRequestMatcherTests {
} }
@Test // gh-18012 @Test // gh-18012
void machesWhenCalledWithDifferentApplicationContextDoesNotCache() { void matchesWhenCalledWithDifferentApplicationContextDoesNotCache() {
StaticWebApplicationContext context1 = createWebApplicationContext(); StaticWebApplicationContext context1 = createWebApplicationContext();
StaticWebApplicationContext context2 = createWebApplicationContext(); StaticWebApplicationContext context2 = createWebApplicationContext();
TestApplicationContextRequestMatcher<ApplicationContext> matcher = new TestApplicationContextRequestMatcher<>( TestApplicationContextRequestMatcher<ApplicationContext> matcher = new TestApplicationContextRequestMatcher<>(

View File

@ -117,7 +117,7 @@ class JettyServletWebServerFactoryTests extends AbstractJettyServletWebServerFac
} }
@Test @Test
void sessionTimeoutInMins() { void sessionTimeoutInMinutes() {
JettyServletWebServerFactory factory = getFactory(); JettyServletWebServerFactory factory = getFactory();
factory.getSession().setTimeout(Duration.ofMinutes(1)); factory.getSession().setTimeout(Duration.ofMinutes(1));
assertTimeout(factory, 60); assertTimeout(factory, 60);

View File

@ -247,7 +247,7 @@ class TomcatServletWebServerFactoryTests extends AbstractServletWebServerFactory
} }
@Test @Test
void sessionTimeoutInMins() { void sessionTimeoutInMinutes() {
TomcatServletWebServerFactory factory = getFactory(); TomcatServletWebServerFactory factory = getFactory();
factory.getSession().setTimeout(Duration.ofMinutes(1)); factory.getSession().setTimeout(Duration.ofMinutes(1));
assertTimeout(factory, 1); assertTimeout(factory, 1);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 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.
@ -29,11 +29,11 @@ import static org.assertj.core.api.Assertions.assertThat;
class CompressionTests { class CompressionTests {
@Test @Test
void defaultCompressableMimeTypesMatchesTomcatsDefault() { void defaultCompressibleMimeTypesMatchesTomcatsDefault() {
assertThat(new Compression().getMimeTypes()).containsExactlyInAnyOrder(getTomcatDefaultCompressableMimeTypes()); assertThat(new Compression().getMimeTypes()).containsExactlyInAnyOrder(getTomcatDefaultCompressibleMimeTypes());
} }
private String[] getTomcatDefaultCompressableMimeTypes() { private String[] getTomcatDefaultCompressibleMimeTypes() {
Http11NioProtocol protocol = new Http11NioProtocol(); Http11NioProtocol protocol = new Http11NioProtocol();
return protocol.getCompressibleMimeTypes(); return protocol.getCompressibleMimeTypes();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 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.
@ -50,8 +50,8 @@ class WebServletHandlerTests {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Test @Test
void defaultServletConfiguration() throws IOException { void defaultServletConfiguration() throws IOException {
AnnotatedBeanDefinition servletdefinition = createBeanDefinition(DefaultConfigurationServlet.class); AnnotatedBeanDefinition servletDefinition = createBeanDefinition(DefaultConfigurationServlet.class);
this.handler.handle(servletdefinition, this.registry); this.handler.handle(servletDefinition, this.registry);
BeanDefinition servletRegistrationBean = this.registry BeanDefinition servletRegistrationBean = this.registry
.getBeanDefinition(DefaultConfigurationServlet.class.getName()); .getBeanDefinition(DefaultConfigurationServlet.class.getName());
MutablePropertyValues propertyValues = servletRegistrationBean.getPropertyValues(); MutablePropertyValues propertyValues = servletRegistrationBean.getPropertyValues();
@ -60,7 +60,7 @@ class WebServletHandlerTests {
assertThat((Integer) propertyValues.get("loadOnStartup")).isEqualTo(-1); assertThat((Integer) propertyValues.get("loadOnStartup")).isEqualTo(-1);
assertThat(propertyValues.get("name")).isEqualTo(DefaultConfigurationServlet.class.getName()); assertThat(propertyValues.get("name")).isEqualTo(DefaultConfigurationServlet.class.getName());
assertThat((String[]) propertyValues.get("urlMappings")).isEmpty(); assertThat((String[]) propertyValues.get("urlMappings")).isEmpty();
assertThat(propertyValues.get("servlet")).isEqualTo(servletdefinition); assertThat(propertyValues.get("servlet")).isEqualTo(servletDefinition);
} }
@Test @Test