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:
cushon 2018-02-26 09:38:17 -08:00 committed by jianglai
parent f96a0b7da9
commit 606b470cd0
180 changed files with 1325 additions and 1381 deletions

View file

@ -16,7 +16,7 @@ package google.registry.rde.imports;
import static com.google.common.truth.Truth.assertThat;
import static google.registry.rde.imports.RdeImportsTestData.loadBytes;
import static google.registry.testing.JUnitBackports.expectThrows;
import static google.registry.testing.JUnitBackports.assertThrows;
import com.google.common.io.ByteSource;
import google.registry.rde.imports.RdeParser.RdeHeader;
@ -74,7 +74,7 @@ public class RdeParserTest {
@Test
public void testGetContactNotAtElement_throwsIllegalStateException() throws Exception {
try (RdeParser parser = new RdeParser(xml)) {
IllegalStateException thrown = expectThrows(IllegalStateException.class, parser::getContact);
IllegalStateException thrown = assertThrows(IllegalStateException.class, parser::getContact);
assertThat(thrown)
.hasMessageThat()
.contains("Not at element urn:ietf:params:xml:ns:rdeContact-1.0:contact");
@ -158,7 +158,7 @@ public class RdeParserTest {
@Test
public void testGetDomainNotAtElement_throwsIllegalStateException() throws Exception {
try (RdeParser parser = new RdeParser(xml)) {
IllegalStateException thrown = expectThrows(IllegalStateException.class, parser::getDomain);
IllegalStateException thrown = assertThrows(IllegalStateException.class, parser::getDomain);
assertThat(thrown)
.hasMessageThat()
.contains("Not at element urn:ietf:params:xml:ns:rdeDomain-1.0:domain");
@ -270,7 +270,7 @@ public class RdeParserTest {
@Test
public void testGetHostNotAtElement_throwsIllegalStateException() throws Exception {
try (RdeParser parser = new RdeParser(xml)) {
IllegalStateException thrown = expectThrows(IllegalStateException.class, parser::getHost);
IllegalStateException thrown = assertThrows(IllegalStateException.class, parser::getHost);
assertThat(thrown)
.hasMessageThat()
.contains("Not at element urn:ietf:params:xml:ns:rdeHost-1.0:host");
@ -384,7 +384,7 @@ public class RdeParserTest {
public void testGetRegistrarNotAtElement_throwsIllegalStateException() throws Exception {
try (RdeParser parser = new RdeParser(xml)) {
IllegalStateException thrown =
expectThrows(IllegalStateException.class, parser::getRegistrar);
assertThrows(IllegalStateException.class, parser::getRegistrar);
assertThat(thrown)
.hasMessageThat()
.contains("Not at element urn:ietf:params:xml:ns:rdeRegistrar-1.0:registrar");
@ -423,7 +423,7 @@ public class RdeParserTest {
@Test
public void testGetNndnNotAtElement_throwsIllegalStateException() throws Exception {
try (RdeParser parser = new RdeParser(xml)) {
IllegalStateException thrown = expectThrows(IllegalStateException.class, parser::getNndn);
IllegalStateException thrown = assertThrows(IllegalStateException.class, parser::getNndn);
assertThat(thrown)
.hasMessageThat()
.contains("Not at element urn:ietf:params:xml:ns:rdeNNDN-1.0:NNDN");
@ -461,7 +461,7 @@ public class RdeParserTest {
@Test
public void testGetIdnNotAtElement_throwsIllegalStateException() throws Exception {
try (RdeParser parser = new RdeParser(xml)) {
IllegalStateException thrown = expectThrows(IllegalStateException.class, parser::getIdn);
IllegalStateException thrown = assertThrows(IllegalStateException.class, parser::getIdn);
assertThat(thrown)
.hasMessageThat()
.contains("Not at element urn:ietf:params:xml:ns:rdeIDN-1.0:idnTableRef");
@ -502,7 +502,7 @@ public class RdeParserTest {
public void testGetEppParamsNotAtElement_throwsIllegalStateException() throws Exception {
try (RdeParser parser = new RdeParser(xml)) {
IllegalStateException thrown =
expectThrows(IllegalStateException.class, parser::getEppParams);
assertThrows(IllegalStateException.class, parser::getEppParams);
assertThat(thrown)
.hasMessageThat()
.contains("Not at element urn:ietf:params:xml:ns:rdeEppParams-1.0:eppParams");