mirror of
https://github.com/google/nomulus.git
synced 2025-07-24 19:48:32 +02: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:
parent
36ad38e5df
commit
7dc224627f
125 changed files with 1970 additions and 1982 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue