mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Merge JUnitBackport's expectThrows into assertThrows
More information: https://github.com/junit-team/junit5/issues/531 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=187034408
This commit is contained in:
parent
f96a0b7da9
commit
606b470cd0
180 changed files with 1325 additions and 1381 deletions
|
@ -22,7 +22,7 @@ import static google.registry.proxy.TestUtils.makeHttpPostRequest;
|
|||
import static google.registry.proxy.TestUtils.makeHttpResponse;
|
||||
import static google.registry.proxy.handler.EppServiceHandler.CLIENT_CERTIFICATE_HASH_KEY;
|
||||
import static google.registry.proxy.handler.RelayHandler.RELAY_CHANNEL_KEY;
|
||||
import static google.registry.testing.JUnitBackports.expectThrows;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
|
@ -96,7 +96,7 @@ public class BackendMetricsHandlerTest {
|
|||
public void testFailure_outbound_wrongType() {
|
||||
Object request = new Object();
|
||||
IllegalArgumentException e =
|
||||
expectThrows(IllegalArgumentException.class, () -> channel.writeOutbound(request));
|
||||
assertThrows(IllegalArgumentException.class, () -> channel.writeOutbound(request));
|
||||
assertThat(e).hasMessageThat().isEqualTo("Outgoing request must be FullHttpRequest.");
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ public class BackendMetricsHandlerTest {
|
|||
public void testFailure_inbound_wrongType() {
|
||||
Object response = new Object();
|
||||
IllegalArgumentException e =
|
||||
expectThrows(IllegalArgumentException.class, () -> channel.writeInbound(response));
|
||||
assertThrows(IllegalArgumentException.class, () -> channel.writeInbound(response));
|
||||
assertThat(e).hasMessageThat().isEqualTo("Incoming response must be FullHttpResponse.");
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ public class BackendMetricsHandlerTest {
|
|||
public void testFailure_responseBeforeRequest() {
|
||||
FullHttpResponse response = makeHttpResponse("phantom response", HttpResponseStatus.OK);
|
||||
IllegalStateException e =
|
||||
expectThrows(IllegalStateException.class, () -> channel.writeInbound(response));
|
||||
assertThrows(IllegalStateException.class, () -> channel.writeInbound(response));
|
||||
assertThat(e).hasMessageThat().isEqualTo("Response received before request is sent.");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue