BAEL-6014: Address PR comments

This commit is contained in:
Constantin 2023-11-20 22:12:10 +02:00
parent ee57392b4f
commit 34754e74ad
1 changed files with 15 additions and 15 deletions

View File

@ -25,25 +25,25 @@ public class KeystoreCertificateNameAliasUnitTest {
assertThat(keystore.containsAlias(KEYSTORE_ALIAS)).isTrue();
X509Certificate x509Certificate = (X509Certificate) keystore.getCertificate(KEYSTORE_ALIAS);
String owner = x509Certificate.getSubjectX500Principal().getName();
assertThat(owner.contains("my-cn.localhost")).isTrue();
String ownerName = x509Certificate.getSubjectX500Principal().getName();
assertThat(ownerName.contains("my-cn.localhost")).isTrue();
}
@Test
void whenCheckingAliasAndName_thenNameIsNotFound() throws Exception {
KeyStore keystore = readKeyStore();
@Test
void whenCheckingAliasAndName_thenNameIsNotFound() throws Exception {
KeyStore keystore = readKeyStore();
assertThat(keystore.containsAlias(KEYSTORE_ALIAS)).isTrue();
assertThat(keystore.containsAlias(KEYSTORE_ALIAS)).isTrue();
X509Certificate x509Certificate = (X509Certificate) keystore.getCertificate(KEYSTORE_ALIAS);
String owner = x509Certificate.getSubjectX500Principal().getName();
assertThat(owner.contains("commonName1")).isFalse();
}
X509Certificate x509Certificate = (X509Certificate) keystore.getCertificate(KEYSTORE_ALIAS);
String ownerName = x509Certificate.getSubjectX500Principal().getName();
assertThat(ownerName.contains("commonName1")).isFalse();
}
@Test
void whenCheckingAliasAndName_thenAliasIsNotFound() throws Exception {
KeyStore keystore = readKeyStore();
@Test
void whenCheckingAliasAndName_thenAliasIsNotFound() throws Exception {
KeyStore keystore = readKeyStore();
assertThat(keystore.containsAlias("alias1")).isFalse();
}
assertThat(keystore.containsAlias("alias1")).isFalse();
}
}