From 5db1214c03c0158018cfa98775c5b5c628db394a Mon Sep 17 00:00:00 2001 From: Sviatoslav Sv Date: Fri, 10 May 2024 12:38:05 +0300 Subject: [PATCH 1/6] unignore tests, rerun 6 times without failings --- privateca/snippets/src/test/java/privateca/SnippetsIT.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/privateca/snippets/src/test/java/privateca/SnippetsIT.java b/privateca/snippets/src/test/java/privateca/SnippetsIT.java index 81ef6f87540..5f8b246cb38 100644 --- a/privateca/snippets/src/test/java/privateca/SnippetsIT.java +++ b/privateca/snippets/src/test/java/privateca/SnippetsIT.java @@ -54,14 +54,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) -@Ignore("TODO: Fix https://github.com/GoogleCloudPlatform/java-docs-samples/issues/8966") public class SnippetsIT { private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); @@ -313,7 +311,7 @@ public void testListCAPools() throws IOException { @Test public void testDeleteCAPool() - throws InterruptedException, ExecutionException, IOException, TimeoutException { + throws InterruptedException, ExecutionException, IOException { DeleteCaPool.deleteCaPool(PROJECT_ID, LOCATION, CA_poolId_DELETE); assertThat(stdOut.toString()).contains("Deleted CA Pool: " + CA_poolId_DELETE); } @@ -344,7 +342,7 @@ public void testUpdateCertificateAuthority() } @Test - public void testMonitorCertificateAuthority() throws IOException, InterruptedException { + public void testMonitorCertificateAuthority() throws IOException { String policyName = MonitorCertificateAuthority.createCaMonitoringPolicy(PROJECT_ID); assertThat(policyName).contains("projects/" + PROJECT_ID + "/alertPolicies/"); From e680bb04bd1c871af2b3f31215c5d98de674ab37 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sv Date: Tue, 14 May 2024 13:30:18 +0300 Subject: [PATCH 2/6] added logging --- .../src/test/java/privateca/SnippetsIT.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/privateca/snippets/src/test/java/privateca/SnippetsIT.java b/privateca/snippets/src/test/java/privateca/SnippetsIT.java index 5f8b246cb38..7d590edbb58 100644 --- a/privateca/snippets/src/test/java/privateca/SnippetsIT.java +++ b/privateca/snippets/src/test/java/privateca/SnippetsIT.java @@ -46,6 +46,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.logging.Logger; + import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.util.io.pem.PemObject; import org.bouncycastle.util.io.pem.PemWriter; @@ -62,6 +64,7 @@ @RunWith(JUnit4.class) public class SnippetsIT { + private static final Logger LOGGER = Logger.getLogger(SnippetsIT.class.getName()); private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); private static String LOCATION; private static String CA_poolId; @@ -101,6 +104,7 @@ public static void setUp() LOCATION = Util.getRegion(); CA_poolId = "ca-pool-" + UUID.randomUUID(); CA_poolId_DELETE = "ca-pool-" + UUID.randomUUID(); + LOGGER.warning(() -> "CA_poolId_DELETE ::> " + CA_poolId_DELETE); CA_NAME = "ca-name-" + UUID.randomUUID(); CA_NAME_DELETE = "ca-name-" + UUID.randomUUID(); SUBORDINATE_CA_NAME = "sub-ca-name-" + UUID.randomUUID(); @@ -118,6 +122,16 @@ public static void setUp() CreateCaPool.createCaPool(PROJECT_ID, LOCATION, CA_poolId); CreateCaPool.createCaPool(PROJECT_ID, LOCATION, CA_poolId_DELETE); sleep(5); + LOGGER.warning(() -> { + try { + ByteArrayOutputStream stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + ListCaPools.listCaPools(PROJECT_ID, LOCATION); + return "CreateCaPool.createCaPool ::> " + stdOut; + } catch (IOException e) { + throw new RuntimeException(e); + } + }); // Set the issuance policy for the created CA Pool. UpdateCaPoolIssuancePolicy.updateCaPoolIssuancePolicy(PROJECT_ID, LOCATION, CA_poolId); // <--- END CA POOL ---> @@ -312,6 +326,16 @@ public void testListCAPools() throws IOException { @Test public void testDeleteCAPool() throws InterruptedException, ExecutionException, IOException { + LOGGER.warning(() -> { + try { + ByteArrayOutputStream stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + ListCaPools.listCaPools(PROJECT_ID, LOCATION); + return "testDeleteCAPool.testDeleteCAPool ::> " + stdOut; + } catch (IOException e) { + throw new RuntimeException(e); + } + }); DeleteCaPool.deleteCaPool(PROJECT_ID, LOCATION, CA_poolId_DELETE); assertThat(stdOut.toString()).contains("Deleted CA Pool: " + CA_poolId_DELETE); } From 657ad61798281bd0040ef4a9d003385a55595fa5 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sv Date: Tue, 14 May 2024 14:33:24 +0300 Subject: [PATCH 3/6] revert logging --- .../src/test/java/privateca/SnippetsIT.java | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/privateca/snippets/src/test/java/privateca/SnippetsIT.java b/privateca/snippets/src/test/java/privateca/SnippetsIT.java index 7d590edbb58..609990cb506 100644 --- a/privateca/snippets/src/test/java/privateca/SnippetsIT.java +++ b/privateca/snippets/src/test/java/privateca/SnippetsIT.java @@ -46,8 +46,6 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import java.util.logging.Logger; - import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.util.io.pem.PemObject; import org.bouncycastle.util.io.pem.PemWriter; @@ -63,8 +61,6 @@ @RunWith(JUnit4.class) public class SnippetsIT { - - private static final Logger LOGGER = Logger.getLogger(SnippetsIT.class.getName()); private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); private static String LOCATION; private static String CA_poolId; @@ -104,7 +100,6 @@ public static void setUp() LOCATION = Util.getRegion(); CA_poolId = "ca-pool-" + UUID.randomUUID(); CA_poolId_DELETE = "ca-pool-" + UUID.randomUUID(); - LOGGER.warning(() -> "CA_poolId_DELETE ::> " + CA_poolId_DELETE); CA_NAME = "ca-name-" + UUID.randomUUID(); CA_NAME_DELETE = "ca-name-" + UUID.randomUUID(); SUBORDINATE_CA_NAME = "sub-ca-name-" + UUID.randomUUID(); @@ -122,16 +117,7 @@ public static void setUp() CreateCaPool.createCaPool(PROJECT_ID, LOCATION, CA_poolId); CreateCaPool.createCaPool(PROJECT_ID, LOCATION, CA_poolId_DELETE); sleep(5); - LOGGER.warning(() -> { - try { - ByteArrayOutputStream stdOut = new ByteArrayOutputStream(); - System.setOut(new PrintStream(stdOut)); - ListCaPools.listCaPools(PROJECT_ID, LOCATION); - return "CreateCaPool.createCaPool ::> " + stdOut; - } catch (IOException e) { - throw new RuntimeException(e); - } - }); + // Set the issuance policy for the created CA Pool. UpdateCaPoolIssuancePolicy.updateCaPoolIssuancePolicy(PROJECT_ID, LOCATION, CA_poolId); // <--- END CA POOL ---> @@ -326,16 +312,6 @@ public void testListCAPools() throws IOException { @Test public void testDeleteCAPool() throws InterruptedException, ExecutionException, IOException { - LOGGER.warning(() -> { - try { - ByteArrayOutputStream stdOut = new ByteArrayOutputStream(); - System.setOut(new PrintStream(stdOut)); - ListCaPools.listCaPools(PROJECT_ID, LOCATION); - return "testDeleteCAPool.testDeleteCAPool ::> " + stdOut; - } catch (IOException e) { - throw new RuntimeException(e); - } - }); DeleteCaPool.deleteCaPool(PROJECT_ID, LOCATION, CA_poolId_DELETE); assertThat(stdOut.toString()).contains("Deleted CA Pool: " + CA_poolId_DELETE); } From cacb539b31a0fa233966d6ca24cfbf85e078ce65 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sv Date: Wed, 15 May 2024 12:33:05 +0300 Subject: [PATCH 4/6] added method ordering --- .../src/test/java/privateca/SnippetsIT.java | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/privateca/snippets/src/test/java/privateca/SnippetsIT.java b/privateca/snippets/src/test/java/privateca/SnippetsIT.java index 609990cb506..76f6344abff 100644 --- a/privateca/snippets/src/test/java/privateca/SnippetsIT.java +++ b/privateca/snippets/src/test/java/privateca/SnippetsIT.java @@ -54,12 +54,15 @@ import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.FixMethodOrder; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.junit.runners.MethodSorters; @RunWith(JUnit4.class) +@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class SnippetsIT { private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); private static String LOCATION; @@ -270,7 +273,7 @@ public void afterEach() { } @Test - public void testCreateCAPool() throws IOException { + public void atestCreateCAPool() throws IOException { // Check if the CA pool created during setup is successful. try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { @@ -286,7 +289,7 @@ public void testCreateCAPool() throws IOException { } @Test - public void testUpdateCAPoolIssuancePolicy() throws IOException { + public void btestUpdateCAPoolIssuancePolicy() throws IOException { try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { IssuancePolicy issuancePolicy = @@ -304,20 +307,20 @@ public void testUpdateCAPoolIssuancePolicy() throws IOException { } @Test - public void testListCAPools() throws IOException { + public void ctestListCAPools() throws IOException { ListCaPools.listCaPools(PROJECT_ID, LOCATION); assertThat(stdOut.toString()).contains(CA_poolId); } @Test - public void testDeleteCAPool() + public void dtestDeleteCAPool() throws InterruptedException, ExecutionException, IOException { DeleteCaPool.deleteCaPool(PROJECT_ID, LOCATION, CA_poolId_DELETE); assertThat(stdOut.toString()).contains("Deleted CA Pool: " + CA_poolId_DELETE); } @Test - public void testCreateCertificateAuthority() throws IOException { + public void etestCreateCertificateAuthority() throws IOException { // Check if the CA created during setup is successful. try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { @@ -329,20 +332,20 @@ public void testCreateCertificateAuthority() throws IOException { } @Test - public void testListCertificateAuthorities() throws IOException { + public void ftestListCertificateAuthorities() throws IOException { ListCertificateAuthorities.listCertificateAuthority(PROJECT_ID, LOCATION, CA_poolId); assertThat(stdOut.toString()).contains(CA_NAME); } @Test - public void testUpdateCertificateAuthority() + public void gtestUpdateCertificateAuthority() throws IOException, ExecutionException, InterruptedException, TimeoutException { UpdateCertificateAuthority.updateCaLabel(PROJECT_ID, LOCATION, CA_poolId, CA_NAME); assertThat(stdOut.toString()).contains("Successfully updated the labels ! "); } @Test - public void testMonitorCertificateAuthority() throws IOException { + public void htestMonitorCertificateAuthority() throws IOException { String policyName = MonitorCertificateAuthority.createCaMonitoringPolicy(PROJECT_ID); assertThat(policyName).contains("projects/" + PROJECT_ID + "/alertPolicies/"); @@ -354,7 +357,7 @@ public void testMonitorCertificateAuthority() throws IOException { } @Test - public void testEnableDisableCertificateAuthority() + public void itestEnableDisableCertificateAuthority() throws InterruptedException, ExecutionException, IOException { EnableCertificateAuthority.enableCertificateAuthority( PROJECT_ID, LOCATION, CA_poolId, CA_NAME); @@ -365,7 +368,7 @@ public void testEnableDisableCertificateAuthority() } @Test - public void testDeleteUndeleteCertificateAuthority() + public void jtestDeleteUndeleteCertificateAuthority() throws InterruptedException, ExecutionException, IOException, TimeoutException { // CA deleted as part of setup(). Undelete the CA. // The undelete operation will be executed only if the CA was successfully deleted. @@ -376,7 +379,7 @@ public void testDeleteUndeleteCertificateAuthority() } @Test - public void testCreateCertificateTemplate() throws IOException { + public void ktestCreateCertificateTemplate() throws IOException { // Check that the Certificate template has been created as part of the setup. try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { @@ -393,14 +396,14 @@ public void testCreateCertificateTemplate() throws IOException { } @Test - public void testListCertificateTemplate() + public void ltestListCertificateTemplate() throws IOException, ExecutionException, InterruptedException, TimeoutException { ListCertificateTemplates.listCertificateTemplates(PROJECT_ID, LOCATION); assertThat(stdOut.toString()).contains(CERTIFICATE_TEMPLATE_NAME); } @Test - public void updateCertificateTemplate() + public void mupdateCertificateTemplate() throws IOException, ExecutionException, InterruptedException, TimeoutException { UpdateCertificateTemplate.updateCertificateTemplate( PROJECT_ID, LOCATION, CERTIFICATE_TEMPLATE_NAME); @@ -408,7 +411,7 @@ public void updateCertificateTemplate() } @Test - public void testCreateCertificate() throws IOException { + public void ntestCreateCertificate() throws IOException { // Check if the certificate created during setup is successful. try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { @@ -420,13 +423,13 @@ public void testCreateCertificate() throws IOException { } @Test - public void testListCertificates() throws IOException { + public void otestListCertificates() throws IOException { ListCertificates.listCertificates(PROJECT_ID, LOCATION, CA_poolId); assertThat(stdOut.toString()).contains(CERTIFICATE_NAME); } @Test - public void testFilterCertificates() throws IOException { + public void ptestFilterCertificates() throws IOException { // Filter only certificates created using CSR. FilterCertificates.filterCertificates(PROJECT_ID, LOCATION, CA_poolId); assertThat(stdOut.toString()).contains(CSR_CERTIFICATE_NAME); @@ -434,7 +437,7 @@ public void testFilterCertificates() throws IOException { } @Test - public void testRevokeCertificate() throws InterruptedException, ExecutionException, IOException { + public void qtestRevokeCertificate() throws InterruptedException, ExecutionException, IOException { try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { // Revoke the certificate. @@ -451,7 +454,7 @@ public void testRevokeCertificate() throws InterruptedException, ExecutionExcept } @Test - public void testCreateSubordinateCertificateAuthority() throws IOException { + public void rtestCreateSubordinateCertificateAuthority() throws IOException { try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { CertificateAuthority response = @@ -463,7 +466,7 @@ public void testCreateSubordinateCertificateAuthority() throws IOException { } @Test - public void testCreateCertificateWithCSR() throws IOException { + public void stestCreateCertificateWithCSR() throws IOException { try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { Certificate response = @@ -474,7 +477,7 @@ public void testCreateCertificateWithCSR() throws IOException { } @Test - public void testActivateSubordinateCertificateAuthority() + public void ttestActivateSubordinateCertificateAuthority() throws IOException, ExecutionException, InterruptedException { try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { From b8fcd5ae125e1ac24f0e694ed70c5e4f5c035640 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sv Date: Wed, 15 May 2024 13:51:21 +0300 Subject: [PATCH 5/6] remove clean up all ca pool --- privateca/snippets/src/test/java/privateca/SnippetsIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/privateca/snippets/src/test/java/privateca/SnippetsIT.java b/privateca/snippets/src/test/java/privateca/SnippetsIT.java index 76f6344abff..877b0175bb4 100644 --- a/privateca/snippets/src/test/java/privateca/SnippetsIT.java +++ b/privateca/snippets/src/test/java/privateca/SnippetsIT.java @@ -112,8 +112,8 @@ public static void setUp() KEY_SIZE = 2048; // Default key size // Delete stale resources - Util.cleanUpCaPool(PROJECT_ID, LOCATION); - TimeUnit.SECONDS.sleep(30); +// Util.cleanUpCaPool(PROJECT_ID, LOCATION); +// TimeUnit.SECONDS.sleep(30); // <--- START CA POOL ---> // Create CA Pool. From 71ed904df87fbf0198b1561caa4dd1a9ae4d44f9 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sv Date: Wed, 15 May 2024 15:06:21 +0300 Subject: [PATCH 6/6] return ordering --- .../src/test/java/privateca/SnippetsIT.java | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/privateca/snippets/src/test/java/privateca/SnippetsIT.java b/privateca/snippets/src/test/java/privateca/SnippetsIT.java index 877b0175bb4..f64e64e0b30 100644 --- a/privateca/snippets/src/test/java/privateca/SnippetsIT.java +++ b/privateca/snippets/src/test/java/privateca/SnippetsIT.java @@ -54,15 +54,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.FixMethodOrder; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.junit.runners.MethodSorters; @RunWith(JUnit4.class) -@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class SnippetsIT { private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); private static String LOCATION; @@ -273,7 +270,7 @@ public void afterEach() { } @Test - public void atestCreateCAPool() throws IOException { + public void testCreateCAPool() throws IOException { // Check if the CA pool created during setup is successful. try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { @@ -289,7 +286,7 @@ public void atestCreateCAPool() throws IOException { } @Test - public void btestUpdateCAPoolIssuancePolicy() throws IOException { + public void testUpdateCAPoolIssuancePolicy() throws IOException { try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { IssuancePolicy issuancePolicy = @@ -307,20 +304,20 @@ public void btestUpdateCAPoolIssuancePolicy() throws IOException { } @Test - public void ctestListCAPools() throws IOException { + public void testListCAPools() throws IOException { ListCaPools.listCaPools(PROJECT_ID, LOCATION); assertThat(stdOut.toString()).contains(CA_poolId); } @Test - public void dtestDeleteCAPool() + public void testDeleteCAPool() throws InterruptedException, ExecutionException, IOException { DeleteCaPool.deleteCaPool(PROJECT_ID, LOCATION, CA_poolId_DELETE); assertThat(stdOut.toString()).contains("Deleted CA Pool: " + CA_poolId_DELETE); } @Test - public void etestCreateCertificateAuthority() throws IOException { + public void testCreateCertificateAuthority() throws IOException { // Check if the CA created during setup is successful. try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { @@ -332,20 +329,20 @@ public void etestCreateCertificateAuthority() throws IOException { } @Test - public void ftestListCertificateAuthorities() throws IOException { + public void testListCertificateAuthorities() throws IOException { ListCertificateAuthorities.listCertificateAuthority(PROJECT_ID, LOCATION, CA_poolId); assertThat(stdOut.toString()).contains(CA_NAME); } @Test - public void gtestUpdateCertificateAuthority() + public void testUpdateCertificateAuthority() throws IOException, ExecutionException, InterruptedException, TimeoutException { UpdateCertificateAuthority.updateCaLabel(PROJECT_ID, LOCATION, CA_poolId, CA_NAME); assertThat(stdOut.toString()).contains("Successfully updated the labels ! "); } @Test - public void htestMonitorCertificateAuthority() throws IOException { + public void testMonitorCertificateAuthority() throws IOException { String policyName = MonitorCertificateAuthority.createCaMonitoringPolicy(PROJECT_ID); assertThat(policyName).contains("projects/" + PROJECT_ID + "/alertPolicies/"); @@ -357,7 +354,7 @@ public void htestMonitorCertificateAuthority() throws IOException { } @Test - public void itestEnableDisableCertificateAuthority() + public void testEnableDisableCertificateAuthority() throws InterruptedException, ExecutionException, IOException { EnableCertificateAuthority.enableCertificateAuthority( PROJECT_ID, LOCATION, CA_poolId, CA_NAME); @@ -368,7 +365,7 @@ public void itestEnableDisableCertificateAuthority() } @Test - public void jtestDeleteUndeleteCertificateAuthority() + public void testDeleteUndeleteCertificateAuthority() throws InterruptedException, ExecutionException, IOException, TimeoutException { // CA deleted as part of setup(). Undelete the CA. // The undelete operation will be executed only if the CA was successfully deleted. @@ -379,7 +376,7 @@ public void jtestDeleteUndeleteCertificateAuthority() } @Test - public void ktestCreateCertificateTemplate() throws IOException { + public void testCreateCertificateTemplate() throws IOException { // Check that the Certificate template has been created as part of the setup. try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { @@ -396,14 +393,14 @@ public void ktestCreateCertificateTemplate() throws IOException { } @Test - public void ltestListCertificateTemplate() + public void testListCertificateTemplate() throws IOException, ExecutionException, InterruptedException, TimeoutException { ListCertificateTemplates.listCertificateTemplates(PROJECT_ID, LOCATION); assertThat(stdOut.toString()).contains(CERTIFICATE_TEMPLATE_NAME); } @Test - public void mupdateCertificateTemplate() + public void updateCertificateTemplate() throws IOException, ExecutionException, InterruptedException, TimeoutException { UpdateCertificateTemplate.updateCertificateTemplate( PROJECT_ID, LOCATION, CERTIFICATE_TEMPLATE_NAME); @@ -411,7 +408,7 @@ public void mupdateCertificateTemplate() } @Test - public void ntestCreateCertificate() throws IOException { + public void testCreateCertificate() throws IOException { // Check if the certificate created during setup is successful. try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { @@ -423,13 +420,13 @@ public void ntestCreateCertificate() throws IOException { } @Test - public void otestListCertificates() throws IOException { + public void testListCertificates() throws IOException { ListCertificates.listCertificates(PROJECT_ID, LOCATION, CA_poolId); assertThat(stdOut.toString()).contains(CERTIFICATE_NAME); } @Test - public void ptestFilterCertificates() throws IOException { + public void testFilterCertificates() throws IOException { // Filter only certificates created using CSR. FilterCertificates.filterCertificates(PROJECT_ID, LOCATION, CA_poolId); assertThat(stdOut.toString()).contains(CSR_CERTIFICATE_NAME); @@ -437,7 +434,7 @@ public void ptestFilterCertificates() throws IOException { } @Test - public void qtestRevokeCertificate() throws InterruptedException, ExecutionException, IOException { + public void testRevokeCertificate() throws InterruptedException, ExecutionException, IOException { try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { // Revoke the certificate. @@ -454,7 +451,7 @@ public void qtestRevokeCertificate() throws InterruptedException, ExecutionExcep } @Test - public void rtestCreateSubordinateCertificateAuthority() throws IOException { + public void testCreateSubordinateCertificateAuthority() throws IOException { try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { CertificateAuthority response = @@ -466,7 +463,7 @@ public void rtestCreateSubordinateCertificateAuthority() throws IOException { } @Test - public void stestCreateCertificateWithCSR() throws IOException { + public void testCreateCertificateWithCSR() throws IOException { try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) { Certificate response = @@ -477,7 +474,7 @@ public void stestCreateCertificateWithCSR() throws IOException { } @Test - public void ttestActivateSubordinateCertificateAuthority() + public void testActivateSubordinateCertificateAuthority() throws IOException, ExecutionException, InterruptedException { try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) {