mirror of
https://github.com/google/nomulus.git
synced 2025-07-21 02:06:00 +02:00
Upgrade rest of tools test classes to JUnit 5 (#705)
This commit is contained in:
parent
cf41f5d354
commit
cd23748fe8
27 changed files with 308 additions and 384 deletions
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue