Fix accidentally non-@Tested TmchXmlSignature test

Also adds the "test" prefix to all other tests so that our presubmit
rules can prevent similar future errors in this file.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150875528
This commit is contained in:
mcilwain 2017-03-22 07:28:23 -07:00 committed by Ben McIlwain
parent 3a18d8a04f
commit bb4a59203a

View file

@ -21,7 +21,7 @@ import google.registry.testing.AppEngineRule;
import google.registry.testing.ExceptionRule;
import google.registry.testing.FakeClock;
import google.registry.testing.InjectRule;
import java.security.SignatureException;
import google.registry.tmch.TmchXmlSignature.CertificateSignatureException;
import java.security.cert.CertificateExpiredException;
import java.security.cert.CertificateNotYetValidException;
import java.security.cert.CertificateRevokedException;
@ -62,15 +62,16 @@ public class TmchXmlSignatureTest {
tmchXmlSignature = new TmchXmlSignature(new TmchCertificateAuthority(TmchCaMode.PILOT));
}
public void wrongCertificateAuthority() throws Exception {
@Test
public void testWrongCertificateAuthority() throws Exception {
tmchXmlSignature = new TmchXmlSignature(new TmchCertificateAuthority(TmchCaMode.PRODUCTION));
smdData = loadSmd("active/Court-Agent-Arabic-Active.smd");
thrown.expectRootCause(SignatureException.class, "Signature does not match");
thrown.expectRootCause(CertificateSignatureException.class, "Signature does not match");
tmchXmlSignature.verify(smdData);
}
@Test
public void timeTravelBeforeCertificateWasCreated() throws Exception {
public void testTimeTravelBeforeCertificateWasCreated() throws Exception {
smdData = loadSmd("active/Court-Agent-Arabic-Active.smd");
clock.setTo(DateTime.parse("2013-05-01T00:00:00Z"));
thrown.expectRootCause(CertificateNotYetValidException.class);
@ -78,7 +79,7 @@ public class TmchXmlSignatureTest {
}
@Test
public void timeTravelAfterCertificateHasExpired() throws Exception {
public void testTimeTravelAfterCertificateHasExpired() throws Exception {
smdData = loadSmd("active/Court-Agent-Arabic-Active.smd");
clock.setTo(DateTime.parse("2023-06-01T00:00:00Z"));
thrown.expectRootCause(CertificateExpiredException.class);