Upgrade rest of tools test classes to JUnit 5 (#705)

This commit is contained in:
Ben McIlwain 2020-07-22 11:09:21 -04:00 committed by GitHub
parent cf41f5d354
commit cd23748fe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 308 additions and 384 deletions

View file

@ -18,7 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
import static google.registry.networking.handler.SslInitializerTestUtils.getKeyPair;
import static google.registry.networking.handler.SslInitializerTestUtils.setUpSslChannel;
import static google.registry.networking.handler.SslInitializerTestUtils.signKeyPair;
import static google.registry.networking.handler.SslInitializerTestUtils.verifySslExcpetion;
import static google.registry.networking.handler.SslInitializerTestUtils.verifySslException;
import com.google.common.collect.ImmutableList;
import google.registry.networking.util.SelfSignedCaCertificate;
@ -225,7 +225,7 @@ public class SslClientInitializerTest {
sslProvider, hostProvider, portProvider, ImmutableList.of(ssc.cert()), null, null);
nettyRule.setUpClient(localAddress, sslClientInitializer);
verifySslExcpetion(
verifySslException(
nettyRule.getClientChannel(),
channel -> channel.pipeline().get(SslHandler.class).handshakeFuture().get(),
CertificateExpiredException.class);
@ -259,7 +259,7 @@ public class SslClientInitializerTest {
sslProvider, hostProvider, portProvider, ImmutableList.of(ssc.cert()), null, null);
nettyRule.setUpClient(localAddress, sslClientInitializer);
verifySslExcpetion(
verifySslException(
nettyRule.getClientChannel(),
channel -> channel.pipeline().get(SslHandler.class).handshakeFuture().get(),
CertificateNotYetValidException.class);

View file

@ -128,7 +128,7 @@ public final class SslInitializerTestUtils {
}
/** Verifies tha the SSL channel cannot be established due to a given exception. */
static void verifySslExcpetion(
static void verifySslException(
Channel channel, CheckedConsumer<Channel> operation, Class<? extends Exception> cause)
throws Exception {
// Extract SSL exception from the handshake future.

View file

@ -18,7 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
import static google.registry.networking.handler.SslInitializerTestUtils.getKeyPair;
import static google.registry.networking.handler.SslInitializerTestUtils.setUpSslChannel;
import static google.registry.networking.handler.SslInitializerTestUtils.signKeyPair;
import static google.registry.networking.handler.SslInitializerTestUtils.verifySslExcpetion;
import static google.registry.networking.handler.SslInitializerTestUtils.verifySslException;
import static google.registry.networking.handler.SslServerInitializer.CLIENT_CERTIFICATE_PROMISE_KEY;
import com.google.common.base.Suppliers;
@ -181,7 +181,7 @@ public class SslServerInitializerTest {
nettyRule.setUpClient(
localAddress, getClientHandler(serverSsc.cert(), clientSsc.key(), clientSsc.cert()));
verifySslExcpetion(
verifySslException(
nettyRule.getServerChannel(),
channel -> channel.attr(CLIENT_CERTIFICATE_PROMISE_KEY).get().get(),
CertificateExpiredException.class);
@ -202,7 +202,7 @@ public class SslServerInitializerTest {
nettyRule.setUpClient(
localAddress, getClientHandler(serverSsc.cert(), clientSsc.key(), clientSsc.cert()));
verifySslExcpetion(
verifySslException(
nettyRule.getServerChannel(),
channel -> channel.attr(CLIENT_CERTIFICATE_PROMISE_KEY).get().get(),
CertificateNotYetValidException.class);