mirror of
https://github.com/google/nomulus.git
synced 2025-08-02 07:52:11 +02:00
Use enum instead of boolean for TMCH CA mode
Also more narrowly scopes a catch block in TmchCertificateAuthority. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=144744847
This commit is contained in:
parent
0dbaa8e5bc
commit
a28e0b3ff7
13 changed files with 90 additions and 73 deletions
|
@ -16,6 +16,7 @@ package google.registry.tmch;
|
|||
|
||||
import static google.registry.tmch.TmchTestData.loadSmd;
|
||||
|
||||
import google.registry.config.RegistryConfig.ConfigModule.TmchCaMode;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
|
@ -58,11 +59,11 @@ public class TmchXmlSignatureTest {
|
|||
@Before
|
||||
public void before() throws Exception {
|
||||
inject.setStaticField(TmchCertificateAuthority.class, "clock", clock);
|
||||
tmchXmlSignature = new TmchXmlSignature(new TmchCertificateAuthority(true));
|
||||
tmchXmlSignature = new TmchXmlSignature(new TmchCertificateAuthority(TmchCaMode.PILOT));
|
||||
}
|
||||
|
||||
public void wrongCertificateAuthority() throws Exception {
|
||||
tmchXmlSignature = new TmchXmlSignature(new TmchCertificateAuthority(false));
|
||||
tmchXmlSignature = new TmchXmlSignature(new TmchCertificateAuthority(TmchCaMode.PRODUCTION));
|
||||
smdData = loadSmd("active/Court-Agent-Arabic-Active.smd");
|
||||
thrown.expectRootCause(SignatureException.class, "Signature does not match");
|
||||
tmchXmlSignature.verify(smdData);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue