Remove SSL initializer from the prober (#378)

The prober now uses the common SSL initializer in the networking
subproject.

Also changed both initializers to take an ImmutableList of certificates
other than an array of those, for better immutability.

I have no idea where these lockfile changes are coming from. They seem
to be pure noise as far as code review is concerned.
This commit is contained in:
Lai Jiang 2019-11-22 17:46:06 -05:00 committed by GitHub
parent e318f47fc6
commit 05d56fe1a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 257 additions and 770 deletions

View file

@ -20,6 +20,7 @@ import static google.registry.networking.handler.SslInitializerTestUtils.signKey
import static google.registry.testing.JUnitBackports.assertThrows;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.collect.ImmutableList;
import dagger.Component;
import dagger.Module;
import dagger.Provides;
@ -79,7 +80,7 @@ public class CertificateModuleTest {
byte[] pemBytes = getPemBytes(cert, ssc.cert(), key);
component = createComponent(pemBytes);
assertThat(component.privateKey()).isEqualTo(key);
assertThat(component.certificates()).asList().containsExactly(cert, ssc.cert()).inOrder();
assertThat(component.certificates()).containsExactly(cert, ssc.cert()).inOrder();
}
@Test
@ -87,7 +88,7 @@ public class CertificateModuleTest {
byte[] pemBytes = getPemBytes(cert, key, ssc.cert());
component = createComponent(pemBytes);
assertThat(component.privateKey()).isEqualTo(key);
assertThat(component.certificates()).asList().containsExactly(cert, ssc.cert()).inOrder();
assertThat(component.certificates()).containsExactly(cert, ssc.cert()).inOrder();
}
@Test
@ -131,13 +132,13 @@ public class CertificateModuleTest {
private final byte[] pemBytes;
PemBytesModule(byte[] pemBytes) {
this.pemBytes = pemBytes;
this.pemBytes = pemBytes.clone();
}
@Provides
@Named("pemBytes")
byte[] providePemBytes() {
return pemBytes;
return pemBytes.clone();
}
}
@ -156,6 +157,6 @@ public class CertificateModuleTest {
PrivateKey privateKey();
@Prod
X509Certificate[] certificates();
ImmutableList<X509Certificate> certificates();
}
}