Skip to content

Commit

Permalink
Merge pull request #25499 from dreis2211
Browse files Browse the repository at this point in the history
* pr/25499:
  Fix some assertions

Closes gh-25499
  • Loading branch information
snicoll committed Mar 5, 2021
2 parents ae630e0 + 89a44f3 commit 2682b38
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -284,7 +284,7 @@ void securityWitHostnameVerificationEnabled() {
@Test
void securityWithCustomCertificates(@TempDir File directory) throws IOException {
File certFile = new File(directory, "neo4j-driver.cert");
assertThat(certFile.createNewFile());
assertThat(certFile.createNewFile()).isTrue();

Neo4jProperties properties = new Neo4jProperties();
properties.getSecurity().setTrustStrategy(TrustStrategy.TRUST_CUSTOM_CA_SIGNED_CERTIFICATES);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -80,7 +80,7 @@ void notUpToDateWhenExecutedTwiceAsTimeChanges() {
Properties second = buildInfoProperties();
String secondBuildTime = second.getProperty("build.time");
assertThat(secondBuildTime).isNotNull();
assertThat(Instant.parse(firstBuildTime).isBefore(Instant.parse(secondBuildTime)));
assertThat(Instant.parse(firstBuildTime)).isBefore(Instant.parse(secondBuildTime));
}

@TestTemplate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,7 +61,7 @@ public class BootBuildImageRegistryIntegrationTests {

@BeforeEach
void setUp() {
assertThat(registry.isRunning());
assertThat(registry.isRunning()).isTrue();
this.registryAddress = registry.getHost() + ":" + registry.getFirstMappedPort();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static final class JarAssert extends AbstractAssert<JarAssert, File> {

private JarAssert(File actual) {
super(actual, JarAssert.class);
assertThat(actual.exists());
assertThat(actual).exists();
}

JarAssert doesNotHaveEntryWithName(String name) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -55,7 +55,7 @@ public class BuildImageRegistryIntegrationTests extends AbstractArchiveIntegrati

@BeforeEach
void setUp() {
assertThat(registry.isRunning());
assertThat(registry.isRunning()).isTrue();
this.dockerClient = registry.getDockerClient();
this.registryAddress = registry.getHost() + ":" + registry.getFirstMappedPort();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1228,10 +1228,10 @@ void addBootstrapper() {
application.addListeners(listener);
application.run();
ApplicationStartingEvent startingEvent = listener.getEvent(ApplicationStartingEvent.class);
assertThat(startingEvent.getBootstrapContext().get(String.class));
assertThat(startingEvent.getBootstrapContext().get(String.class)).isEqualTo("boot");
ApplicationEnvironmentPreparedEvent environmentPreparedEvent = listener
.getEvent(ApplicationEnvironmentPreparedEvent.class);
assertThat(environmentPreparedEvent.getBootstrapContext().get(String.class));
assertThat(environmentPreparedEvent.getBootstrapContext().get(String.class)).isEqualTo("boot");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -54,7 +54,6 @@
import org.springframework.util.SocketUtils;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.will;
import static org.mockito.Mockito.inOrder;
Expand Down Expand Up @@ -203,7 +202,7 @@ void tcpTransportSslRejectsInsecureClient() {
String payload = "test payload";
Mono<String> responseMono = this.requester.route("test").data(payload).retrieveMono(String.class);
StepVerifier.create(responseMono)
.verifyErrorSatisfies((ex) -> assertThatExceptionOfType(ClosedChannelException.class));
.verifyErrorSatisfies((ex) -> assertThat(ex).isInstanceOf(ClosedChannelException.class));
}

private RSocketRequester createRSocketTcpClient() {
Expand Down

0 comments on commit 2682b38

Please sign in to comment.