Commit 3d0219c3 authored by Madhura Bhave's avatar Madhura Bhave

Merge branch '2.1.x'

parents 1893eeef 28175c86
...@@ -45,9 +45,9 @@ public enum ManagementPortType { ...@@ -45,9 +45,9 @@ public enum ManagementPortType {
* Look at the given environment to determine if the {@link ManagementPortType} is * Look at the given environment to determine if the {@link ManagementPortType} is
* {@link #DISABLED}, {@link #SAME} or {@link #DIFFERENT}. * {@link #DISABLED}, {@link #SAME} or {@link #DIFFERENT}.
* @param environment the Spring environment * @param environment the Spring environment
* @return {@link #DISABLED} if `management.server.port` is set to a negative value, * @return {@link #DISABLED} if {@code management.server.port} is set to a negative
* {@link #SAME} if `management.server.port` is not specified or equal to * value, {@link #SAME} if {@code management.server.port} is not specified or equal to
* `server.port`and {@link #DIFFERENT} otherwise. * {@code server.port} and {@link #DIFFERENT} otherwise.
* @since 2.1.4 * @since 2.1.4
*/ */
public static ManagementPortType get(Environment environment) { public static ManagementPortType get(Environment environment) {
......
...@@ -1180,7 +1180,7 @@ shown in the following example: ...@@ -1180,7 +1180,7 @@ shown in the following example:
} }
---- ----
JAXB is only available out of the box with Java 8. If you're using a more recent java JAXB is only available out of the box with Java 8. If you're using a more recent Java
generation, add the following dependency to your project: generation, add the following dependency to your project:
[source,xml,indent=0,subs="verbatim,quotes,attributes"] [source,xml,indent=0,subs="verbatim,quotes,attributes"]
......
...@@ -4,8 +4,8 @@ import static org.junit.Assert.assertTrue ...@@ -4,8 +4,8 @@ import static org.junit.Assert.assertTrue
import static org.junit.Assert.assertFalse import static org.junit.Assert.assertFalse
File repackaged = new File(basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar") File repackaged = new File(basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar")
File main = new File( basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar") File main = new File(basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar")
File backup = new File( basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar.original") File backup = new File(basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar.original")
new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify(); new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify();
assertTrue 'main artifact should exist', main.exists() assertTrue 'main artifact should exist', main.exists()
...@@ -22,6 +22,3 @@ assertFalse 'repackaged artifact should not have been installed', ...@@ -22,6 +22,3 @@ assertFalse 'repackaged artifact should not have been installed',
file.text.contains ("Installing " + repackaged + " to") file.text.contains ("Installing " + repackaged + " to")
assertFalse 'backup artifact should not have been installed', assertFalse 'backup artifact should not have been installed',
file.text.contains ("Installing " + backup + "to") file.text.contains ("Installing " + backup + "to")
...@@ -4,8 +4,8 @@ import static org.junit.Assert.assertTrue ...@@ -4,8 +4,8 @@ import static org.junit.Assert.assertTrue
import static org.junit.Assert.assertFalse import static org.junit.Assert.assertFalse
File repackaged = new File(basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT-test.jar") File repackaged = new File(basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT-test.jar")
File main = new File( basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar") File main = new File(basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar")
File backup = new File( basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar.original") File backup = new File(basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar.original")
new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify(); new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify();
assertTrue 'main artifact should exist', main.exists() assertTrue 'main artifact should exist', main.exists()
......
...@@ -3,8 +3,8 @@ import org.springframework.boot.maven.* ...@@ -3,8 +3,8 @@ import org.springframework.boot.maven.*
import static org.junit.Assert.assertTrue import static org.junit.Assert.assertTrue
import static org.junit.Assert.assertFalse import static org.junit.Assert.assertFalse
File main = new File(basedir, "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar"); File main = new File(basedir, "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar")
File backup = new File( basedir, "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar.original") File backup = new File(basedir, "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar.original")
new Verify.JarArchiveVerification(main, Verify.SAMPLE_APP).verify(); new Verify.JarArchiveVerification(main, Verify.SAMPLE_APP).verify();
assertTrue 'backup artifact should exist', backup.exists() assertTrue 'backup artifact should exist', backup.exists()
...@@ -18,4 +18,3 @@ assertTrue 'backup artifact should have been installed', ...@@ -18,4 +18,3 @@ assertTrue 'backup artifact should have been installed',
file.text.contains ("Installing " + backup + " to") file.text.contains ("Installing " + backup + " to")
assertFalse 'repackaged artifact should not have been installed', assertFalse 'repackaged artifact should not have been installed',
file.text.contains ("Installing " + main + " to") file.text.contains ("Installing " + main + " to")
...@@ -3,8 +3,8 @@ import org.springframework.boot.maven.* ...@@ -3,8 +3,8 @@ import org.springframework.boot.maven.*
import static org.junit.Assert.assertFalse import static org.junit.Assert.assertFalse
import static org.junit.Assert.assertTrue import static org.junit.Assert.assertTrue
File repackaged = new File(basedir, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar"); File repackaged = new File(basedir, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar")
File backup = new File( basedir, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar.original") File backup = new File(basedir, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar.original")
new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify(); new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify();
assertTrue 'backup artifact should exist', backup.exists() assertTrue 'backup artifact should exist', backup.exists()
...@@ -14,4 +14,3 @@ assertTrue 'repackaged artifact should have been replaced', ...@@ -14,4 +14,3 @@ assertTrue 'repackaged artifact should have been replaced',
file.text.contains("Replacing artifact with classifier test with repackaged archive") file.text.contains("Replacing artifact with classifier test with repackaged archive")
assertFalse 'backup artifact should not have been installed', file.text.contains ("Installing "+backup) assertFalse 'backup artifact should not have been installed', file.text.contains ("Installing "+backup)
assertTrue 'repackaged artifact should have been installed', file.text.contains ("Installing "+repackaged) assertTrue 'repackaged artifact should have been installed', file.text.contains ("Installing "+repackaged)
...@@ -2,6 +2,5 @@ import java.io.*; ...@@ -2,6 +2,5 @@ import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
Verify.verifyJar( Verify.verifyJar(
new File( basedir, "target/foo/jar-create-dir-0.0.1.BUILD-SNAPSHOT-foo.jar" ), "some.random.Main" new File(basedir, "target/foo/jar-create-dir-0.0.1.BUILD-SNAPSHOT-foo.jar"), "some.random.Main"
); )
...@@ -2,13 +2,9 @@ import java.io.*; ...@@ -2,13 +2,9 @@ import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
Verify.verifyJar( Verify.verifyJar(
new File( basedir, "target/foo/jar-custom-dir-0.0.1.BUILD-SNAPSHOT.jar" ), "some.random.Main" new File(basedir, "target/foo/jar-custom-dir-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main"
); )
Verify.verifyJar( Verify.verifyJar(
new File( localRepositoryPath, "org/springframework/boot/maven/it/jar-custom-dir/0.0.1.BUILD-SNAPSHOT/jar-custom-dir-0.0.1.BUILD-SNAPSHOT.jar" ), "some.random.Main" new File(localRepositoryPath, "org/springframework/boot/maven/it/jar-custom-dir/0.0.1.BUILD-SNAPSHOT/jar-custom-dir-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main"
); )
...@@ -2,6 +2,5 @@ import java.io.*; ...@@ -2,6 +2,5 @@ import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
Verify.verifyJar( Verify.verifyJar(
new File( basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar" ), "some.random.Main", "Hello world" new File(basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main", "Hello world"
); )
import java.io.*; import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
File f = new File( basedir, "target/jar-exclude-artifact-0.0.1.BUILD-SNAPSHOT.jar"); File f = new File(basedir, "target/jar-exclude-artifact-0.0.1.BUILD-SNAPSHOT.jar")
new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) {
@Override @Override
protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception {
super.verifyZipEntries(verifier) super.verifyZipEntries(verifier)
verifier.assertHasNoEntryNameStartingWith("lib/servlet-api-2.5.jar") verifier.assertHasNoEntryNameStartingWith("lib/servlet-api-2.5.jar")
} }
}.verify(); }.verify()
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
import java.io.*; import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
File f = new File( basedir, "target/jar-exclude-entry-0.0.1.BUILD-SNAPSHOT.jar"); File f = new File(basedir, "target/jar-exclude-entry-0.0.1.BUILD-SNAPSHOT.jar")
new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) {
@Override @Override
protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception {
super.verifyZipEntries(verifier) super.verifyZipEntries(verifier)
verifier.assertHasNoEntryNameStartingWith("lib/servlet-api-2.5.jar") verifier.assertHasNoEntryNameStartingWith("lib/servlet-api-2.5.jar")
} }
}.verify(); }.verify()
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
import java.io.*; import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
File f = new File( basedir, "target/jar-exclude-group-0.0.1.BUILD-SNAPSHOT.jar"); File f = new File(basedir, "target/jar-exclude-group-0.0.1.BUILD-SNAPSHOT.jar")
new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) {
@Override @Override
protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception {
super.verifyZipEntries(verifier) super.verifyZipEntries(verifier)
verifier.assertHasNoEntryNameStartingWith("lib/log4j-api-2.4.1.jar") verifier.assertHasNoEntryNameStartingWith("lib/log4j-api-2.4.1.jar")
} }
}.verify(); }.verify()
...@@ -2,7 +2,6 @@ import java.io.*; ...@@ -2,7 +2,6 @@ import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
Verify.verifyJar( Verify.verifyJar(
new File( basedir, "target/jar-executable-0.0.1.BUILD-SNAPSHOT.jar" ), new File(basedir, "target/jar-executable-0.0.1.BUILD-SNAPSHOT.jar"),
"some.random.Main", "Spring Boot Startup Script", "MyFullyExecutableJarName", "some.random.Main", "Spring Boot Startup Script", "MyFullyExecutableJarName",
"MyFullyExecutableJarDesc"); "MyFullyExecutableJarDesc")
...@@ -2,6 +2,5 @@ import java.io.*; ...@@ -2,6 +2,5 @@ import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
Verify.verifyJar( Verify.verifyJar(
new File( basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar" ), "some.random.Main", false new File(basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main", false
); )
import static org.junit.Assert.assertTrue import static org.junit.Assert.assertTrue
import static org.junit.Assert.assertFalse import static org.junit.Assert.assertFalse
File f = new File( basedir, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar") File f = new File(basedir, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar")
assertTrue 'output file should have been generated', f.exists() assertTrue 'output file should have been generated', f.exists()
File shouldNotExist = new File( basedir, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar.original") File shouldNotExist = new File(basedir, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar.original")
assertFalse 'repackage goal should not have run. .original should not exist', shouldNotExist.exists() assertFalse 'repackage goal should not have run. .original should not exist', shouldNotExist.exists()
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
import java.io.*; import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
File f = new File( basedir, "target/jar-system-scope-default-0.0.1.BUILD-SNAPSHOT.jar"); File f = new File(basedir, "target/jar-system-scope-default-0.0.1.BUILD-SNAPSHOT.jar")
new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) {
@Override @Override
protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception {
super.verifyZipEntries(verifier) super.verifyZipEntries(verifier)
verifier.assertHasNoEntryNameStartingWith("BOOT-INF/lib/sample-1.0.0.jar") verifier.assertHasNoEntryNameStartingWith("BOOT-INF/lib/sample-1.0.0.jar")
} }
}.verify(); }.verify()
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
import java.io.*; import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
File f = new File( basedir, "target/jar-system-scope-0.0.1.BUILD-SNAPSHOT.jar"); File f = new File(basedir, "target/jar-system-scope-0.0.1.BUILD-SNAPSHOT.jar")
new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) {
@Override @Override
protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception {
super.verifyZipEntries(verifier) super.verifyZipEntries(verifier)
verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/sample-1.0.0.jar") verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/sample-1.0.0.jar")
} }
}.verify(); }.verify()
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
import java.io.*; import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
File f = new File( basedir, "target/jar-test-scope-0.0.1.BUILD-SNAPSHOT.jar"); File f = new File(basedir, "target/jar-test-scope-0.0.1.BUILD-SNAPSHOT.jar")
new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) {
@Override @Override
protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception {
super.verifyZipEntries(verifier) super.verifyZipEntries(verifier)
verifier.assertHasNoEntryNameStartingWith("lib/log4j-api-2.4.1.jar") verifier.assertHasNoEntryNameStartingWith("lib/log4j-api-2.4.1.jar")
} }
}.verify(); }.verify()
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import java.io.*; import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
File f = new File( basedir, "target/jar-with-kotlin-module-0.0.1.BUILD-SNAPSHOT.jar"); File f = new File(basedir, "target/jar-with-kotlin-module-0.0.1.BUILD-SNAPSHOT.jar")
new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) {
@Override @Override
protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception {
...@@ -27,4 +27,4 @@ new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { ...@@ -27,4 +27,4 @@ new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) {
verifier.assertHasNonUnpackEntry("BOOT-INF/lib/kotlin-stdlib-") verifier.assertHasNonUnpackEntry("BOOT-INF/lib/kotlin-stdlib-")
verifier.assertHasNonUnpackEntry("BOOT-INF/lib/kotlin-reflect-") verifier.assertHasNonUnpackEntry("BOOT-INF/lib/kotlin-reflect-")
} }
}.verify(); }.verify()
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import java.io.*; import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
File f = new File( basedir, "target/jar-with-unpack-0.0.1.BUILD-SNAPSHOT.jar"); File f = new File(basedir, "target/jar-with-unpack-0.0.1.BUILD-SNAPSHOT.jar")
new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) {
@Override @Override
protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception {
...@@ -25,4 +25,4 @@ new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { ...@@ -25,4 +25,4 @@ new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) {
verifier.assertHasUnpackEntry("BOOT-INF/lib/spring-core-") verifier.assertHasUnpackEntry("BOOT-INF/lib/spring-core-")
verifier.assertHasNonUnpackEntry("BOOT-INF/lib/spring-context-") verifier.assertHasNonUnpackEntry("BOOT-INF/lib/spring-context-")
} }
}.verify(); }.verify()
...@@ -2,6 +2,5 @@ import java.io.*; ...@@ -2,6 +2,5 @@ import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
Verify.verifyZip( Verify.verifyZip(
new File( basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar" ) new File(basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar")
); )
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import java.io.*; import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
File f = new File( basedir, "war/target/war-0.0.1.BUILD-SNAPSHOT.war") File f = new File(basedir, "war/target/war-0.0.1.BUILD-SNAPSHOT.war")
new Verify.WarArchiveVerification(f) { new Verify.WarArchiveVerification(f) {
@Override @Override
protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import java.io.*; import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
File f = new File( basedir, "target/war-0.0.1.BUILD-SNAPSHOT.war") File f = new File(basedir, "target/war-0.0.1.BUILD-SNAPSHOT.war")
new Verify.WarArchiveVerification(f) { new Verify.WarArchiveVerification(f) {
@Override @Override
protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception {
......
...@@ -2,6 +2,6 @@ import java.io.*; ...@@ -2,6 +2,6 @@ import java.io.*;
import org.springframework.boot.maven.*; import org.springframework.boot.maven.*;
Verify.verifyWar( Verify.verifyWar(
new File( basedir, "target/war-0.0.1.BUILD-SNAPSHOT.war" ) new File(basedir, "target/war-0.0.1.BUILD-SNAPSHOT.war")
); )
...@@ -27,7 +27,6 @@ import java.util.concurrent.atomic.AtomicReference; ...@@ -27,7 +27,6 @@ import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import org.assertj.core.api.Assertions;
import org.assertj.core.api.Condition; import org.assertj.core.api.Condition;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
...@@ -1080,7 +1079,7 @@ public class SpringApplicationTests { ...@@ -1080,7 +1079,7 @@ public class SpringApplicationTests {
ExampleConfig.class); ExampleConfig.class);
application.addListeners( application.addListeners(
(ApplicationListener<ApplicationEnvironmentPreparedEvent>) (event) -> { (ApplicationListener<ApplicationEnvironmentPreparedEvent>) (event) -> {
Assertions.assertThat(event.getEnvironment()) assertThat(event.getEnvironment())
.isInstanceOf(StandardServletEnvironment.class); .isInstanceOf(StandardServletEnvironment.class);
TestPropertySourceUtils.addInlinedPropertiesToEnvironment( TestPropertySourceUtils.addInlinedPropertiesToEnvironment(
event.getEnvironment(), "foo=bar"); event.getEnvironment(), "foo=bar");
......
...@@ -43,10 +43,10 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -43,10 +43,10 @@ import static org.assertj.core.api.Assertions.assertThat;
public class ManagementPortAndPathSampleActuatorApplicationTests { public class ManagementPortAndPathSampleActuatorApplicationTests {
@LocalServerPort @LocalServerPort
private int port = 9010; private int port;
@LocalManagementPort @LocalManagementPort
private int managementPort = 9011; private int managementPort;
@Test @Test
public void testHome() { public void testHome() {
......
/* /*
* Copyright 2012-2018 the original author or authors. * Copyright 2012-2019 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.
...@@ -20,7 +20,6 @@ import java.util.Base64; ...@@ -20,7 +20,6 @@ import java.util.Base64;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.assertj.core.api.Assertions;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
...@@ -32,6 +31,7 @@ import org.springframework.boot.test.rule.OutputCapture; ...@@ -32,6 +31,7 @@ import org.springframework.boot.test.rule.OutputCapture;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
...@@ -60,7 +60,7 @@ public class SampleActuatorLog4J2ApplicationTests { ...@@ -60,7 +60,7 @@ public class SampleActuatorLog4J2ApplicationTests {
@Test @Test
public void testLogger() { public void testLogger() {
logger.info("Hello World"); logger.info("Hello World");
Assertions.assertThat(this.output.toString()).contains("Hello World"); assertThat(this.output.toString()).contains("Hello World");
} }
@Test @Test
......
...@@ -43,10 +43,10 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -43,10 +43,10 @@ import static org.assertj.core.api.Assertions.assertThat;
public class SampleActuatorUiApplicationPortTests { public class SampleActuatorUiApplicationPortTests {
@LocalServerPort @LocalServerPort
private int port = 9010; private int port;
@LocalManagementPort @LocalManagementPort
private int managementPort = 9011; private int managementPort;
@Test @Test
public void testHome() { public void testHome() {
......
...@@ -44,10 +44,10 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -44,10 +44,10 @@ import static org.assertj.core.api.Assertions.assertThat;
public class ManagementAddressActuatorApplicationTests { public class ManagementAddressActuatorApplicationTests {
@LocalServerPort @LocalServerPort
private int port = 9010; private int port;
@LocalManagementPort @LocalManagementPort
private int managementPort = 9011; private int managementPort;
@Test @Test
public void testHome() { public void testHome() {
......
...@@ -46,10 +46,10 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -46,10 +46,10 @@ import static org.assertj.core.api.Assertions.assertThat;
public class ManagementPortAndPathSampleActuatorApplicationTests { public class ManagementPortAndPathSampleActuatorApplicationTests {
@LocalServerPort @LocalServerPort
private int port = 9010; private int port;
@LocalManagementPort @LocalManagementPort
private int managementPort = 9011; private int managementPort;
@Autowired @Autowired
private Environment environment; private Environment environment;
......
...@@ -43,10 +43,10 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -43,10 +43,10 @@ import static org.assertj.core.api.Assertions.assertThat;
public class ManagementPortSampleActuatorApplicationTests { public class ManagementPortSampleActuatorApplicationTests {
@LocalServerPort @LocalServerPort
private int port = 9010; private int port;
@LocalManagementPort @LocalManagementPort
private int managementPort = 9011; private int managementPort;
@Test @Test
public void testHome() { public void testHome() {
......
...@@ -2,6 +2,5 @@ import java.io.*; ...@@ -2,6 +2,5 @@ import java.io.*;
import sample.layout.*; import sample.layout.*;
Verify.verify( Verify.verify(
new File( basedir, "target/custom-0.0.1.BUILD-SNAPSHOT.jar" ), "custom" new File(basedir, "target/custom-0.0.1.BUILD-SNAPSHOT.jar"), "custom"
); )
...@@ -2,6 +2,5 @@ import java.io.*; ...@@ -2,6 +2,5 @@ import java.io.*;
import sample.layout.*; import sample.layout.*;
Verify.verify( Verify.verify(
new File( basedir, "target/default-0.0.1.BUILD-SNAPSHOT.jar" ), "sample" new File(basedir, "target/default-0.0.1.BUILD-SNAPSHOT.jar"), "sample"
); )
...@@ -41,10 +41,10 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -41,10 +41,10 @@ import static org.assertj.core.api.Assertions.assertThat;
public class JerseyApplicationPathAndManagementPortTests { public class JerseyApplicationPathAndManagementPortTests {
@LocalServerPort @LocalServerPort
private int port = 9010; private int port;
@LocalManagementPort @LocalManagementPort
private int managementPort = 9011; private int managementPort;
@Autowired @Autowired
private TestRestTemplate testRestTemplate; private TestRestTemplate testRestTemplate;
......
...@@ -18,7 +18,6 @@ package sample.secure.webflux; ...@@ -18,7 +18,6 @@ package sample.secure.webflux;
import java.util.Base64; import java.util.Base64;
import org.assertj.core.api.Assertions;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
...@@ -37,6 +36,8 @@ import org.springframework.security.web.server.SecurityWebFilterChain; ...@@ -37,6 +36,8 @@ import org.springframework.security.web.server.SecurityWebFilterChain;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.reactive.server.WebTestClient;
import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Integration tests for separate management and main service ports. * Integration tests for separate management and main service ports.
* *
...@@ -50,10 +51,10 @@ import org.springframework.test.web.reactive.server.WebTestClient; ...@@ -50,10 +51,10 @@ import org.springframework.test.web.reactive.server.WebTestClient;
public class ManagementPortSampleSecureWebFluxTests { public class ManagementPortSampleSecureWebFluxTests {
@LocalServerPort @LocalServerPort
private int port = 9010; private int port;
@LocalManagementPort @LocalManagementPort
private int managementPort = 9011; private int managementPort;
@Autowired @Autowired
private WebTestClient webClient; private WebTestClient webClient;
...@@ -90,7 +91,7 @@ public class ManagementPortSampleSecureWebFluxTests { ...@@ -90,7 +91,7 @@ public class ManagementPortSampleSecureWebFluxTests {
String.class) String.class)
.exchange().expectStatus().isOk().expectBody(String.class).returnResult() .exchange().expectStatus().isOk().expectBody(String.class).returnResult()
.getResponseBody(); .getResponseBody();
Assertions.assertThat(responseBody).contains("\"status\":\"UP\""); assertThat(responseBody).contains("\"status\":\"UP\"");
} }
private String getBasicAuth() { private String getBasicAuth() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment