From bb4a59203a980a7ca82a75b8e1c5fc7611a06d26 Mon Sep 17 00:00:00 2001 From: mcilwain Date: Wed, 22 Mar 2017 07:28:23 -0700 Subject: [PATCH] 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 --- .../google/registry/tmch/TmchXmlSignatureTest.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/javatests/google/registry/tmch/TmchXmlSignatureTest.java b/javatests/google/registry/tmch/TmchXmlSignatureTest.java index 0b8102c7b..d625cd6be 100644 --- a/javatests/google/registry/tmch/TmchXmlSignatureTest.java +++ b/javatests/google/registry/tmch/TmchXmlSignatureTest.java @@ -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);