From 34754e74ad17231b515fd8f25da96a8fd0f44858 Mon Sep 17 00:00:00 2001 From: Constantin Date: Mon, 20 Nov 2023 22:12:10 +0200 Subject: [PATCH] BAEL-6014: Address PR comments --- .../KeystoreCertificateNameAliasUnitTest.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/core-java-modules/core-java-security-4/src/test/java/com/baeldung/keystorealias/KeystoreCertificateNameAliasUnitTest.java b/core-java-modules/core-java-security-4/src/test/java/com/baeldung/keystorealias/KeystoreCertificateNameAliasUnitTest.java index 26bd937ca4..e53c1c57cb 100644 --- a/core-java-modules/core-java-security-4/src/test/java/com/baeldung/keystorealias/KeystoreCertificateNameAliasUnitTest.java +++ b/core-java-modules/core-java-security-4/src/test/java/com/baeldung/keystorealias/KeystoreCertificateNameAliasUnitTest.java @@ -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(); +} } \ No newline at end of file