Simplify AssertJ assertions and also make them more readable
See gh-33653
This commit is contained in:
committed by
Moritz Halbritter
parent
c9a2b2ab66
commit
cf6493f65c
@@ -96,7 +96,7 @@ class BootBuildImageTests {
|
||||
void springBootVersionDefaultValueIsUsed() {
|
||||
BuildRequest request = this.buildImage.createRequest();
|
||||
assertThat(request.getCreator().getName()).isEqualTo("Spring Boot");
|
||||
assertThat(request.getCreator().getVersion()).isEqualTo("");
|
||||
assertThat(request.getCreator().getVersion()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.boot.gradle.tasks.bundling;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
import org.gradle.api.Action;
|
||||
import org.gradle.api.JavaVersion;
|
||||
@@ -77,14 +76,11 @@ class BootJarTests extends AbstractBootArchiveTests<BootJar> {
|
||||
@Test
|
||||
void jarsInLibAreStored() throws IOException {
|
||||
try (JarFile jarFile = new JarFile(createLayeredJar())) {
|
||||
assertThat(jarFile.getEntry("BOOT-INF/lib/first-library.jar").getMethod()).isEqualTo(ZipEntry.STORED);
|
||||
assertThat(jarFile.getEntry("BOOT-INF/lib/second-library.jar").getMethod()).isEqualTo(ZipEntry.STORED);
|
||||
assertThat(jarFile.getEntry("BOOT-INF/lib/third-library-SNAPSHOT.jar").getMethod())
|
||||
.isEqualTo(ZipEntry.STORED);
|
||||
assertThat(jarFile.getEntry("BOOT-INF/lib/first-project-library.jar").getMethod())
|
||||
.isEqualTo(ZipEntry.STORED);
|
||||
assertThat(jarFile.getEntry("BOOT-INF/lib/second-project-library-SNAPSHOT.jar").getMethod())
|
||||
.isEqualTo(ZipEntry.STORED);
|
||||
assertThat(jarFile.getEntry("BOOT-INF/lib/first-library.jar").getMethod()).isZero();
|
||||
assertThat(jarFile.getEntry("BOOT-INF/lib/second-library.jar").getMethod()).isZero();
|
||||
assertThat(jarFile.getEntry("BOOT-INF/lib/third-library-SNAPSHOT.jar").getMethod()).isZero();
|
||||
assertThat(jarFile.getEntry("BOOT-INF/lib/first-project-library.jar").getMethod()).isZero();
|
||||
assertThat(jarFile.getEntry("BOOT-INF/lib/second-project-library-SNAPSHOT.jar").getMethod()).isZero();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class DockerSpecTests {
|
||||
DockerConfiguration dockerConfiguration = this.dockerSpec.asDockerConfiguration();
|
||||
DockerHost host = dockerConfiguration.getHost();
|
||||
assertThat(host.getAddress()).isEqualTo("docker.example.com");
|
||||
assertThat(host.isSecure()).isEqualTo(true);
|
||||
assertThat(host.isSecure()).isTrue();
|
||||
assertThat(host.getCertificatePath()).isEqualTo("/tmp/ca-cert");
|
||||
assertThat(dockerConfiguration.isBindHostToBuilder()).isFalse();
|
||||
assertThat(this.dockerSpec.asDockerConfiguration().getBuilderRegistryAuthentication()).isNull();
|
||||
@@ -80,7 +80,7 @@ class DockerSpecTests {
|
||||
DockerConfiguration dockerConfiguration = this.dockerSpec.asDockerConfiguration();
|
||||
DockerHost host = dockerConfiguration.getHost();
|
||||
assertThat(host.getAddress()).isEqualTo("docker.example.com");
|
||||
assertThat(host.isSecure()).isEqualTo(false);
|
||||
assertThat(host.isSecure()).isFalse();
|
||||
assertThat(host.getCertificatePath()).isNull();
|
||||
assertThat(dockerConfiguration.isBindHostToBuilder()).isFalse();
|
||||
assertThat(this.dockerSpec.asDockerConfiguration().getBuilderRegistryAuthentication()).isNull();
|
||||
@@ -96,7 +96,7 @@ class DockerSpecTests {
|
||||
DockerConfiguration dockerConfiguration = this.dockerSpec.asDockerConfiguration();
|
||||
DockerHost host = dockerConfiguration.getHost();
|
||||
assertThat(host.getAddress()).isEqualTo("docker.example.com");
|
||||
assertThat(host.isSecure()).isEqualTo(false);
|
||||
assertThat(host.isSecure()).isFalse();
|
||||
assertThat(host.getCertificatePath()).isNull();
|
||||
assertThat(dockerConfiguration.isBindHostToBuilder()).isTrue();
|
||||
assertThat(this.dockerSpec.asDockerConfiguration().getBuilderRegistryAuthentication()).isNull();
|
||||
|
||||
Reference in New Issue
Block a user