mirror of
https://github.com/google/nomulus
synced 2026-09-18 22:14:23 +00:00
Automatically refactor more exception testing to use new JUnit rules
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=178911894
This commit is contained in:
@@ -32,7 +32,6 @@ import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
@@ -49,9 +48,6 @@ public class TmchXmlSignatureTest {
|
||||
.withDatastore()
|
||||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@@ -291,36 +287,31 @@ public class TmchXmlSignatureTest {
|
||||
@Test
|
||||
public void testInvalidInvalidsignatureCourtAgentFrenchActive() throws Exception {
|
||||
smdData = loadSmd("invalid/InvalidSignature-Court-Agent-French-Active.smd");
|
||||
thrown.expect(XMLSignatureException.class);
|
||||
tmchXmlSignature.verify(smdData);
|
||||
assertThrows(XMLSignatureException.class, () -> tmchXmlSignature.verify(smdData));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidInvalidsignatureTrademarkAgentEnglishActive() throws Exception {
|
||||
smdData = loadSmd("invalid/InvalidSignature-Trademark-Agent-English-Active.smd");
|
||||
thrown.expect(XMLSignatureException.class);
|
||||
tmchXmlSignature.verify(smdData);
|
||||
assertThrows(XMLSignatureException.class, () -> tmchXmlSignature.verify(smdData));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidInvalidsignatureTrademarkAgentRussianActive() throws Exception {
|
||||
smdData = loadSmd("invalid/InvalidSignature-Trademark-Agent-Russian-Active.smd");
|
||||
thrown.expect(XMLSignatureException.class);
|
||||
tmchXmlSignature.verify(smdData);
|
||||
assertThrows(XMLSignatureException.class, () -> tmchXmlSignature.verify(smdData));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidInvalidsignatureTreatystatuteAgentChineseActive() throws Exception {
|
||||
smdData = loadSmd("invalid/InvalidSignature-TreatyStatute-Agent-Chinese-Active.smd");
|
||||
thrown.expect(XMLSignatureException.class);
|
||||
tmchXmlSignature.verify(smdData);
|
||||
assertThrows(XMLSignatureException.class, () -> tmchXmlSignature.verify(smdData));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidInvalidsignatureTreatystatuteAgentEnglishActive() throws Exception {
|
||||
smdData = loadSmd("invalid/InvalidSignature-TreatyStatute-Agent-English-Active.smd");
|
||||
thrown.expect(XMLSignatureException.class);
|
||||
tmchXmlSignature.verify(smdData);
|
||||
assertThrows(XMLSignatureException.class, () -> tmchXmlSignature.verify(smdData));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user