Test value changes

These are genuine functionality changes, and may represent unexpected
impact.  Having two CNs doesn't seem right, but that case is tested so
I'm leaving that here for discussion's sake.

The other test case doesn't have a CN anymore, as expected
pull/147/head
Matthew McPherrin 2023-11-08 22:42:54 -05:00 committed by Richard Körber
parent beb1d53dc0
commit 278f9bd57b
2 changed files with 3 additions and 3 deletions

View File

@ -189,7 +189,7 @@ public class CSRBuilderTest {
builder.addValue("CN", "firstcn.example.com");
assertThat(builder.toString()).isEqualTo("C=DE,E=contact@example.com,CN=firstcn.example.com,DNS=firstcn.example.com");
builder.addValue("CN", "scnd.example.com");
assertThat(builder.toString()).isEqualTo("C=DE,E=contact@example.com,CN=firstcn.example.com,DNS=firstcn.example.com,DNS=scnd.example.com");
assertThat(builder.toString()).isEqualTo("C=DE,E=contact@example.com,CN=firstcn.example.com,CN=scnd.example.com,DNS=firstcn.example.com,DNS=scnd.example.com");
builder = new CSRBuilder();
builder.addValue(BCStyle.C, "DE");
@ -199,7 +199,7 @@ public class CSRBuilderTest {
builder.addValue(BCStyle.CN, "firstcn.example.com");
assertThat(builder.toString()).isEqualTo("C=DE,E=contact@example.com,CN=firstcn.example.com,DNS=firstcn.example.com");
builder.addValue(BCStyle.CN, "scnd.example.com");
assertThat(builder.toString()).isEqualTo("C=DE,E=contact@example.com,CN=firstcn.example.com,DNS=firstcn.example.com,DNS=scnd.example.com");
assertThat(builder.toString()).isEqualTo("C=DE,E=contact@example.com,CN=firstcn.example.com,CN=scnd.example.com,DNS=firstcn.example.com,DNS=scnd.example.com");
}
private CSRBuilder createBuilderWithValues() throws UnknownHostException {

View File

@ -228,7 +228,7 @@ public class CertificateUtilsTest {
notAfter, rootCert, rootKeypair.getPrivate());
assertThat(cert.getIssuerX500Principal().getName()).isEqualTo(rootSubject);
assertThat(cert.getSubjectX500Principal().getName()).isEqualTo("CN=example.org");
assertThat(cert.getSubjectX500Principal().getName()).isEqualTo("");
assertThat(getSANs(cert)).contains("example.org", "www.example.org");
assertThat(getIpSANs(cert)).contains(InetAddress.getByName("192.168.0.1"));
assertThat(cert.getNotBefore().toInstant()).isEqualTo(notBefore);