diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItCoherenceTests.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItCoherenceTests.java index 0b70d02ce6b..37a6ba0fb31 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItCoherenceTests.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItCoherenceTests.java @@ -132,7 +132,7 @@ public static void init(@Namespaces(2) List namespaces) { */ @Test @DisplayName("Create domain with a Coherence cluster using WDT and test rolling restart") - public void testCoherenceServerRollingRestart() { + void testCoherenceServerRollingRestart() { final String successMarker = "CACHE-SUCCESS"; // create a DomainHomeInImage image using WebLogic Image Tool diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java index e68bbb90c98..694e6640cc2 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java @@ -118,7 +118,7 @@ @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @DisplayName("Verify the overrideDistributionStrategy applies the overrides accordingly to the value set") @IntegrationTest -public class ItConfigDistributionStrategy { +class ItConfigDistributionStrategy { private static String opNamespace = null; private static String domainNamespace = null; @@ -269,7 +269,7 @@ public void afterEach() { @Order(1) @Test @DisplayName("Test overrideDistributionStrategy set to DEFAULT") - public void testDefaultOverride() { + void testDefaultOverride() { //store the pod creation timestamps storePodCreationTimestamps(); @@ -325,7 +325,7 @@ public void testDefaultOverride() { @Order(2) @Test @DisplayName("Test new overrides are applied as per the files in recreated configmap") - public void testModifiedOverrideContent() { + void testModifiedOverrideContent() { //store the pod creation timestamps storePodCreationTimestamps(); @@ -434,7 +434,7 @@ public void testModifiedOverrideContent() { @Order(3) @Test @DisplayName("Test overrideDistributionStrategy value DYNAMIC") - public void testDynamicOverride() { + void testDynamicOverride() { //patching the domain with /spec/configuration/overrideDistributionStrategy: DYNAMIC String patchStr = "[" @@ -512,7 +512,7 @@ public void testDynamicOverride() { @Order(4) @Test @DisplayName("Test overrideDistributionStrategy value ON_RESTART") - public void testOnRestartOverride() { + void testOnRestartOverride() { //patching the domain with /spec/configuration/overrideDistributionStrategy: ON_RESTART String patchStr = "[" @@ -616,7 +616,7 @@ public void testOnRestartOverride() { @Order(5) @Test @DisplayName("Test invalid overrideDistributionStrategy value RESTART") - public void testOverrideNegative() { + void testOverrideNegative() { //patching the domain with /spec/configuration/overrideDistributionStrategy: RESTART String patchStr = "[" diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItCrossDomainTransaction.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItCrossDomainTransaction.java index 42d64e4be91..c5a577de159 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItCrossDomainTransaction.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItCrossDomainTransaction.java @@ -86,7 +86,7 @@ @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @DisplayName("Verify cross domain transaction is successful") @IntegrationTest -public class ItCrossDomainTransaction { +class ItCrossDomainTransaction { private static final String WDT_MODEL_FILE_DOMAIN1 = "model-crossdomaintransaction-domain1.yaml"; private static final String WDT_MODEL_FILE_DOMAIN2 = "model-crossdomaintransaction-domain2.yaml"; @@ -346,7 +346,7 @@ private static void buildApplicationsAndDomains() { @Order(1) @Test @DisplayName("Check cross domain transaction works") - public void testCrossDomainTransaction() { + void testCrossDomainTransaction() { String curlRequest = String.format("curl -v --show-error --noproxy '*' " + "http://%s:%s/TxForward/TxForward?urls=t3://%s.%s:7001,t3://%s1.%s:8001,t3://%s1.%s:8001,t3://%s2.%s:8001", @@ -381,7 +381,7 @@ public void testCrossDomainTransaction() { @Order(2) @Test @DisplayName("Check cross domain transaction with TMAfterTLogBeforeCommitExit property commits") - public void testCrossDomainTransactionWithFailInjection() { + void testCrossDomainTransactionWithFailInjection() { String curlRequest = String.format("curl -v --show-error --noproxy '*' " + "http://%s:%s/cdttxservlet/cdttxservlet?namespaces=%s,%s", @@ -418,7 +418,7 @@ public void testCrossDomainTransactionWithFailInjection() { @Order(3) @Test @DisplayName("Check cross domain transcated MDB communication ") - public void testCrossDomainTranscatedMDB() { + void testCrossDomainTranscatedMDB() { // No extra header info assertTrue(checkAppIsActive(K8S_NODEPORT_HOST,domain1AdminServiceNodePort, diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItDedicatedMode.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItDedicatedMode.java index 6269c5aff28..f888a88be91 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItDedicatedMode.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItDedicatedMode.java @@ -152,7 +152,7 @@ public void tearDownAll() { @Order(1) @DisplayName("Set domainNamespaceSelectionStrategy to Dedicated for the Operator Helm Chart and " + "verify that a domain not deployed in operator's namespace doesn't come up") - public void testDedicatedModeDiffNamespace() { + void testDedicatedModeDiffNamespace() { // install and verify operator logger.info("Installing and verifying operator"); installAndVerifyOperator(opNamespace, opNamespace + "-sa", @@ -177,7 +177,7 @@ public void testDedicatedModeDiffNamespace() { @Order(2) @DisplayName("Set domainNamespaceSelectionStrategy to Dedicated for the Operator Helm Chart and " + "verify that the domain deployed in the operator's namespace comes up") - public void testDedicatedModeSameNamespace() { + void testDedicatedModeSameNamespace() { // create and verify the domain logger.info("Creating and verifying model in image domain"); createDomain(domain1Namespace); @@ -191,7 +191,7 @@ public void testDedicatedModeSameNamespace() { @Test @Order(3) @DisplayName("Scale up cluster-1 in domain1Namespace and verify it succeeds") - public void testDedicatedModeSameNamespaceScale() { + void testDedicatedModeSameNamespaceScale() { // scale the cluster and check domain can be managed from the operator int externalRestHttpsPort = getServiceNodePort(opNamespace, "external-weblogic-operator-svc"); logger.info("externalRestHttpsPort {0}", externalRestHttpsPort); @@ -213,7 +213,7 @@ public void testDedicatedModeSameNamespaceScale() { @Order(4) @Disabled("Disable the test because the Operator has permission to overwrite the CRD") @DisplayName("Create a CRD with a lower than expected version and verify that Operator fails with error") - public void testDedicatedModeNlowerVersionCrd() { + void testDedicatedModeNlowerVersionCrd() { // delete existing CRD new Command() .withParams(new CommandParams() @@ -251,7 +251,7 @@ public void testDedicatedModeNlowerVersionCrd() { @Order(5) @Disabled("Disable the test because the Operator has permission to create the CRD") @DisplayName("Delete the CRD and verify that Operator fails with error") - public void testDedicatedModeNoCrd() { + void testDedicatedModeNoCrd() { // delete existing CRD logger.info("Delete existing CRD"); new Command() diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItElasticLogging.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItElasticLogging.java index aecdb9d6130..af85e5bde50 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItElasticLogging.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItElasticLogging.java @@ -229,7 +229,7 @@ void tearDown() { */ @Test @DisplayName("Use Elasticsearch Count API to query logs of level=INFO and verify") - public void testLogLevelSearch() { + void testLogLevelSearch() { // Verify that number of logs is not zero and failed count is zero String regex = ".*count\":(\\d+),.*failed\":(\\d+)"; String queryCriteria = "/_count?q=level:INFO"; @@ -245,7 +245,7 @@ public void testLogLevelSearch() { */ @Test @DisplayName("Use Elasticsearch Search APIs to query Operator log info and verify") - public void testOperatorLogSearch() { + void testOperatorLogSearch() { // Verify that log occurrence for Operator are not empty String regex = ".*took\":(\\d+),.*hits\":\\{(.+)\\}"; String queryCriteria = "/_search?q=type:weblogic-operator"; @@ -262,7 +262,7 @@ public void testOperatorLogSearch() { @Disabled("Disabled the test due to JIRA OWLS-83899") @Test @DisplayName("Use Elasticsearch Search APIs to query Operator log info and verify") - public void testWebLogicLogSearch() { + void testWebLogicLogSearch() { // Verify that the admin status of "RUNNING" is found in query return from Elasticsearch repository verifyServerRunningInSearchResults(adminServerPodName); @@ -278,7 +278,7 @@ public void testWebLogicLogSearch() { */ @Test @DisplayName("Use Elasticsearch Search APIs to query WebLogic log info in WLS server pod and verify") - public void testWlsLoggingExporter() throws Exception { + void testWlsLoggingExporter() throws Exception { Map wlsMap = verifyLoggingExporterReady(opNamespace, null, WEBLOGIC_INDEX_KEY); // merge testVarMap and wlsMap testVarMap.putAll(wlsMap); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItElasticLoggingFluentd.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItElasticLoggingFluentd.java index 6d8ef12da22..b7b54d3f74b 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItElasticLoggingFluentd.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItElasticLoggingFluentd.java @@ -228,7 +228,7 @@ void tearDown() { */ @Test @DisplayName("Use Fluentd to send log information to Elasticsearch and verify") - public void testFluentdQuery() { + void testFluentdQuery() { // Verify that number of logs is not zero and failed if count is zero String regex = ".*count\":(\\d+),.*failed\":(\\d+)"; String queryCriteria = "/_count?q=serverName:" + adminServerPodName; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItExternalLbTunneling.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItExternalLbTunneling.java index 86cb8c2e26b..ea02bd8ea4f 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItExternalLbTunneling.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItExternalLbTunneling.java @@ -265,7 +265,7 @@ public void beforeEach() { @Order(1) @Test @DisplayName("Verify RMI access to WLS through Voyager LoadBalancer") - public void testExternalRmiAccessThruVoyager() { + void testExternalRmiAccessThruVoyager() { assumeFalse(WEBLOGIC_SLIM, "Skipping RMI Tunnelling Test for slim image"); // Build the standalone JMS Client to send and receive messages @@ -315,7 +315,7 @@ public void testExternalRmiAccessThruVoyager() { @Order(2) @Test @DisplayName("Verify RMI access to WLS through Traefik LoadBalancer") - public void testExternalRmiAccessThruTraefik() { + void testExternalRmiAccessThruTraefik() { assumeFalse(WEBLOGIC_SLIM, "Skipping RMI Tunnelling Test for slim image"); // Build the standalone JMS Client to send and receive messages @@ -371,7 +371,7 @@ public void testExternalRmiAccessThruTraefik() { @Order(3) @Test @DisplayName("Verify RMI access WLS through NGINX LoadBalancer") - public void testExternalRmiAccessThruNginx() { + void testExternalRmiAccessThruNginx() { assumeFalse(WEBLOGIC_SLIM, "Skipping RMI Tunnelling Test for slim image"); logger.info("Installing Nginx controller using helm"); @@ -435,7 +435,7 @@ public void testExternalRmiAccessThruNginx() { @Order(4) @Test @DisplayName("Verify tls RMI access WLS through Voyager loadBalancer") - public void testExternalRmiAccessThruVoyagerHttpsTunneling() { + void testExternalRmiAccessThruVoyagerHttpsTunneling() { assumeFalse(WEBLOGIC_SLIM, "Skipping RMI Tunnelling Test for slim image"); // Build the standalone JMS Client to send and receive messages buildClient(); @@ -479,7 +479,7 @@ public void testExternalRmiAccessThruVoyagerHttpsTunneling() { @Order(5) @Test @DisplayName("Verify tls RMI access WLS through Traefik loadBalancer") - public void testExternalRmiAccessThruTraefikHttpsTunneling() { + void testExternalRmiAccessThruTraefikHttpsTunneling() { assumeFalse(WEBLOGIC_SLIM, "Skipping RMI Tunnelling Test for slim image"); @@ -530,7 +530,7 @@ public void testExternalRmiAccessThruTraefikHttpsTunneling() { @Order(6) @Test @DisplayName("Verify tls RMI access WLS through NGNIX loadBalancer") - public void testExternalRmiAccessThruNginxHttpsTunneling() { + void testExternalRmiAccessThruNginxHttpsTunneling() { assumeFalse(WEBLOGIC_SLIM, "Skipping RMI Tunnelling Test for slim image"); logger.info("Installing Nginx controller using helm"); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItExternalNodePortService.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItExternalNodePortService.java index 59d0c3625ea..2124490464b 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItExternalNodePortService.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItExternalNodePortService.java @@ -211,7 +211,7 @@ public void beforeEach() { */ @Test @DisplayName("Verify RMI access to WLS through NodePort Service") - public void testExternalRmiAccessThruNodePortService() { + void testExternalRmiAccessThruNodePortService() { assumeFalse(WEBLOGIC_SLIM, "Skipping RMI Tunnelling Test for slim image"); // Build the standalone JMS Client to send and receive messages diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwBigCMMiiDomain.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwBigCMMiiDomain.java index efbbe72fd0d..22b3e24c1a0 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwBigCMMiiDomain.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwBigCMMiiDomain.java @@ -62,7 +62,7 @@ @DisplayName("Test to a create FMW model in image domain " + "with introspect Config Map bigger then 1 Mb and start the domain") @IntegrationTest -public class ItFmwBigCMMiiDomain { +class ItFmwBigCMMiiDomain { private static String dbNamespace = null; private static String opNamespace = null; @@ -150,7 +150,7 @@ RCUSCHEMAPREFIX, dbNamespace, getNextFreePort(), dbUrl), */ @Test @DisplayName("Create FMW Domain model in image with big introspector CM") - public void testFmwBigCMModelInImage() { + void testFmwBigCMModelInImage() { // Create the repo secret to pull the image // this secret is used only for non-kind cluster diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDiiSample.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDiiSample.java index 4ccaf88a1b8..16b31c596c2 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDiiSample.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDiiSample.java @@ -156,7 +156,7 @@ public static void initAll(@Namespaces(3) List namespaces) { @ParameterizedTest @MethodSource("paramProvider") @DisplayName("Test FMW domain in image sample") - public void testFmwDomainInImageSample(String model) { + void testFmwDomainInImageSample(String model) { String domainUid = model.split(":")[1]; String script = model.split(":")[0]; // wlst | wdt way of creating domain diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainInPVUsingWDT.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainInPVUsingWDT.java index 5e547c3fd02..cd42737c73b 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainInPVUsingWDT.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainInPVUsingWDT.java @@ -57,7 +57,7 @@ */ @DisplayName("Test to creat a FMW domain in persistent volume using WDT") @IntegrationTest -public class ItFmwDomainInPVUsingWDT { +class ItFmwDomainInPVUsingWDT { private static ConditionFactory withStandardRetryPolicy; @@ -150,7 +150,7 @@ RCUSCHEMAPREFIX, dbNamespace, getNextFreePort(), dbUrl), */ @Test @DisplayName("Create a FMW domainon on PV using WDT") - public void testFmwDomainOnPVUsingWdt() { + void testFmwDomainOnPVUsingWdt() { final String pvName = domainUid + "-" + domainNamespace + "-pv"; final String pvcName = domainUid + "-" + domainNamespace + "-pvc"; final int t3ChannelPort = getNextFreePort(); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainInPVUsingWLST.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainInPVUsingWLST.java index afc05bc1db4..54ea8dea2d0 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainInPVUsingWLST.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainInPVUsingWLST.java @@ -66,7 +66,7 @@ */ @DisplayName("Verify the WebLogic server pods can run with domain created in persistent volume") @IntegrationTest -public class ItFmwDomainInPVUsingWLST { +class ItFmwDomainInPVUsingWLST { private static String dbNamespace = null; private static String opNamespace = null; @@ -143,7 +143,7 @@ RCUSCHEMAPREFIX, dbNamespace, getNextFreePort(), dbUrl), */ @Test @DisplayName("Create JRF domain in PV using WLST script") - public void testFmwDomainInPvUsingWlst() { + void testFmwDomainInPvUsingWlst() { final String clusterName = "cluster-jrfdomain-inpv"; final String adminServerName = "wlst-admin-server"; final String adminServerPodName = domainUid + "-" + adminServerName; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDynamicClusterMiiDomain.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDynamicClusterMiiDomain.java index 396e455d474..20ee0f68998 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDynamicClusterMiiDomain.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDynamicClusterMiiDomain.java @@ -66,7 +66,7 @@ */ @DisplayName("Test to Create a FMW Dynamic Domain with Dynamic Cluster using model in image") @IntegrationTest -public class ItFmwDynamicClusterMiiDomain { +class ItFmwDynamicClusterMiiDomain { private static String dbNamespace = null; private static String opNamespace = null; @@ -144,7 +144,7 @@ RCUSCHEMAPREFIX, dbNamespace, getNextFreePort(), dbUrl), */ @Test @DisplayName("Create FMW Dynamic Domain with Dynamic Cluster using model in image") - public void testFmwDynamicClusterDomainInModelInImage() { + void testFmwDynamicClusterDomainInModelInImage() { // create FMW dynamic domain and verify createFmwDomainAndVerify(); verifyDomainReady(); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDynamicDomainInPV.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDynamicDomainInPV.java index f358baa72f8..3a4b5e2e494 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDynamicDomainInPV.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDynamicDomainInPV.java @@ -69,7 +69,7 @@ */ @DisplayName("Test to creat a FMW dynamic domain in persistent volume using WLST") @IntegrationTest -public class ItFmwDynamicDomainInPV { +class ItFmwDynamicDomainInPV { private static ConditionFactory withStandardRetryPolicy; @@ -149,7 +149,7 @@ RCUSCHEMAPREFIX, dbNamespace, getNextFreePort(), dbUrl), */ @Test @DisplayName("Create FMW Dynamic Domain in PV") - public void testFmwDynamicDomainInPV() { + void testFmwDynamicDomainInPV() { // create FMW dynamic domain and verify createFmwDomainAndVerify(); verifyDomainReady(); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwMiiDomain.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwMiiDomain.java index ae7540871c3..f7c3aff2712 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwMiiDomain.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwMiiDomain.java @@ -66,7 +66,7 @@ @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @DisplayName("Test to a create FMW model in image domain and start the domain") @IntegrationTest -public class ItFmwMiiDomain { +class ItFmwMiiDomain { private static String dbNamespace = null; private static String opNamespace = null; @@ -156,7 +156,7 @@ RCUSCHEMAPREFIX, dbNamespace, getNextFreePort(), dbUrl), @Order(1) @Test @DisplayName("Create FMW Domain model in image") - public void testFmwModelInImage() { + void testFmwModelInImage() { // Create the repo secret to pull the image // this secret is used only for non-kind cluster createOcirRepoSecret(fmwDomainNamespace); @@ -262,7 +262,7 @@ public void testFmwModelInImage() { @Order(2) @Test @DisplayName("Reuse the same RCU schema to restart JRF domain") - public void testReuseRCUschemaToRestartDomain() { + void testReuseRCUschemaToRestartDomain() { saveAndRestoreOpssWalletfileSecret(fmwDomainNamespace, domainUid, opsswalletfileSecretName); shutdownDomain(); patchDomainWithWalletFileSecret(opsswalletfileSecretName); @@ -279,7 +279,7 @@ public void testReuseRCUschemaToRestartDomain() { @Order(3) @Test @DisplayName("Update RCU schema password") - public void testUpdateRcuSchemaPassword() { + void testUpdateRcuSchemaPassword() { shutdownDomain(); logger.info("Updating RCU schema password with dbNamespace: {0}, RCU prefix: {1}, new schemapassword: {2}", dbNamespace, RCUSCHEMAPREFIX, RCUSCHEMAPASSWORDNEW); @@ -307,7 +307,7 @@ public void testUpdateRcuSchemaPassword() { @Order(4) @Test @DisplayName("Update WebLogic Credentials after updating RCU schema password") - public void testUpdateWebLogicCredentialAfterUpdateRcuSchemaPassword() { + void testUpdateWebLogicCredentialAfterUpdateRcuSchemaPassword() { verifyUpdateWebLogicCredential(fmwDomainNamespace, domainUid, adminServerPodName, managedServerPrefix, replicaCount, "-c1"); } diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwSample.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwSample.java index e2f29440c29..72ee20d6e43 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwSample.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwSample.java @@ -155,7 +155,7 @@ public static void initAll(@Namespaces(3) List namespaces) { @ParameterizedTest @MethodSource("paramProvider") @DisplayName("Test FMW domain on PV sample") - public void testFmwDomainInPv(String model) { + void testFmwDomainInPv(String model) { String domainUid = model.split(":")[1]; String script = model.split(":")[0]; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItInitContainers.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItInitContainers.java index d284a326778..809fbeb6626 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItInitContainers.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItInitContainers.java @@ -177,7 +177,7 @@ private static void createSecrets(String domainNamespace) { @Test @DisplayName("Add initContainers at domain spec level and verify the server pods execute initContainer command " + " and starts the server pod") - public void testDomainInitContainer() { + void testDomainInitContainer() { logger.info("Installing and verifying domain"); assertTrue(createVerifyDomain(domain1Namespace, domain1Uid, "spec"), "can't start or verify domain in namespace " + domain1Namespace); @@ -244,7 +244,7 @@ private boolean checkPodLogContainMsg(String podName, String podNamespace, Strin */ @Test @DisplayName("Add initContainers to adminServer and verify the admin server pod executes initContainer command ") - public void testAdminServerInitContainer() { + void testAdminServerInitContainer() { assertTrue(createVerifyDomain(domain2Namespace, domain2Uid, "adminServer"), "can't start or verify domain in namespace " + domain2Namespace); @@ -262,7 +262,7 @@ public void testAdminServerInitContainer() { */ @Test @DisplayName("Add initContainers to cluster1 and verify all managed server pods go through Init state ") - public void testClusterInitContainer() { + void testClusterInitContainer() { assertTrue(createVerifyDomain(domain3Namespace, domain3Uid, "clusters"), "can't start or verify domain in namespace " + domain3Namespace); @@ -283,7 +283,7 @@ public void testClusterInitContainer() { */ @Test @DisplayName("Add initContainers to managed-server1 and verify the pod goes through Init state ") - public void testMsInitContainer() { + void testMsInitContainer() { assertTrue(createVerifyDomain(domain4Namespace, domain4Uid, "managedServers"), "can't start or verify domain in namespace " + domain4Namespace); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIntrospectVersion.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIntrospectVersion.java index 8337148d424..6057e838f19 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIntrospectVersion.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIntrospectVersion.java @@ -150,7 +150,7 @@ @DisplayName("Verify the introspectVersion runs the introspector") @IntegrationTest @Tag("okdenv") -public class ItIntrospectVersion { +class ItIntrospectVersion { private static String opNamespace = null; private static String introDomainNamespace = null; @@ -240,7 +240,7 @@ public static void initAll(@Namespaces(3) List namespaces) { @Order(1) @Test @DisplayName("Test introSpectVersion starting a introspector and updating domain status") - public void testDomainIntrospectVersionNotRolling() { + void testDomainIntrospectVersionNotRolling() { final String clusterName = "mycluster"; @@ -576,7 +576,7 @@ public void conditionEvaluated(EvaluatedCondition condition) { @Order(2) @Test @DisplayName("Test introspectVersion rolling server pods when admin server port is changed") - public void testDomainIntrospectVersionRolling() { + void testDomainIntrospectVersionRolling() { final String clusterName = "mycluster"; @@ -735,7 +735,7 @@ public void testDomainIntrospectVersionRolling() { @Order(3) @Test @DisplayName("Test change WebLogic admin credentials for domain running in persistent volume") - public void testCredentialChange() { + void testCredentialChange() { final String adminServerName = "admin-server"; final String adminServerPodName = domainUid + "-" + adminServerName; @@ -884,7 +884,7 @@ introDomainNamespace, getExternalServicePodName(adminServerPodName), "default"), @Order(4) @Test @DisplayName("Test new cluster creation on demand using WLST and introspection") - public void testCreateNewCluster() { + void testCreateNewCluster() { final String clusterName = "cl2"; @@ -978,7 +978,7 @@ public void testCreateNewCluster() { @AssumeWebLogicImage @Test @DisplayName("Verify server pods are restarted by updating image name") - public void testUpdateImageName() { + void testUpdateImageName() { final String domainNamespace = introDomainNamespace; final String adminServerName = "admin-server"; @@ -1063,7 +1063,7 @@ public void testUpdateImageName() { @Test @Order(6) @DisplayName("Scale up cluster-1 in domain1Namespace and verify label weblogic.introspectVersion set") - public void testDedicatedModeSameNamespaceScale() { + void testDedicatedModeSameNamespaceScale() { final String adminServerName = "admin-server"; final String managedServerNameBase = "managed-server"; final String adminServerPodName = domainUid + "-" + adminServerName; @@ -1108,7 +1108,7 @@ public void testDedicatedModeSameNamespaceScale() { @Test @Order(7) @DisplayName("Test to use sample scripts to explicitly initiate introspection") - public void tesIntrospectDomainScript() { + void testIntrospectDomainScript() { final String adminServerName = "admin-server"; final String adminServerPodName = domainUid + "-" + adminServerName; final String managedServerNameBase = "managed-server"; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCoherenceTests.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCoherenceTests.java index 5cf40a0be5c..81151d170f2 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCoherenceTests.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCoherenceTests.java @@ -140,7 +140,7 @@ public static void init(@Namespaces(2) List namespaces) { */ @Test @DisplayName("Create domain with a Coherence cluster using WDT and test rolling restart") - public void testIstioCoherenceServerRollingRestart() { + void testIstioCoherenceServerRollingRestart() { final String successMarker = "CACHE-SUCCESS"; // create a DomainHomeInImage image using WebLogic Image Tool diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossClusters.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossClusters.java index e4772604b19..ded6e7b7908 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossClusters.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossClusters.java @@ -85,7 +85,7 @@ @DisplayName("Verify cross Kubernetes Cluster domain transaction is successful") @IntegrationTest @DisabledIfEnvironmentVariable(named = "TWO_CLUSTERS", matches = "false") -public class ItIstioCrossClusters { +class ItIstioCrossClusters { private static final String WDT_MODEL_FILE_DOMAIN2 = "model-crossdomaintransaction-domain2.yaml"; @@ -269,7 +269,7 @@ private static void addToPropertyFile(String propFileName, String domainNamespac */ @Test @DisplayName("Check cross clusters domain transaction works") - public void testCrossDomainTransaction() { + void testCrossDomainTransaction() { createDomainAndApps(); String curlRequest = String.format("curl -v --show-error --noproxy '*' " + "-H 'host:domain1-" + domain1Namespace + ".org' " @@ -307,7 +307,7 @@ public void testCrossDomainTransaction() { */ @Test @DisplayName("Check cross domain transaction with TMAfterTLogBeforeCommitExit property commits") - public void testCrossDomainTransactionWithFailInjection() { + void testCrossDomainTransactionWithFailInjection() { logger.info("Getting admin server external service node port"); String curlRequest = String.format("curl -v --show-error --noproxy '*' " + "-H 'host:domain1-" + domain1Namespace + ".org' " diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossClustersSetup.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossClustersSetup.java index 8eb639bf2f5..deac8c86669 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossClustersSetup.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossClustersSetup.java @@ -80,7 +80,7 @@ @DisplayName("Setup operator, domain, applications for cross cluster domain transaction.") @IntegrationTest @DisabledIfEnvironmentVariable(named = "TWO_CLUSTERS", matches = "false") -public class ItIstioCrossClustersSetup { +class ItIstioCrossClustersSetup { private static final String WDT_MODEL_FILE_DOMAIN1 = "model-crossdomaintransaction-domain1.yaml"; private static final String WDT_MODEL_DOMAIN1_PROPS = "model-crossdomaintransaction-domain1.properties"; @@ -133,7 +133,7 @@ public static void initAll() { @Test @DisplayName("Build applications and create operator and domain in cluster1") - public void testInitCluster1() { + void testInitCluster1() { logger.info("Creating namespace for Operator in cluster1"); assertDoesNotThrow(() -> Kubernetes.createNamespace(op1Namespace), "Failed to create namespace for operator in cluster1"); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossDomainTransaction.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossDomainTransaction.java index 170d2c30451..1f973b9767c 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossDomainTransaction.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioCrossDomainTransaction.java @@ -89,7 +89,7 @@ @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @DisplayName("Verify cross domain transaction with istio enabled is successful") @IntegrationTest -public class ItIstioCrossDomainTransaction { +class ItIstioCrossDomainTransaction { private static final String WDT_MODEL_FILE_DOMAIN1 = "model-crossdomaintransaction-domain1.yaml"; private static final String WDT_MODEL_FILE_DOMAIN2 = "model-crossdomaintransaction-domain2.yaml"; @@ -380,7 +380,7 @@ private static void buildApplicationsAndDomains() { @Order(1) @Test @DisplayName("Check cross domain transaction with istio works") - public void testIstioCrossDomainTransaction() { + void testIstioCrossDomainTransaction() { String curlRequest = String.format("curl -v --show-error --noproxy '*' " + "-H 'host:domain1-" + domain1Namespace + ".org' " @@ -418,7 +418,7 @@ public void testIstioCrossDomainTransaction() { @Order(2) @Test @DisplayName("Check cross domain transaction with istio and with TMAfterTLogBeforeCommitExit property commits") - public void testIstioCrossDomainTransactionWithFailInjection() { + void testIstioCrossDomainTransactionWithFailInjection() { String curlRequest = String.format("curl -v --show-error --noproxy '*' " + "-H 'host:domain1-" + domain1Namespace + ".org' " @@ -456,7 +456,7 @@ public void testIstioCrossDomainTransactionWithFailInjection() { @Order(3) @Test @DisplayName("Check cross domain transcated MDB communication with istio") - public void testIstioCrossDomainTranscatedMDB() { + void testIstioCrossDomainTranscatedMDB() { assertTrue(checkAppIsActive(K8S_NODEPORT_HOST,istioIngressPort, "-H 'host: " + "domain1-" + domain1Namespace + ".org '", "mdbtopic","cluster-1", diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioDomainInImage.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioDomainInImage.java index 08107797e7e..cfe1604afa1 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioDomainInImage.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioDomainInImage.java @@ -126,7 +126,7 @@ public static void initAll(@Namespaces(2) List namespaces) { */ @Test @DisplayName("Create WebLogic domainhome-in-image with istio") - public void testIstioDomainHomeInImage() { + void testIstioDomainHomeInImage() { final String managedServerPrefix = domainUid + "-managed-server"; final int replicaCount = 2; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioDomainInPV.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioDomainInPV.java index 40e792d4ee5..808fdd038a1 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioDomainInPV.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioDomainInPV.java @@ -82,7 +82,7 @@ */ @DisplayName("Verify istio enabled WebLogic domain in domainhome-on-pv model") @IntegrationTest -public class ItIstioDomainInPV { +class ItIstioDomainInPV { private static String opNamespace = null; private static String domainNamespace = null; @@ -142,7 +142,7 @@ public static void initAll(@Namespaces(2) List namespaces) { */ @Test @DisplayName("Create WebLogic domain in PV with Istio") - public void testIstioDomainHomeInPv() { + void testIstioDomainHomeInPv() { final String managedServerNameBase = "wlst-ms-"; String managedServerPodNamePrefix = domainUid + "-" + managedServerNameBase; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioManagedCoherence.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioManagedCoherence.java index e960f26e0cd..3540616fcf9 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioManagedCoherence.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioManagedCoherence.java @@ -156,7 +156,7 @@ public static void init(@Namespaces(2) List namespaces) { */ @Test @DisplayName("Two cluster domain with a Coherence cluster with ISTIO and test interaction with cache data") - public void testIstioMultiClusterCoherenceDomain() { + void testIstioMultiClusterCoherenceDomain() { // create a DomainHomeInImage image using WebLogic Image Tool String domImage = createAndVerifyDomainImage(); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioMiiDomain.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioMiiDomain.java index 4c4a72dac76..309acb74dc0 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioMiiDomain.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioMiiDomain.java @@ -144,7 +144,7 @@ public static void initAll(@Namespaces(2) List namespaces) { @Test @Order(1) @DisplayName("Create WebLogic Domain with mii model with istio") - public void testIstioModelInImage() { + void testIstioModelInImage() { // Create the repo secret to pull the image // this secret is used only for non-kind cluster @@ -277,7 +277,7 @@ public void testIstioModelInImage() { @Test @Order(2) @DisplayName("Add a work manager to a model-in-image domain using dynamic update") - public void testMiiIstioDynamicUpdate() { + void testMiiIstioDynamicUpdate() { LinkedHashMap pods = new LinkedHashMap<>(); // get the creation time of the admin server pod before patching OffsetDateTime adminPodCreationTime = getPodCreationTime(domainNamespace, adminServerPodName); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioMonitoringExporter.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioMonitoringExporter.java index e3cd9e2a35f..a4227029933 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioMonitoringExporter.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioMonitoringExporter.java @@ -139,7 +139,7 @@ public static void initAll(@Namespaces(3) List namespaces) { @Test @DisplayName("Create istio provided prometheus and verify " + "it can monitor Weblogic domain via weblogic exporter webapp") - public void testIstioPrometheusViaExporterWebApp() { + void testIstioPrometheusViaExporterWebApp() { assertDoesNotThrow(() -> downloadMonitoringExporterApp(RESOURCE_DIR + "/exporter/exporter-config.yaml", RESULTS_ROOT), "Failed to download monitoring exporter application"); String miiImage = createAndVerifyMiiImageWithMonitoringExporter(RESULTS_ROOT + "/wls-exporter.war", @@ -164,7 +164,7 @@ public void testIstioPrometheusViaExporterWebApp() { @Test @DisplayName("Create istio provided prometheus and verify " + "it can monitor Weblogic domain via weblogic exporter sidecar") - public void testIstioPrometheusWithSideCar() { + void testIstioPrometheusWithSideCar() { // create image with model files logger.info("Create image with model file and verify"); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioTwoDomainsInImage.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioTwoDomainsInImage.java index 9844bc262e7..26ab9436a52 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioTwoDomainsInImage.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioTwoDomainsInImage.java @@ -141,7 +141,7 @@ public static void initAll(@Namespaces(3) List namespaces) { */ @Test @DisplayName("Two WebLogic domainhome-in-image with single istio ingress") - public void testIstioTwoDomainsWithSingleIngress() { + void testIstioTwoDomainsWithSingleIngress() { final String managedServerPrefix1 = domainUid1 + "-managed-server"; final String managedServerPrefix2 = domainUid2 + "-managed-server"; final int replicaCount = 2; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItKubernetesEvents.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItKubernetesEvents.java index 2501cc92a6c..88ec0dc9c07 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItKubernetesEvents.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItKubernetesEvents.java @@ -129,7 +129,7 @@ @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @DisplayName("Verify the Kubernetes events for domain lifecycle") @IntegrationTest -public class ItKubernetesEvents { +class ItKubernetesEvents { private static String opNamespace = null; private static String domainNamespace1 = null; @@ -209,7 +209,7 @@ public static void initAll(@Namespaces(6) List namespaces) { @Order(1) @Test @DisplayName("Test domain events for various successful domain life cycle changes") - public void testDomainK8SEventsSuccess() { + void testDomainK8SEventsSuccess() { OffsetDateTime timestamp = now(); logger.info("Creating domain"); createDomain(); @@ -228,7 +228,7 @@ public void testDomainK8SEventsSuccess() { @Order(2) @Test @DisplayName("Test domain DomainValidationError event for non-existing managed server") - public void testDomainK8sEventsNonExistingManagedServer() { + void testDomainK8sEventsNonExistingManagedServer() { OffsetDateTime timestamp = now(); logger.info("patch the domain resource with non-existing managed server"); String patchStr @@ -267,7 +267,7 @@ public void testDomainK8sEventsNonExistingManagedServer() { @Order(3) @Test @DisplayName("Test domain DomainValidationError event for non-existing cluster") - public void testDomainK8sEventsNonExistingCluster() { + void testDomainK8sEventsNonExistingCluster() { OffsetDateTime timestamp = now(); logger.info("patch the domain resource with new cluster"); String patchStr @@ -306,7 +306,7 @@ public void testDomainK8sEventsNonExistingCluster() { @Order(4) @Test @DisplayName("Test domain events for failed/retried domain life cycle changes") - public void testDomainK8SEventsFailed() { + void testDomainK8SEventsFailed() { V1Patch patch; String patchStr; @@ -355,7 +355,7 @@ public void testDomainK8SEventsFailed() { */ @Order(5) @Test - public void testK8SEventsMultiClusterEvents() { + void testK8SEventsMultiClusterEvents() { createNewCluster(); OffsetDateTime timestamp = now(); scaleClusterWithRestApi(domainUid, cluster2Name, 1, @@ -374,7 +374,7 @@ public void testK8SEventsMultiClusterEvents() { */ @Order(6) @Test - public void testDomainK8sEventsScalePastMax() { + void testDomainK8sEventsScalePastMax() { OffsetDateTime timestamp = now(); try { logger.info("Scaling cluster using patching"); @@ -410,7 +410,7 @@ public void testDomainK8sEventsScalePastMax() { @Order(7) @Test @DisplayName("Test domain completed event when domain is scaled.") - public void testScaleDomainAndVerifyCompletedEvent() { + void testScaleDomainAndVerifyCompletedEvent() { try { scaleDomainAndVerifyCompletedEvent(1, "scale down", true); scaleDomainAndVerifyCompletedEvent(2, "scale up", true); @@ -425,7 +425,7 @@ public void testScaleDomainAndVerifyCompletedEvent() { */ @Order(8) @Test - public void testDomainK8sEventsScaleBelowMin() { + void testDomainK8sEventsScaleBelowMin() { OffsetDateTime timestamp = now(); try { String patchStr @@ -460,7 +460,7 @@ public void testDomainK8sEventsScaleBelowMin() { */ @Order(9) @Test - public void testDomainK8sEventsProcessingFailed() { + void testDomainK8sEventsProcessingFailed() { OffsetDateTime timestamp = now(); try { createPV("sample-pv", domainUid, this.getClass().getSimpleName()); @@ -509,7 +509,7 @@ public void testDomainK8sEventsProcessingFailed() { @Order(10) @Test @DisplayName("Verify logHome property change rolls domain and relevant events are logged") - public void testLogHomeChangeEvents() { + void testLogHomeChangeEvents() { OffsetDateTime timestamp = now(); @@ -584,7 +584,7 @@ public void testLogHomeChangeEvents() { @Order(11) @Test @DisplayName("Verify includeServerOutInPodLog property change rolls domain and relevant events are logged") - public void testIncludeServerOutInPodLog() { + void testIncludeServerOutInPodLog() { OffsetDateTime timestamp = now(); @@ -660,7 +660,7 @@ public void testIncludeServerOutInPodLog() { @Order(13) @Test @DisplayName("Test domain events for various domain life cycle changes") - public void testDomainK8SEventsDelete() { + void testDomainK8SEventsDelete() { OffsetDateTime timestamp = now(); deleteDomainCustomResource(domainUid, domainNamespace1); @@ -693,7 +693,7 @@ public void testDomainK8SEventsDelete() { @Order(14) @ParameterizedTest @ValueSource(booleans = { true, false }) - public void testK8SEventsStartStopWatchingNS(boolean enableClusterRoleBinding) { + void testK8SEventsStartStopWatchingNS(boolean enableClusterRoleBinding) { logger.info("testing testK8SEventsStartStopWatchingNS with enableClusterRoleBinding={0}", enableClusterRoleBinding); OffsetDateTime timestamp = now(); @@ -744,7 +744,7 @@ public void testK8SEventsStartStopWatchingNS(boolean enableClusterRoleBinding) { @Order(15) @ParameterizedTest @ValueSource(booleans = { true, false }) - public void testK8SEventsStartStopWatchingNSWithLabelSelector(boolean enableClusterRoleBinding) { + void testK8SEventsStartStopWatchingNSWithLabelSelector(boolean enableClusterRoleBinding) { logger.info("testing testK8SEventsStartStopWatchingNSWithLabelSelector with enableClusterRoleBinding={0}", enableClusterRoleBinding); OffsetDateTime timestamp = now(); @@ -810,7 +810,7 @@ public void testK8SEventsStartStopWatchingNSWithLabelSelector(boolean enableClus @Order(16) @ParameterizedTest @ValueSource(booleans = { true, false }) - public void testK8SEventsStartStopWatchingNSWithRegExp(boolean enableClusterRoleBinding) { + void testK8SEventsStartStopWatchingNSWithRegExp(boolean enableClusterRoleBinding) { OffsetDateTime timestamp = now(); logger.info("Adding a new domain namespace {0} in the operator watch list", domainNamespace5); // Helm upgrade parameters @@ -859,7 +859,7 @@ public void testK8SEventsStartStopWatchingNSWithRegExp(boolean enableClusterRole */ @Order(17) @Test - public void testK8SEventsStartStopWatchingNSWithDedicated() { + void testK8SEventsStartStopWatchingNSWithDedicated() { OffsetDateTime timestamp = now(); // Helm upgrade parameters diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItLiftAndShiftFromOnPremDomain.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItLiftAndShiftFromOnPremDomain.java index 77350360dc8..ed7410095af 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItLiftAndShiftFromOnPremDomain.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItLiftAndShiftFromOnPremDomain.java @@ -86,7 +86,7 @@ @DisplayName("Test to validate on-prem to k8s use case") @IntegrationTest @Tag("okdenv") -public class ItLiftAndShiftFromOnPremDomain { +class ItLiftAndShiftFromOnPremDomain { private static String opNamespace = null; private static String traefikNamespace = null; private static String domainNamespace = null; @@ -164,7 +164,7 @@ public static void initAll(@Namespaces(3) List namespaces) { */ @Test @DisplayName("Create model in image domain and verify external admin services") - public void testCreateMiiDomainWithClusterFromOnPremDomain() { + void testCreateMiiDomainWithClusterFromOnPremDomain() { // admin/managed server name here should match with model yaml in MII_BASIC_WDT_MODEL_FILE final String adminServerPodName = domainUid + "-admin-server"; final String managedServerPrefix = domainUid + "-managed-server"; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItLivenessProbeCustomization.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItLivenessProbeCustomization.java index 93414f2228a..b7eb8ec6527 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItLivenessProbeCustomization.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItLivenessProbeCustomization.java @@ -72,7 +72,7 @@ @DisplayName("Verify liveness probe customization") @IntegrationTest @Tag("okdenv") -public class ItLivenessProbeCustomization { +class ItLivenessProbeCustomization { private static String domainNamespace = null; @@ -136,7 +136,7 @@ public static void initAll(@Namespaces(2) List namespaces) { @Test @Order(1) @DisplayName("Test customization of the liveness probe") - public void testCustomLivenessProbe() { + void testCustomLivenessProbe() { Domain domain1 = assertDoesNotThrow(() -> getDomainCustomResource(domainUid, domainNamespace), String.format("getDomainCustomResource failed with ApiException when tried to get domain %s in namespace %s", domainUid, domainNamespace)); @@ -208,7 +208,7 @@ public void testCustomLivenessProbe() { @Test @Order(2) @DisplayName("Test custom liveness probe is not trigged") - public void testCustomLivenessProbeNotTrigged() { + void testCustomLivenessProbeNotTrigged() { Domain domain1 = assertDoesNotThrow(() -> getDomainCustomResource(domainUid, domainNamespace), String.format("getDomainCustomResource failed with ApiException when tried to get domain %s in namespace %s", domainUid, domainNamespace)); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItManageNameSpace.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItManageNameSpace.java index 8f335da2135..dfbfbc77542 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItManageNameSpace.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItManageNameSpace.java @@ -189,7 +189,7 @@ public void tearDownAll() { @Order(1) @DisplayName("install operator helm chart and domain, " + " using expression namespace management") - public void testNameSpaceManageByRegularExpression() { + void testNameSpaceManageByRegularExpression() { //create domain namespace String manageByExp1NS = "test-" + domainNamespaces[0]; String manageByExp2NS = "test-" + domainNamespaces[1]; @@ -267,7 +267,7 @@ public void testNameSpaceManageByRegularExpression() { @Order(2) @DisplayName("install operator helm chart and domain, " + " using label namespace management") - public void testNameSpaceManagedByLabelSelector() { + void testNameSpaceManagedByLabelSelector() { Map managedByLabelDomains = new HashMap<>(); managedByLabelDomains.put(domainNamespaces[0], domainsUid[0]); Map unmanagedByLabelDomains = new HashMap<>(); @@ -337,7 +337,7 @@ public void testNameSpaceManagedByLabelSelector() { @Order(3) @DisplayName("install operator helm chart and domain, " + " with enableClusterRoleBinding") - public void testNameSpaceWithOperatorRbacFalse() { + void testNameSpaceWithOperatorRbacFalse() { String manageByLabelDomainNS = domainNamespaces[0] + "test4"; String manageByLabelDomainUid = domainsUid[0] + "test4"; assertDoesNotThrow(() -> createNamespace(manageByLabelDomainNS)); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItManagedCoherence.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItManagedCoherence.java index c8332ff6ce4..e0e6826c3aa 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItManagedCoherence.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItManagedCoherence.java @@ -161,7 +161,7 @@ public static void init(@Namespaces(3) List namespaces) { */ @Test @DisplayName("Two cluster domain with a Coherence cluster and test interaction with cache data") - public void testMultiClusterCoherenceDomain() { + void testMultiClusterCoherenceDomain() { String ingressName = domainUid + "-ingress-host-routing"; String ingressServiceName = VOYAGER_CHART_NAME + "-" + ingressName; String channelName = "tcp-80"; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiAuxiliaryImage.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiAuxiliaryImage.java index efa0570e2b0..f13a7a30704 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiAuxiliaryImage.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiAuxiliaryImage.java @@ -101,7 +101,7 @@ @DisplayName("Test to create model in image domain using auxiliary image") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @IntegrationTest -public class ItMiiAuxiliaryImage { +class ItMiiAuxiliaryImage { private static String opNamespace = null; private static String domainNamespace = null; @@ -169,7 +169,7 @@ public static void initAll(@Namespaces(4) List namespaces) { @Test @Order(1) @DisplayName("Test to create domain using multiple auxiliary images") - public void testCreateDomainUsingMultipleAuxiliaryImages() { + void testCreateDomainUsingMultipleAuxiliaryImages() { // admin/managed server name here should match with model yaml final String auxiliaryImageVolumeName = "auxiliaryImageVolume1"; @@ -307,7 +307,7 @@ public void testCreateDomainUsingMultipleAuxiliaryImages() { @Test @Order(2) @DisplayName("Test to update data source url in the domain using auxiliary image") - public void testUpdateDataSourceInDomainUsingAuxiliaryImage() { + void testUpdateDataSourceInDomainUsingAuxiliaryImage() { Path multipleAIPath1 = Paths.get(RESULTS_ROOT, "multipleauxiliaryimage1"); Path modelsPath1 = Paths.get(multipleAIPath1.toString(), "models"); @@ -355,7 +355,7 @@ public void testUpdateDataSourceInDomainUsingAuxiliaryImage() { @Test @Order(3) @DisplayName("Test to update Base Weblogic Image Name") - public void testUpdateBaseImageName() { + void testUpdateBaseImageName() { // get the original domain resource before update Domain domain1 = assertDoesNotThrow(() -> getDomainCustomResource(domainUid, domainNamespace), String.format("getDomainCustomResource failed with ApiException when tried to get domain %s in namespace %s", @@ -424,7 +424,7 @@ public void testUpdateBaseImageName() { @Test @Order(3) @DisplayName("Negative Test to create domain with mismatch mount path in auxiliary image and auxiliaryImageVolumes") - public void testErrorPathDomainMismatchMountPath() { + void testErrorPathDomainMismatchMountPath() { OffsetDateTime timestamp = now(); @@ -507,7 +507,7 @@ public void testErrorPathDomainMismatchMountPath() { @Test @Order(4) @DisplayName("Negative Test to create domain without WDT binary") - public void testErrorPathDomainMissingWDTBinary() { + void testErrorPathDomainMissingWDTBinary() { OffsetDateTime timestamp = now(); @@ -592,7 +592,7 @@ public void testErrorPathDomainMissingWDTBinary() { @Test @Order(5) @DisplayName("Negative Test to create domain without domain model file, only having sparse JMS config") - public void testErrorPathDomainMissingDomainConfig() { + void testErrorPathDomainMissingDomainConfig() { OffsetDateTime timestamp = now(); @@ -683,7 +683,7 @@ public void testErrorPathDomainMissingDomainConfig() { @Test @Order(6) @DisplayName("Negative Test to patch domain using a custom mount command that's guaranteed to fail") - public void testErrorPathDomainWithFailCustomMountCommand() { + void testErrorPathDomainWithFailCustomMountCommand() { OffsetDateTime timestamp = now(); @@ -774,7 +774,7 @@ public void testErrorPathDomainWithFailCustomMountCommand() { @Test @Order(7) @DisplayName("Negative Test to create domain with file in auxiliary image not accessible by oracle user") - public void testErrorPathFilePermission() { + void testErrorPathFilePermission() { OffsetDateTime timestamp = now(); @@ -881,7 +881,7 @@ public void testErrorPathFilePermission() { @Test @Order(8) @DisplayName("Test to update WDT version using auxiliary images") - public void testUpdateWDTVersionUsingMultipleAuxiliaryImages() { + void testUpdateWDTVersionUsingMultipleAuxiliaryImages() { // admin/managed server name here should match with model yaml final String auxiliaryImageVolumeName = "auxiliaryImageVolume1"; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiAuxiliaryImageCluster.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiAuxiliaryImageCluster.java index 1abb9eab7f2..df2d27c3326 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiAuxiliaryImageCluster.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiAuxiliaryImageCluster.java @@ -62,7 +62,7 @@ @DisplayName("Test to create model in image domain using auxiliary image containing the cluster configuration") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @IntegrationTest -public class ItMiiAuxiliaryImageCluster { +class ItMiiAuxiliaryImageCluster { private static String opNamespace = null; private static String domainNamespace = null; @@ -113,7 +113,7 @@ public static void initAll(@Namespaces(2) List namespaces) { @Test @Order(1) @DisplayName("Test to create domain using multiple auxiliary images containing the doamin and cluster configuration") - public void testCreateDomainUsingAuxiliaryImagesWClusterConfig() { + void testCreateDomainUsingAuxiliaryImagesWClusterConfig() { final List auxiliaryImageDomainScopeNames = List.of(miiAuxiliaryImagePrefix + "1"); final List auxiliaryImageClusterScopeNames = List.of(miiAuxiliaryImagePrefix + "2", miiAuxiliaryImagePrefix + "3"); @@ -214,7 +214,7 @@ public void testCreateDomainUsingAuxiliaryImagesWClusterConfig() { @Test @Order(2) @DisplayName("Patch a domain using auxiliary image to add a new cluster configuration") - public void testPatchDomainToAddClusterConfigUsingAuxiliaryImage() { + void testPatchDomainToAddClusterConfigUsingAuxiliaryImage() { final int addAuxImageLoc = 2; final String miiAuxiliaryImage = miiAuxiliaryImagePrefix + auxiliaryImageNumberIndex; auxiliaryImageNumberIndex += 1; @@ -263,7 +263,7 @@ public void testPatchDomainToAddClusterConfigUsingAuxiliaryImage() { @Test @Order(3) @DisplayName("Patch a domain using auxiliary image to replace an existing cluster configuration") - public void testPatchDomainToReplaceClusterConfigUsingAuxiliaryImage() { + void testPatchDomainToReplaceClusterConfigUsingAuxiliaryImage() { final int replaceAuxImageLoc = 2; final String miiAuxiliaryImage = miiAuxiliaryImagePrefix + auxiliaryImageNumberIndex; auxiliaryImageNumberIndex += 1; @@ -313,7 +313,7 @@ public void testPatchDomainToReplaceClusterConfigUsingAuxiliaryImage() { @Test @Order(4) @DisplayName("Verify that model files in an auxiliary images at the cluster scope are ignored") - public void testPatchDomainToAddModelsToClusterConfigIgnored() { + void testPatchDomainToAddModelsToClusterConfigIgnored() { final int addAuxImageLoc = 3; final String miiAuxiliaryImage = miiAuxiliaryImagePrefix + auxiliaryImageNumberIndex; auxiliaryImageNumberIndex += 1; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiCustomSslStore.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiCustomSslStore.java index 50e9ad53184..55f2434e58e 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiCustomSslStore.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiCustomSslStore.java @@ -189,7 +189,7 @@ public static void initAll(@Namespaces(2) List namespaces) { @Test @Order(1) @DisplayName("Verify JNDI Context can be accessed using t3s cluster URL") - public void testMiiGetCustomSSLContext() { + void testMiiGetCustomSSLContext() { // build the standalone Client on Admin pod after rolling restart String destLocation = "/u01/SslTestClient.java"; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDomain.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDomain.java index 9779104a25c..63e8c1436e8 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDomain.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDomain.java @@ -166,7 +166,7 @@ public static void initAll(@Namespaces(3) List namespaces) { @Test @Order(1) @DisplayName("Create model in image domain and verify external admin services") - public void testCreateMiiDomain() { + void testCreateMiiDomain() { // admin/managed server name here should match with model yaml in MII_BASIC_WDT_MODEL_FILE final String adminServerPodName = domainUid + "-admin-server"; final String managedServerPrefix = domainUid + "-managed-server"; @@ -270,7 +270,7 @@ public void testCreateMiiDomain() { @Test @Order(2) @DisplayName("Create a second domain with the image from the the first test") - public void testCreateMiiSecondDomainDiffNSSameImage() { + void testCreateMiiSecondDomainDiffNSSameImage() { // admin/managed server name here should match with model yaml in MII_BASIC_WDT_MODEL_FILE final String adminServerPodName = domainUid1 + "-admin-server"; final String managedServerPrefix = domainUid1 + "-managed-server"; @@ -323,7 +323,7 @@ public void testCreateMiiSecondDomainDiffNSSameImage() { @Test @Order(3) @DisplayName("Update the sample-app application to version 2") - public void testPatchAppV2() { + void testPatchAppV2() { // application in the new image contains what is in the original application directory sample-app, // plus the replacements or/and additions in the second application directory sample-app-2. @@ -426,7 +426,7 @@ public void testPatchAppV2() { @Test @Order(4) @DisplayName("Update the domain with another application") - public void testAddSecondApp() { + void testAddSecondApp() { // the existing application is the combination of what are in appDir1 and appDir2 as in test case number 4, // the second application is in appDir3. @@ -503,7 +503,7 @@ public void testAddSecondApp() { @Test @Order(5) @DisplayName("Check admin service annotations and labels") - public void testAdminServiceAnnotationsLabels() { + void testAdminServiceAnnotationsLabels() { Domain domain1 = assertDoesNotThrow(() -> getDomainCustomResource(domainUid, domainNamespace), String.format("getDomainCustomResource failed with ApiException when tried to get domain %s in namespace %s", domainUid, domainNamespace)); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDomainModelInPV.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDomainModelInPV.java index bdc19a18dbb..e0eea47d781 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDomainModelInPV.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDomainModelInPV.java @@ -246,7 +246,7 @@ public static void initAll(@Namespaces(2) List namespaces) { @ParameterizedTest @MethodSource("paramProvider") @DisplayName("Create MII domain with model and application file from PV and custon wdtModelHome") - public void testMiiDomainWithModelAndApplicationInPV(Entry params) { + void testMiiDomainWithModelAndApplicationInPV(Entry params) { String domainUid = params.getKey(); String image = params.getValue(); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDynamicUpdate.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDynamicUpdate.java index 4d0021e5c16..f2de80542a3 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDynamicUpdate.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiDynamicUpdate.java @@ -295,7 +295,7 @@ public void beforeEach() { @Test @Order(1) @DisplayName("Add a work manager to a model-in-image domain using dynamic update") - public void testMiiAddWorkManager() { + void testMiiAddWorkManager() { // This test uses the WebLogic domain created in BeforeAll method // BeforeEach method ensures that the server pods are running @@ -343,7 +343,7 @@ public void testMiiAddWorkManager() { @Test @Order(2) @DisplayName("Update work manager min/max threads constraints config to a model-in-image domain using dynamic update") - public void testMiiUpdateWorkManager() { + void testMiiUpdateWorkManager() { // This test uses the WebLogic domain created in BeforeAll method // BeforeEach method ensures that the server pods are running @@ -389,7 +389,7 @@ public void testMiiUpdateWorkManager() { @Test @Order(3) @DisplayName("Change target for the application deployment using mii dynamic update") - public void testMiiChangeTarget() { + void testMiiChangeTarget() { // This test uses the WebLogic domain created in BeforeAll method // BeforeEach method ensures that the server pods are running @@ -449,7 +449,7 @@ public void testMiiChangeTarget() { @Test @Order(4) @DisplayName("Add cluster in MII domain using mii dynamic update") - public void testMiiAddCluster() { + void testMiiAddCluster() { // This test uses the WebLogic domain created in BeforeAll method // BeforeEach method ensures that the server pods are running @@ -502,7 +502,7 @@ public void testMiiAddCluster() { @Test @Order(5) @DisplayName("Add datasource in MII domain using mii dynamic update") - public void testMiiAddDataSource() { + void testMiiAddDataSource() { // This test uses the WebLogic domain created in BeforeAll method // BeforeEach method ensures that the server pods are running addDataSourceAndVerify(true); @@ -519,7 +519,7 @@ public void testMiiAddDataSource() { @Test @Order(6) @DisplayName("Changing datasource parameters with CommitUpdateAndRoll using mii dynamic update") - public void testMiiChangeDataSourceParameterWithCommitUpdateAndRoll() { + void testMiiChangeDataSourceParameterWithCommitUpdateAndRoll() { // This test uses the WebLogic domain created in BeforeAll method // BeforeEach method ensures that the server pods are running @@ -593,7 +593,7 @@ public void testMiiChangeDataSourceParameterWithCommitUpdateAndRoll() { @Order(7) @DisplayName("Changing Weblogic datasource URL and deleting application with CommitUpdateAndRoll " + "using mii dynamic update") - public void testMiiDeleteAppChangeDBUrlWithCommitUpdateAndRoll() { + void testMiiDeleteAppChangeDBUrlWithCommitUpdateAndRoll() { // This test uses the WebLogic domain created in BeforeAll method // BeforeEach method ensures that the server pods are running @@ -670,7 +670,7 @@ public void testMiiDeleteAppChangeDBUrlWithCommitUpdateAndRoll() { @Test @Order(8) @DisplayName("Deleting Datasource") - public void testMiiDeleteDatasource() { + void testMiiDeleteDatasource() { // This test uses the WebLogic domain created in BeforeAll method // BeforeEach method ensures that the server pods are running @@ -723,7 +723,7 @@ public void testMiiDeleteDatasource() { @Test @Order(9) @DisplayName("Negative test changing domain name using mii dynamic update") - public void testMiiChangeDomainName() { + void testMiiChangeDomainName() { // write sparse yaml to file Path pathToChangeDomainNameYaml = Paths.get(WORK_DIR + "/changedomainname.yaml"); String yamlToChangeDomainName = "topology:\n" @@ -769,7 +769,7 @@ public void testMiiChangeDomainName() { @Test @Order(10) @DisplayName("Negative test changing listen port of a server using mii dynamic update") - public void testMiiChangeListenPort() { + void testMiiChangeListenPort() { // This test uses the WebLogic domain created in BeforeAll method // BeforeEach method ensures that the server pods are running @@ -818,7 +818,7 @@ public void testMiiChangeListenPort() { @Test @Order(11) @DisplayName("Negative test changing listen address of a server using mii dynamic update") - public void testMiiChangeListenAddress() { + void testMiiChangeListenAddress() { // write sparse yaml to file Path pathToChangeListenAddressYaml = Paths.get(WORK_DIR + "/changelistenAddress.yaml"); String yamlToChangeListenAddress = "topology:\n" @@ -863,7 +863,7 @@ public void testMiiChangeListenAddress() { @Test @Order(12) @DisplayName("Negative test changing SSL setting of a server using mii dynamic update") - public void testMiiChangeSSL() { + void testMiiChangeSSL() { // This test uses the WebLogic domain created in BeforeAll method // BeforeEach method ensures that the server pods are running @@ -916,7 +916,7 @@ public void testMiiChangeSSL() { @Test @Order(14) @DisplayName("Test non-dynamic changes with onNonDynamicChanges default value CommitUpdateOnly") - public void testOnNonDynamicChangesCommitUpdateOnly() { + void testOnNonDynamicChangesCommitUpdateOnly() { String expectedMsgForCommitUpdateOnly = "Online WebLogic configuration updates complete but there are pending non-dynamic changes " @@ -1010,7 +1010,7 @@ public void testOnNonDynamicChangesCommitUpdateOnly() { @Test @Order(15) @DisplayName("verify the operator logs introspector job messages") - public void testOperatorLogIntrospectorMsg() { + void testOperatorLogIntrospectorMsg() { String operatorPodName = assertDoesNotThrow(() -> getOperatorPodName(OPERATOR_RELEASE_NAME, opNamespace)); logger.info("operator pod name: {0}", operatorPodName); @@ -1031,7 +1031,7 @@ public void testOperatorLogIntrospectorMsg() { @Test @Order(16) @DisplayName("Test modification to Dynamic cluster size parameters") - public void testMiiUpdateDynamicClusterSize() { + void testMiiUpdateDynamicClusterSize() { // Scale the cluster by updating the replica count to 5 logger.info("[Before Patching] updating the replica count to 5"); @@ -1158,7 +1158,7 @@ public void testMiiUpdateDynamicClusterSize() { @Test @Order(17) @DisplayName("Remove all targets for the application deployment in MII domain using mii dynamic update") - public void testMiiRemoveTarget() { + void testMiiRemoveTarget() { // This test uses the WebLogic domain created in BeforeAll method // BeforeEach method ensures that the server pods are running diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiMultiModel.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiMultiModel.java index fe08d7ab6de..9921935e02f 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiMultiModel.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiMultiModel.java @@ -208,7 +208,7 @@ public static void initAll(@Namespaces(2) List namespaces) { */ @Test @DisplayName("Create model-in-image domain with a ConfigMap that contains multiple model files") - public void testMiiWithMultiModelCM() { + void testMiiWithMultiModelCM() { final String adminServerPodName = String.format("%s-%s", domainUid1, ADMIN_SERVER_NAME_BASE); final String managedServerPrefix = String.format("%s-%s", domainUid1, MANAGED_SERVER_NAME_BASE); final String expectedMaxCapacity = "40"; @@ -270,7 +270,7 @@ public void testMiiWithMultiModelCM() { */ @Test @DisplayName("Create a model-in-image domain with two WDT model files in the image") - public void testMiiWithMultiModelImage() { + void testMiiWithMultiModelImage() { final String adminServerPodName = String.format("%s-%s", domainUid2, ADMIN_SERVER_NAME_BASE); final String managedServerPrefix = String.format("%s-%s", domainUid2, MANAGED_SERVER_NAME_BASE); final String expectedMaxCapacity = "20"; @@ -331,7 +331,7 @@ public void testMiiWithMultiModelImage() { */ @Test @DisplayName("Create a model-in-image domain with two model files in both the image and the ConfigMap") - public void testMiiWithMultiModelImageAndCM() { + void testMiiWithMultiModelImageAndCM() { final String adminServerPodName = String.format("%s-%s", domainUid3, ADMIN_SERVER_NAME_BASE); final String managedServerPrefix = String.format("%s-%s", domainUid3, MANAGED_SERVER_NAME_BASE); final String configMapName = "ds-multi-model-image-cm"; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleFmwAux.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleFmwAux.java index ae826544d02..ea3ddf0166c 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleFmwAux.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleFmwAux.java @@ -23,7 +23,7 @@ @DisplayName("Test model in image sample with JRF domain using auxiliary image") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @IntegrationTest -public class ItMiiSampleFmwAux { +class ItMiiSampleFmwAux { /** * Install Operator. @@ -48,7 +48,7 @@ public static void init(@Namespaces(4) List namespaces) { @Order(1) @DisabledIfEnvironmentVariable(named = "SKIP_JRF_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample JRF initial use case using auxiliary image") - public void testAIFmwInitialUseCase() { + void testAIFmwInitialUseCase() { ItMiiSampleHelper.callInitialUseCase(); } @@ -60,7 +60,7 @@ public void testAIFmwInitialUseCase() { @Order(2) @DisabledIfEnvironmentVariable(named = "SKIP_JRF_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample JRF update1 use case using auxiliary image") - public void testAIFmwUpdate1UseCase() { + void testAIFmwUpdate1UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update1", "Update1 use case failed"); } @@ -72,7 +72,7 @@ public void testAIFmwUpdate1UseCase() { @Order(3) @DisabledIfEnvironmentVariable(named = "SKIP_JRF_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample JRF update2 use case using auxiliary image") - public void testAIFmwUpdate2UseCase() { + void testAIFmwUpdate2UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update2", "Update2 use case failed"); } @@ -84,7 +84,7 @@ public void testAIFmwUpdate2UseCase() { @Order(4) @DisabledIfEnvironmentVariable(named = "SKIP_JRF_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample JRF update3 use case using auxiliary image") - public void testAIFmwUpdate3UseCase() { + void testAIFmwUpdate3UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update3-image,-check-image-and-push,-update3-main", "Update3 use case failed"); } @@ -100,7 +100,7 @@ public void testAIFmwUpdate3UseCase() { @Order(5) @DisabledIfEnvironmentVariable(named = "SKIP_JRF_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample JRF update4 use case using auxiliary image") - public void testAIFmwUpdate4UseCase() { + void testAIFmwUpdate4UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update4", "Update4 use case failed"); } diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleFmwMain.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleFmwMain.java index bc19e4e8dfb..0cffa0b79bf 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleFmwMain.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleFmwMain.java @@ -23,7 +23,7 @@ @DisplayName("Test model in image sample with JRF domain") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @IntegrationTest -public class ItMiiSampleFmwMain { +class ItMiiSampleFmwMain { /** * Install Operator. @@ -48,7 +48,7 @@ public static void init(@Namespaces(4) List namespaces) { @Order(1) @DisabledIfEnvironmentVariable(named = "SKIP_JRF_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample JRF initial use case") - public void testFmwInitialUseCase() { + void testFmwInitialUseCase() { ItMiiSampleHelper.callInitialUseCase(); } @@ -61,7 +61,7 @@ public void testFmwInitialUseCase() { @Order(2) @DisabledIfEnvironmentVariable(named = "SKIP_JRF_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample JRF update1 use case") - public void testFmwUpdate1UseCase() { + void testFmwUpdate1UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update1", "Update1 use case failed"); } @@ -73,7 +73,7 @@ public void testFmwUpdate1UseCase() { @Order(3) @DisabledIfEnvironmentVariable(named = "SKIP_JRF_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample JRF update2 use case") - public void testFmwUpdate2UseCase() { + void testFmwUpdate2UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update2", "Update2 use case failed"); } @@ -85,7 +85,7 @@ public void testFmwUpdate2UseCase() { @Order(4) @DisabledIfEnvironmentVariable(named = "SKIP_JRF_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample JRF update3 use case") - public void testFmwUpdate3UseCase() { + void testFmwUpdate3UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update3-image,-check-image-and-push,-update3-main", "Update3 use case failed"); } @@ -101,7 +101,7 @@ public void testFmwUpdate3UseCase() { @Order(5) @DisabledIfEnvironmentVariable(named = "SKIP_JRF_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample JRF update4 use case") - public void testFmwUpdate4UseCase() { + void testFmwUpdate4UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update4", "Update4 use case failed"); } diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleWlsAux.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleWlsAux.java index 6994c217cdc..5fe20c5a407 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleWlsAux.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleWlsAux.java @@ -23,7 +23,7 @@ @DisplayName("Test model in image sample with WLS domain using auxiliary image") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @IntegrationTest -public class ItMiiSampleWlsAux { +class ItMiiSampleWlsAux { /** * Install Operator. @@ -48,7 +48,7 @@ public static void init(@Namespaces(3) List namespaces) { @Order(1) @DisabledIfEnvironmentVariable(named = "SKIP_WLS_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample WLS initial use case using auxiliary image") - public void testAIWlsInitialUseCase() { + void testAIWlsInitialUseCase() { ItMiiSampleHelper.callInitialUseCase(); } @@ -66,7 +66,7 @@ public void testAIWlsInitialUseCase() { @Order(2) @DisabledIfEnvironmentVariable(named = "SKIP_WLS_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample WLS update1 use case using auxiliary image") - public void testAIWlsUpdate1UseCase() { + void testAIWlsUpdate1UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update1", "Update1 use case failed"); } @@ -84,7 +84,7 @@ public void testAIWlsUpdate1UseCase() { @Order(3) @DisabledIfEnvironmentVariable(named = "SKIP_WLS_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample WLS update2 use case using auxiliary image") - public void tesAIWlsUpdate2UseCase() { + void testAIWlsUpdate2UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update2", "Update2 use case failed"); } @@ -102,7 +102,7 @@ public void tesAIWlsUpdate2UseCase() { @Order(4) @DisabledIfEnvironmentVariable(named = "SKIP_WLS_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample WLS update3 use case using auxiliary image") - public void testAIWlsUpdate3UseCase() { + void testAIWlsUpdate3UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update3-image,-check-image-and-push,-update3-main", "Update3 use case failed"); } @@ -118,7 +118,7 @@ public void testAIWlsUpdate3UseCase() { @Order(5) @DisabledIfEnvironmentVariable(named = "SKIP_WLS_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample WLS update4 use case using auxiliary image") - public void testAIWlsUpdate4UseCase() { + void testAIWlsUpdate4UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update4", "Update4 use case failed"); } diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleWlsMain.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleWlsMain.java index 460a432becd..ea1e3fc84be 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleWlsMain.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSampleWlsMain.java @@ -23,7 +23,7 @@ @DisplayName("Test model in image sample with WLS domain") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @IntegrationTest -public class ItMiiSampleWlsMain { +class ItMiiSampleWlsMain { /** * Install Operator. @@ -43,7 +43,7 @@ public static void init(@Namespaces(3) List namespaces) { @Order(1) @DisabledIfEnvironmentVariable(named = "SKIP_CHECK_SAMPLE", matches = "true") @DisplayName("Test to verify MII Sample source") - public void testCheckMiiSampleSource() { + void testCheckMiiSampleSource() { ItMiiSampleHelper.callCheckMiiSampleSource("-check-sample", "Sample source doesn't match with the generated source"); } @@ -61,7 +61,7 @@ public void testCheckMiiSampleSource() { @Order(2) @DisabledIfEnvironmentVariable(named = "SKIP_WLS_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample WLS initial use case") - public void testWlsInitialUseCase() { + void testWlsInitialUseCase() { ItMiiSampleHelper.callInitialUseCase(); } @@ -79,7 +79,7 @@ public void testWlsInitialUseCase() { @Order(3) @DisabledIfEnvironmentVariable(named = "SKIP_WLS_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample WLS update1 use case") - public void testWlsUpdate1UseCase() { + void testWlsUpdate1UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update1", "Update1 use case failed"); } @@ -97,7 +97,7 @@ public void testWlsUpdate1UseCase() { @Order(4) @DisabledIfEnvironmentVariable(named = "SKIP_WLS_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample WLS update2 use case") - public void testWlsUpdate2UseCase() { + void testWlsUpdate2UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update2", "Update2 use case failed"); } @@ -115,7 +115,7 @@ public void testWlsUpdate2UseCase() { @Order(5) @DisabledIfEnvironmentVariable(named = "SKIP_WLS_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample WLS update3 use case") - public void testWlsUpdate3UseCase() { + void testWlsUpdate3UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update3-image,-check-image-and-push,-update3-main", "Update3 use case failed"); } @@ -131,7 +131,7 @@ public void testWlsUpdate3UseCase() { @Order(6) @DisabledIfEnvironmentVariable(named = "SKIP_WLS_SAMPLES", matches = "true") @DisplayName("Test to verify MII sample WLS update4 use case") - public void testWlsUpdate4UseCase() { + void testWlsUpdate4UseCase() { ItMiiSampleHelper.callUpdateUseCase("-update4", "Update4 use case failed"); } diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiServiceMigration.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiServiceMigration.java index b46beae1c36..53ecea60cc5 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiServiceMigration.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiServiceMigration.java @@ -224,7 +224,7 @@ public static void initAll(@Namespaces(2) List namespaces) { @Test @Order(1) @DisplayName("Verify JMS Service migration with FileStore") - public void testMiiJmsServiceMigrationWithFileStore() { + void testMiiJmsServiceMigrationWithFileStore() { // build the standalone JMS Client on Admin pod after rolling restart String destLocation = "/u01/JmsSendReceiveClient.java"; @@ -260,7 +260,7 @@ public void testMiiJmsServiceMigrationWithFileStore() { @Test @Order(2) @DisplayName("Verify JMS Service migration with JDBCStore") - public void testMiiJmsServiceMigrationWithJdbcStore() { + void testMiiJmsServiceMigrationWithJdbcStore() { // Restart the managed server(2) if shutdown by previous test method // Make sure that JMS server runtime JMSService@managed-server2 is @@ -307,7 +307,7 @@ public void testMiiJmsServiceMigrationWithJdbcStore() { @Test @Order(3) @DisplayName("Verify JTA Recovery Service migration to an active server") - public void testMiiJtaServiceMigration() { + void testMiiJtaServiceMigration() { // Restart the managed server(2) if shutdown by previous test method // Make sure that JTA Recovery service is active on managed-server2 diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiUpdateDomainConfig.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiUpdateDomainConfig.java index e065a8d7c62..cd9e57187d6 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiUpdateDomainConfig.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiUpdateDomainConfig.java @@ -249,7 +249,7 @@ public void beforeEach() { @Test @Order(0) @DisplayName("Check environment variable with special characters") - public void testMiiCustomEnv() { + void testMiiCustomEnv() { Domain domain1 = assertDoesNotThrow(() -> getDomainCustomResource(domainUid, domainNamespace), String.format("getDomainCustomResource failed with ApiException when tried to get domain %s in namespace %s", domainUid, domainNamespace)); @@ -298,7 +298,7 @@ public void testMiiCustomEnv() { @Test @Order(1) @DisplayName("Check the server logs are written to PersistentVolume") - public void testMiiServerLogsAreOnPV() { + void testMiiServerLogsAreOnPV() { // check server logs are written on PV and look for string RUNNING in log checkLogsOnPV("grep RUNNING /shared/logs/" + adminServerName + ".log", adminServerPodName); } @@ -311,7 +311,7 @@ public void testMiiServerLogsAreOnPV() { @Test @Order(2) @DisplayName("Check the HTTP server logs are written to PersistentVolume") - public void testMiiHttpServerLogsAreOnPV() { + void testMiiHttpServerLogsAreOnPV() { String[] podNames = {managedServerPrefix + "1", managedServerPrefix + "2"}; for (String pod : podNames) { String curlCmd = "for i in {1..100}; " @@ -348,7 +348,7 @@ public void testMiiHttpServerLogsAreOnPV() { @Test @Order(3) @DisplayName("Verify the pre-configured SystemResources in the domain") - public void testMiiCheckSystemResources() { + void testMiiCheckSystemResources() { int adminServiceNodePort = getServiceNodePort(domainNamespace, getExternalServicePodName(adminServerPodName), "default"); @@ -388,7 +388,7 @@ public void testMiiCheckSystemResources() { @Test @Order(4) @DisplayName("Delete SystemResources from the domain") - public void testMiiDeleteSystemResources() { + void testMiiDeleteSystemResources() { String configMapName = "deletesysrescm"; createConfigMapAndVerify( @@ -453,7 +453,7 @@ public void testMiiDeleteSystemResources() { @Test @Order(5) @DisplayName("Add new JDBC/JMS SystemResources to the domain") - public void testMiiAddSystemResources() { + void testMiiAddSystemResources() { logger.info("Use same database secret created in befreAll() method"); String configMapName = "dsjmsconfigmap"; @@ -523,7 +523,7 @@ public void testMiiAddSystemResources() { @Test @Order(6) @DisplayName("Add a dynamic cluster to the domain with default replica count") - public void testMiiAddDynmicClusteriWithNoReplica() { + void testMiiAddDynmicClusteriWithNoReplica() { // This test uses the WebLogic domain created in the BeforeAll method // BeforeEach method ensures that the server pods are running @@ -583,7 +583,7 @@ public void testMiiAddDynmicClusteriWithNoReplica() { @Test @Order(7) @DisplayName("Add a dynamic cluster to domain with non-zero replica count") - public void testMiiAddDynamicCluster() { + void testMiiAddDynamicCluster() { // This test uses the WebLogic domain created in the BeforeAll method // BeforeEach method ensures that the server pods are running @@ -660,7 +660,7 @@ public void testMiiAddDynamicCluster() { @Test @Order(8) @DisplayName("Add a configured cluster to the domain") - public void testMiiAddConfiguredCluster() { + void testMiiAddConfiguredCluster() { // This test uses the WebLogic domain created in the BeforeAll method // BeforeEach method ensures that the server pods are running @@ -732,7 +732,7 @@ public void testMiiAddConfiguredCluster() { @Test @Order(9) @DisplayName("Change the WebLogic Admin credential of the domain") - public void testMiiUpdateWebLogicCredential() { + void testMiiUpdateWebLogicCredential() { verifyUpdateWebLogicCredential(domainNamespace, domainUid, adminServerPodName, managedServerPrefix, replicaCount); } @@ -756,7 +756,7 @@ public void testMiiUpdateWebLogicCredential() { @Test @Order(10) @DisplayName("Test modification to Dynamic cluster size parameters") - public void testMiiUpdateDynamicClusterSize() { + void testMiiUpdateDynamicClusterSize() { // Scale the cluster to replica count to 5 logger.info("[Before Patching] updating the replica count to 5"); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMonitoringExporter.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMonitoringExporter.java index ccd119a5596..398fa77d5a9 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMonitoringExporter.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMonitoringExporter.java @@ -351,7 +351,7 @@ public static void initAll(@Namespaces(12) List namespaces) { */ @Test @DisplayName("Test End to End example from MonitoringExporter github project.") - public void testEndToEndViaChart() throws Exception { + void testEndToEndViaChart() throws Exception { wdtImage = createAndVerifyDomainInImage(); try { logger.info("Create wdt domain and verify that it's running"); @@ -405,7 +405,7 @@ public void testEndToEndViaChart() throws Exception { */ @Test @DisplayName("Test Basic Functionality of Monitoring Exporter SideCar.") - public void testSideCarBasicFunctionality() throws Exception { + void testSideCarBasicFunctionality() throws Exception { // create and verify one cluster mii domain logger.info("Create domain and verify that it's running"); @@ -494,7 +494,7 @@ private void changeMonitoringExporterSideCarConfig(String configYamlFile, String */ @Test @DisplayName("Test Basic Functionality of Monitoring Exporter SideCar for domain with two clusters.") - public void testSideCarBasicFunctionalityTwoClusters() throws Exception { + void testSideCarBasicFunctionalityTwoClusters() throws Exception { // create and verify one cluster mii domain logger.info("Create domain and verify that it's running"); @@ -522,7 +522,7 @@ public void testSideCarBasicFunctionalityTwoClusters() throws Exception { @Test @DisplayName("Test Basic Functionality of Monitoring Exporter SideCar with ssl enabled.") - public void testSideCarBasicFunctionalityWithSSL() throws Exception { + void testSideCarBasicFunctionalityWithSSL() throws Exception { // create and verify one cluster mii domain logger.info("Create domain and verify that it's running"); @@ -553,7 +553,7 @@ public void testSideCarBasicFunctionalityWithSSL() throws Exception { */ @Test @DisplayName("Test Basic Functionality of Monitoring Exporter.") - public void testBasicFunctionality() throws Exception { + void testBasicFunctionality() throws Exception { // create and verify one cluster mii domain logger.info("Create domain and verify that it's running"); createAndVerifyDomain(miiImage, domain4Uid, domain4Namespace, "FromModel", 1, true); @@ -616,7 +616,7 @@ public void testBasicFunctionality() throws Exception { //commented out untill Issue (see oracle/weblogic-monitoring-exporter#138) will be fixed //@Test @DisplayName("Test Accesability of Monitoring Exporter dashboard and metrics if admin port is enabled.") - public void testAdminPortEnabled() throws Exception { + void testAdminPortEnabled() throws Exception { // create and verify one cluster mii domain with admin port enabled logger.info("Create domain and verify that it's running"); @@ -645,7 +645,7 @@ public void testAdminPortEnabled() throws Exception { */ @Test @DisplayName("Test Monitoring Exporter access to metrics via https.") - public void testAccessExporterViaHttps() throws Exception { + void testAccessExporterViaHttps() throws Exception { String miiImage1 = null; try { diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOCILoadBalancer.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOCILoadBalancer.java index 516f717fe2e..7a5752bee28 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOCILoadBalancer.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOCILoadBalancer.java @@ -105,7 +105,7 @@ public void tearDownAll() { @Test @DisplayName("Test the sample-app app can be accessed" + " from all managed servers in the domain through OCI Load Balancer.") - public void testOCILoadBalancer() throws Exception { + void testOCILoadBalancer() throws Exception { // create and verify one cluster mii domain logger.info("Create domain and verify that it's running"); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOpUpgradeFmwDomainInPV.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOpUpgradeFmwDomainInPV.java index 3a11bd5792b..59ed5fa9935 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOpUpgradeFmwDomainInPV.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOpUpgradeFmwDomainInPV.java @@ -91,7 +91,7 @@ */ @DisplayName("Tests to upgrade Operator with FMW domain in PV using WLST") @IntegrationTest -public class ItOpUpgradeFmwDomainInPV { +class ItOpUpgradeFmwDomainInPV { private static ConditionFactory withStandardRetryPolicy; private static ConditionFactory withQuickRetryPolicy; @@ -216,7 +216,7 @@ public void tearDown() { */ @Test @DisplayName("Upgrade Operator from 2.6.0 to main") - public void testOperatorFmwUpgradeFrom260ToMain() { + void testOperatorFmwUpgradeFrom260ToMain() { installAndUpgradeOperator("2.6.0", OLD_DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, false); } @@ -225,7 +225,7 @@ public void testOperatorFmwUpgradeFrom260ToMain() { */ @Test @DisplayName("Upgrade Operator from 3.0.3 to main") - public void testOperatorFmwUpgradeFrom303ToMain() { + void testOperatorFmwUpgradeFrom303ToMain() { this.namespaces = namespaces; installAndUpgradeOperator("3.0.3", OLD_DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -235,7 +235,7 @@ public void testOperatorFmwUpgradeFrom303ToMain() { */ @Test @DisplayName("Upgrade Operator from 3.0.4 to main") - public void testOperatorFmwUpgradeFrom304ToMain() { + void testOperatorFmwUpgradeFrom304ToMain() { this.namespaces = namespaces; installAndUpgradeOperator("3.0.4", OLD_DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -245,7 +245,7 @@ public void testOperatorFmwUpgradeFrom304ToMain() { */ @Test @DisplayName("Upgrade Operator from 3.1.3 to main") - public void testOperatorFmwUpgradeFrom313ToMain() { + void testOperatorFmwUpgradeFrom313ToMain() { installAndUpgradeOperator("3.1.3", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -254,7 +254,7 @@ public void testOperatorFmwUpgradeFrom313ToMain() { */ @Test @DisplayName("Upgrade Operator from 3.1.4 to main") - public void testOperatorFmwUpgradeFrom314ToMain() { + void testOperatorFmwUpgradeFrom314ToMain() { installAndUpgradeOperator("3.1.4", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -263,7 +263,7 @@ public void testOperatorFmwUpgradeFrom314ToMain() { */ @Test @DisplayName("Upgrade Operator from 3.2.0 to main") - public void testOperatorFmwUpgradeFrom320ToMain() { + void testOperatorFmwUpgradeFrom320ToMain() { installAndUpgradeOperator("3.2.0", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -272,7 +272,7 @@ public void testOperatorFmwUpgradeFrom320ToMain() { */ @Test @DisplayName("Upgrade Operator from 3.2.4 to main") - public void testOperatorFmwUpgradeFrom324ToMain() { + void testOperatorFmwUpgradeFrom324ToMain() { installAndUpgradeOperator("3.2.4", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -281,7 +281,7 @@ public void testOperatorFmwUpgradeFrom324ToMain() { */ @Test @DisplayName("Upgrade Operator from 3.2.5 to main") - public void testOperatorFmwUpgradeFrom325ToMain() { + void testOperatorFmwUpgradeFrom325ToMain() { installAndUpgradeOperator("3.2.5", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOperatorRestart.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOperatorRestart.java index af32ed862c6..76f81da8d91 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOperatorRestart.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOperatorRestart.java @@ -61,7 +61,7 @@ @DisplayName("Test to patch the model-in-image image to change WebLogic admin credentials secret") @IntegrationTest @Tag("okdenv") -public class ItOperatorRestart { +class ItOperatorRestart { private static String opNamespace = null; private static String domainNamespace = null; private static String domainUid = "domain1"; @@ -119,7 +119,7 @@ public static void initAll(@Namespaces(2) List namespaces) { */ @Test @DisplayName("Stop operator, delete all the server pods and restart operator, verify servers are started") - public void testRestartOperatorAndVerifyDomainUp() { + void testRestartOperatorAndVerifyDomainUp() { // get operator pod name String operatorPodName = assertDoesNotThrow( @@ -179,7 +179,7 @@ public void testRestartOperatorAndVerifyDomainUp() { */ @Test @DisplayName("Stop operator, increase replica count for the domain, restart operator and verify cluster is scaled up") - public void testRestartOperatorAndVerifyScaling() { + void testRestartOperatorAndVerifyScaling() { // get operator pod name String operatorPodName = assertDoesNotThrow( @@ -230,7 +230,7 @@ public void testRestartOperatorAndVerifyScaling() { */ @Test @DisplayName("Restart operator when the domain is rolling after the admin credentials are changed") - public void testOperatorRestartWhenPodRoll() { + void testOperatorRestartWhenPodRoll() { final boolean VALID = true; final boolean INVALID = false; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOperatorWlsUpgrade.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOperatorWlsUpgrade.java index b135b7f2ebc..d7c60c9a960 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOperatorWlsUpgrade.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOperatorWlsUpgrade.java @@ -87,7 +87,7 @@ @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @DisplayName("Operator upgrade tests") @IntegrationTest -public class ItOperatorWlsUpgrade { +class ItOperatorWlsUpgrade { private static ConditionFactory withStandardRetryPolicy; private static ConditionFactory withQuickRetryPolicy; @@ -138,7 +138,7 @@ public static void init() { */ @Test @DisplayName("Upgrade Operator from 2.6.0 to main") - public void testOperatorWlsUpgradeFrom260ToMain() { + void testOperatorWlsUpgradeFrom260ToMain() { upgradeOperator("domain-in-image", "2.6.0", OLD_DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, false); } @@ -148,7 +148,7 @@ public void testOperatorWlsUpgradeFrom260ToMain() { @ParameterizedTest @DisplayName("Upgrade Operator from 3.0.3 to main") @ValueSource(strings = { "domain-in-image", "model-in-image" }) - public void testOperatorWlsUpgradeFrom303ToMain(String domainType) { + void testOperatorWlsUpgradeFrom303ToMain(String domainType) { logger.info("Starting test testOperatorWlsUpgradeFrom303ToMain with domain type {0}", domainType); upgradeOperator(domainType, "3.0.3", OLD_DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -159,7 +159,7 @@ public void testOperatorWlsUpgradeFrom303ToMain(String domainType) { @ParameterizedTest @DisplayName("Upgrade Operator from 3.0.4 to main") @ValueSource(strings = { "domain-in-image", "model-in-image" }) - public void testOperatorWlsUpgradeFrom304ToMain(String domainType) { + void testOperatorWlsUpgradeFrom304ToMain(String domainType) { logger.info("Starting test testOperatorWlsUpgradeFrom304ToMain with domain type {0}", domainType); upgradeOperator(domainType, "3.0.4", OLD_DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -170,7 +170,7 @@ public void testOperatorWlsUpgradeFrom304ToMain(String domainType) { @ParameterizedTest @DisplayName("Upgrade Operator from 3.1.3 to main") @ValueSource(strings = { "domain-in-image", "model-in-image" }) - public void testOperatorWlsUpgradeFrom313ToMain(String domainType) { + void testOperatorWlsUpgradeFrom313ToMain(String domainType) { logger.info("Starting test testOperatorWlsUpgradeFrom313ToMain with domain type {0}", domainType); upgradeOperator(domainType, "3.1.3", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -181,7 +181,7 @@ public void testOperatorWlsUpgradeFrom313ToMain(String domainType) { @ParameterizedTest @DisplayName("Upgrade Operator from 3.1.4 to main") @ValueSource(strings = { "domain-in-image", "model-in-image" }) - public void testOperatorWlsUpgradeFrom314ToMain(String domainType) { + void testOperatorWlsUpgradeFrom314ToMain(String domainType) { logger.info("Starting test testOperatorWlsUpgradeFrom314ToMain with domain type {0}", domainType); upgradeOperator(domainType, "3.1.4", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -192,7 +192,7 @@ public void testOperatorWlsUpgradeFrom314ToMain(String domainType) { @ParameterizedTest @DisplayName("Upgrade Operator from 3.2.0 to main") @ValueSource(strings = { "domain-in-image", "model-in-image" }) - public void testOperatorWlsUpgradeFrom320ToMain(String domainType) { + void testOperatorWlsUpgradeFrom320ToMain(String domainType) { logger.info("Starting test testOperatorWlsUpgradeFrom320ToMain with domain type {0}", domainType); upgradeOperator(domainType, "3.2.0", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -203,7 +203,7 @@ public void testOperatorWlsUpgradeFrom320ToMain(String domainType) { @ParameterizedTest @DisplayName("Upgrade Operator from 3.2.4 to main") @ValueSource(strings = { "domain-in-image", "model-in-image" }) - public void testOperatorWlsUpgradeFrom324ToMain(String domainType) { + void testOperatorWlsUpgradeFrom324ToMain(String domainType) { logger.info("Starting test testOperatorWlsUpgradeFrom321ToMain with domain type {0}", domainType); upgradeOperator(domainType, "3.2.4", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } @@ -214,7 +214,7 @@ public void testOperatorWlsUpgradeFrom324ToMain(String domainType) { @ParameterizedTest @DisplayName("Upgrade Operator from 3.2.5 to main") @ValueSource(strings = { "domain-in-image", "model-in-image" }) - public void testOperatorWlsUpgradeFrom325ToMain(String domainType) { + void testOperatorWlsUpgradeFrom325ToMain(String domainType) { logger.info("Starting test testOperatorWlsUpgradeFrom322ToMain with domain type {0}", domainType); upgradeOperator(domainType, "3.2.5", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX, true); } diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java index 75d1319a3e3..78ea073236d 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java @@ -309,7 +309,7 @@ public static void initAll(@Namespaces(6) List namespaces) { */ @Test @DisplayName("verify the operator log has expected error msg when encryption secret not created for a mii domain") - public void testOperatorLogSevereMsg() { + void testOperatorLogSevereMsg() { createMiiDomainNegative("miidomainnegative", miiDomainNegativeNamespace); String operatorPodName = assertDoesNotThrow(() -> getOperatorPodName(OPERATOR_RELEASE_NAME, opNamespace)); @@ -327,7 +327,7 @@ public void testOperatorLogSevereMsg() { @ParameterizedTest @DisplayName("scale cluster by patching domain resource with three different type of domains") @MethodSource("domainProvider") - public void testScaleClustersByPatchingDomainResource(Domain domain) { + void testScaleClustersByPatchingDomainResource(Domain domain) { assertDomainNotNull(domain); // get the domain properties @@ -372,7 +372,7 @@ public void testScaleClustersByPatchingDomainResource(Domain domain) { @ParameterizedTest @DisplayName("scale cluster using REST API for three different type of domains") @MethodSource("domainProvider") - public void testScaleClustersWithRestApi(Domain domain) { + void testScaleClustersWithRestApi(Domain domain) { assertDomainNotNull(domain); // get domain properties @@ -408,7 +408,7 @@ public void testScaleClustersWithRestApi(Domain domain) { @ParameterizedTest @DisplayName("scale cluster using WLDF policy for three different type of domains") @MethodSource("domainProvider") - public void testScaleClustersWithWLDF(Domain domain) { + void testScaleClustersWithWLDF(Domain domain) { assertDomainNotNull(domain); // get domain properties @@ -451,7 +451,7 @@ public void testScaleClustersWithWLDF(Domain domain) { @ParameterizedTest @DisplayName("Test admin console login using admin node port") @MethodSource("domainProvider") - public void testAdminConsoleLoginUsingAdminNodePort(Domain domain) { + void testAdminConsoleLoginUsingAdminNodePort(Domain domain) { assumeFalse(WEBLOGIC_SLIM, "Skipping the Console Test for slim image"); @@ -479,7 +479,7 @@ public void testAdminConsoleLoginUsingAdminNodePort(Domain domain) { @ParameterizedTest @DisplayName("Test admin console login using ingress controller") @MethodSource("domainProvider") - public void testAdminConsoleLoginUsingIngressController(Domain domain) { + void testAdminConsoleLoginUsingIngressController(Domain domain) { assumeFalse(WEBLOGIC_SLIM, "Skipping the Console Test for slim image"); @@ -502,7 +502,7 @@ public void testAdminConsoleLoginUsingIngressController(Domain domain) { */ @Test @DisplayName("Test liveness probe of pod") - public void testLivenessProbe() { + void testLivenessProbe() { Domain domain = miiDomain; assertDomainNotNull(domain); String domainUid = domain.getSpec().getDomainUid(); @@ -597,7 +597,7 @@ public void testLivenessProbe() { */ @Test @DisplayName("Test dataHome override in a domain with domain in image type") - public void testDataHomeOverrideDomainInImage() { + void testDataHomeOverrideDomainInImage() { assertDomainNotNull(domainInImage); String domainUid = domainInImage.getSpec().getDomainUid(); @@ -640,7 +640,7 @@ public void testDataHomeOverrideDomainInImage() { */ @Test @DisplayName("Test dataHome override in a domain with model in image type") - public void testDataHomeOverrideMiiDomain() { + void testDataHomeOverrideMiiDomain() { assertDomainNotNull(miiDomain); String domainUid = miiDomain.getSpec().getDomainUid(); @@ -686,7 +686,7 @@ public void testDataHomeOverrideMiiDomain() { */ @Test @DisplayName("Test dataHome override in a domain with domain on PV type") - public void testDataHomeOverrideDomainOnPV() { + void testDataHomeOverrideDomainOnPV() { assertDomainNotNull(domainOnPV); String domainUid = domainOnPV.getSpec().getDomainUid(); @@ -729,7 +729,7 @@ public void testDataHomeOverrideDomainOnPV() { */ @Test @DisplayName("Verify server pods are restarted only once by changing the imagePullPolicy in multi-cluster domain") - public void testMultiClustersRollingRestart() { + void testMultiClustersRollingRestart() { OffsetDateTime timestamp = now(); // get the original domain resource before update diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodTemplates.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodTemplates.java index f0e60717098..6ceef34a19b 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodTemplates.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodTemplates.java @@ -101,7 +101,7 @@ public static void initAll(@Namespaces(2) List namespaces) { */ @Test @DisplayName("Test pod templates using all the variables for domain in image.") - public void testPodTemplateUsingVariablesDomainInImage() throws Exception { + void testPodTemplateUsingVariablesDomainInImage() throws Exception { try { logger.info("Add annotations to serverPod as $(DOMAIN_HOME) and $(LOG_HOME)"); logger.info("Add labels to serverPod as $(DOMAIN_NAME), $(DOMAIN_UID), $(SERVER_NAME)"); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodsRestart.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodsRestart.java index e58f5a41e75..bf2472c9d55 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodsRestart.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodsRestart.java @@ -143,7 +143,7 @@ public static void initAll(@Namespaces(2) List namespaces) { */ @Test @DisplayName("Verify server pods are restarted by changing the resources") - public void testServerPodsRestartByChangingResource() { + void testServerPodsRestartByChangingResource() { // get the original domain resource before update Domain domain1 = assertDoesNotThrow(() -> getDomainCustomResource(domainUid, domainNamespace), @@ -275,7 +275,7 @@ public void testServerPodsRestartByChangingResource() { */ @Test @DisplayName("Verify server pods are restarted by changing IncludeServerOutInPodLog") - public void testServerPodsRestartByChangingIncludeServerOutInPodLog() { + void testServerPodsRestartByChangingIncludeServerOutInPodLog() { // get the original domain resource before update Domain domain1 = assertDoesNotThrow(() -> getDomainCustomResource(domainUid, domainNamespace), String.format("getDomainCustomResource failed with ApiException when tried to get domain %s in namespace %s", @@ -354,7 +354,7 @@ public void testServerPodsRestartByChangingIncludeServerOutInPodLog() { */ @Test @DisplayName("Verify server pods are restarted by changing serverPod env property") - public void testServerPodsRestartByChangingEnvProperty() { + void testServerPodsRestartByChangingEnvProperty() { // get the original domain resource before update Domain domain1 = assertDoesNotThrow(() -> getDomainCustomResource(domainUid, domainNamespace), String.format("getDomainCustomResource failed with ApiException when tried to get domain %s in namespace %s", @@ -445,7 +445,7 @@ public void testServerPodsRestartByChangingEnvProperty() { */ @Test @DisplayName("Verify server pods are restarted by adding serverPod podSecurityContext") - public void testServerPodsRestartByChaningPodSecurityContext() { + void testServerPodsRestartByChaningPodSecurityContext() { // get the original domain resource before update Domain domain1 = assertDoesNotThrow(() -> getDomainCustomResource(domainUid, domainNamespace), String.format("getDomainCustomResource failed with ApiException when tried to get domain %s in namespace %s", @@ -539,7 +539,7 @@ public void testServerPodsRestartByChaningPodSecurityContext() { */ @Test @DisplayName("Verify server pods are restarted by changing imagePullPolicy") - public void testServerPodsRestartByChangingImagePullPolicy() { + void testServerPodsRestartByChangingImagePullPolicy() { // get the original domain resource before update Domain domain1 = assertDoesNotThrow(() -> getDomainCustomResource(domainUid, domainNamespace), String.format("getDomainCustomResource failed with ApiException when tried to get domain %s in namespace %s", @@ -620,7 +620,7 @@ public void testServerPodsRestartByChangingImagePullPolicy() { */ @Test @DisplayName("Restart pods using restartVersion flag") - public void testRestartVersion() { + void testRestartVersion() { // get the original domain resource before update Domain domain1 = assertDoesNotThrow(() -> getDomainCustomResource(domainUid, domainNamespace), String.format("getDomainCustomResource failed with ApiException when tried to get domain %s in namespace %s", @@ -685,7 +685,7 @@ public void testRestartVersion() { */ @Test @DisplayName("Check restart of pods after image change") - public void testRestartWithImageChange() { + void testRestartWithImageChange() { String tag = TestUtils.getDateAndTimeStamp(); String newImage = MII_BASIC_IMAGE_NAME + ":" + tag; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodsShutdownOption.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodsShutdownOption.java index 359a0e9392b..8075325127c 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodsShutdownOption.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodsShutdownOption.java @@ -171,7 +171,7 @@ public void afterEach() { */ @Test @DisplayName("Verify shutdown rules when shutdown properties are defined at different levels ") - public void testShutdownPropsAllLevels() { + void testShutdownPropsAllLevels() { // create Shutdown objects for each server and cluster @@ -227,7 +227,7 @@ public void testShutdownPropsAllLevels() { */ @Test @DisplayName("Verify shutdown rules when shutdown properties are defined at different levels ") - public void testShutdownPropsEnvOverride() { + void testShutdownPropsEnvOverride() { // create Shutdown objects for each server and cluster diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItProductionSecureMode.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItProductionSecureMode.java index a19d8f0ef76..3d1c362608a 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItProductionSecureMode.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItProductionSecureMode.java @@ -208,7 +208,7 @@ public void beforeEach() { @Test @Order(1) @DisplayName("Verify the secure service through administration port") - public void testVerifyProductionSecureMode() { + void testVerifyProductionSecureMode() { int defaultAdminPort = getServiceNodePort( domainNamespace, getExternalServicePodName(adminServerPodName), "default-admin"); assertTrue(defaultAdminPort != -1, @@ -269,7 +269,7 @@ public void testVerifyProductionSecureMode() { @Test @Order(2) @DisplayName("Verify MII dynamic update with SSL enabled") - public void testMiiDynamicChangeWithSSLEnabled() { + void testMiiDynamicChangeWithSSLEnabled() { LinkedHashMap pods = new LinkedHashMap<>(); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItRemoteConsole.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItRemoteConsole.java index 7b7dc41dc32..ddc8b5343e5 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItRemoteConsole.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItRemoteConsole.java @@ -165,7 +165,7 @@ public static void initAll(@Namespaces(5) List namespaces) { */ @Test @DisplayName("Verify Connecting to Mii domain WLS Remote Console through Traefik is successful") - public void testWlsRemoteConsoleConnectionThroughTraefik() { + void testWlsRemoteConsoleConnectionThroughTraefik() { int traefikNodePort = getServiceNodePort(traefikNamespace, traefikHelmParams.getReleaseName(), "web"); assertTrue(traefikNodePort != -1, @@ -186,7 +186,7 @@ public void testWlsRemoteConsoleConnectionThroughTraefik() { */ @Test @DisplayName("Verify Connecting to Mii domain WLS Remote Console through Voyager is successful") - public void testWlsRemoteConsoleConnectionThroughVoyager() { + void testWlsRemoteConsoleConnectionThroughVoyager() { assertTrue(voyagerNodePort != -1, "Could not get the default external service node port"); logger.info("Found the Voyager service nodePort {0}", voyagerNodePort); @@ -206,7 +206,7 @@ public void testWlsRemoteConsoleConnectionThroughVoyager() { */ @Test @DisplayName("Verify Connecting to Mii domain WLS Remote Console through NGINX is successful") - public void testWlsRemoteConsoleConnectionThroughNginx() { + void testWlsRemoteConsoleConnectionThroughNginx() { assertTrue(nginxNodePort != -1, "Could not get the default external service node port"); logger.info("Found the NGINX service nodePort {0}", nginxNodePort); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItServerStartPolicy.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItServerStartPolicy.java index f6455d0002b..ce77505063a 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItServerStartPolicy.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItServerStartPolicy.java @@ -257,7 +257,7 @@ public void beforeEach() { @Order(0) @Test @DisplayName("Stop a server below Limit") - public void testStopManagedServerBeyondMinClusterLimit() { + void testStopManagedServerBeyondMinClusterLimit() { String serverPodName = domainUid + "-managed-server1"; String serverPodName2 = domainUid + "-managed-server2"; @@ -293,7 +293,7 @@ public void testStopManagedServerBeyondMinClusterLimit() { @Order(1) @Test @DisplayName("Restart the Administration server with serverStartPolicy") - public void testAdminServerRestart() { + void testAdminServerRestart() { String configServerPodName = domainUid + "-config-cluster-server1"; String dynamicServerPodName = domainUid + "-managed-server1"; @@ -339,7 +339,7 @@ public void testAdminServerRestart() { @Order(2) @Test @DisplayName("Restart the configured cluster with serverStartPolicy") - public void testConfigClusterRestart() { + void testConfigClusterRestart() { String configServerPodName = domainUid + "-config-cluster-server1"; String dynamicServerPodName = domainUid + "-managed-server1"; @@ -391,7 +391,7 @@ public void testConfigClusterRestart() { @Order(3) @Test @DisplayName("Restart the dynamic cluster with serverStartPolicy") - public void testDynamicClusterRestart() { + void testDynamicClusterRestart() { String dynamicServerPodName = domainUid + "-managed-server1"; String configServerPodName = domainUid + "-config-cluster-server1"; @@ -443,7 +443,7 @@ public void testDynamicClusterRestart() { @Order(4) @Test @DisplayName("Restart the Domain with serverStartPolicy") - public void testDomainRestart() { + void testDomainRestart() { String configServerPodName = domainUid + "-config-cluster-server1"; String standaloneServerPodName = domainUid + "-standalone-managed"; @@ -533,7 +533,7 @@ public void testDomainRestart() { @Order(5) @Test @DisplayName("Start/stop config cluster managed server by updating serverStartPolicy to ALWAYS/IF_NEEDED") - public void testConfigClusterStartServerAlways() { + void testConfigClusterStartServerAlways() { String serverName = "config-cluster-server2"; String serverPodName = domainUid + "-" + serverName; @@ -573,7 +573,7 @@ public void testConfigClusterStartServerAlways() { @Order(6) @Test @DisplayName("Start/stop dynamic cluster managed server by updating serverStartPolicy to ALWAYS/IF_NEEDED") - public void testDynamicClusterStartServerAlways() { + void testDynamicClusterStartServerAlways() { String serverName = "managed-server2"; String serverPodName = domainUid + "-" + serverName; @@ -616,7 +616,7 @@ public void testDynamicClusterStartServerAlways() { @Order(7) @Test @DisplayName("Stop/Start a running config cluster managed server and verify the replica count is maintained") - public void testConfigClusterReplicaCountIsMaintained() { + void testConfigClusterReplicaCountIsMaintained() { String serverName = "config-cluster-server1"; String serverPodName = domainUid + "-" + serverName; String serverPodName2 = domainUid + "-config-cluster-server2"; @@ -662,7 +662,7 @@ public void testConfigClusterReplicaCountIsMaintained() { @Order(8) @Test @DisplayName("Stop/Start a running dynamic cluster managed server and verify the replica count ") - public void testDynamicClusterReplicaCountIsMaintained() { + void testDynamicClusterReplicaCountIsMaintained() { String serverPodName = domainUid + "-managed-server1"; String serverPodName2 = domainUid + "-managed-server2"; String keepReplicaCountConstantParameter = "-k"; @@ -701,7 +701,7 @@ public void testDynamicClusterReplicaCountIsMaintained() { @Order(9) @Test @DisplayName("Restart the standalone managed server with serverStartPolicy ALWAYS") - public void testStandaloneManagedRestartAlways() { + void testStandaloneManagedRestartAlways() { String serverName = "standalone-managed"; String serverPodName = domainUid + "-" + serverName; @@ -741,7 +741,7 @@ public void testStandaloneManagedRestartAlways() { @Order(10) @Test @DisplayName("Restart the standalone managed server with serverStartPolicy IF_NEEDED") - public void testStandaloneManagedRestartIfNeeded() { + void testStandaloneManagedRestartIfNeeded() { String serverName = "standalone-managed"; String serverPodName = domainUid + "-" + serverName; @@ -776,7 +776,7 @@ public void testStandaloneManagedRestartIfNeeded() { @Order(11) @Test @DisplayName("Restart the standalone managed server with sample script") - public void testStandaloneManagedRestart() { + void testStandaloneManagedRestart() { String serverName = "standalone-managed"; String serverPodName = domainUid + "-" + serverName; String keepReplicaCountConstantParameter = "-k"; @@ -824,7 +824,7 @@ public void testStandaloneManagedRestart() { @Order(12) @Test @DisplayName("Pick a dynamic cluster managed server randomly within the max cluster size and verify it starts") - public void testStartDynamicClusterServerRandomlyPicked() { + void testStartDynamicClusterServerRandomlyPicked() { String serverName = "managed-server3"; String serverPodName3 = domainUid + "-" + serverName; String serverPodName1 = domainUid + "-managed-server1"; @@ -854,7 +854,7 @@ public void testStartDynamicClusterServerRandomlyPicked() { @Order(13) @Test @DisplayName("Verify that the sample script can not stop or start non-existing components") - public void testRestartNonExistingComponent() { + void testRestartNonExistingComponent() { String wrongServerName = "ms1"; String regex = ".*" + wrongServerName + ".*\\s*is not part"; @@ -912,7 +912,7 @@ public void testRestartNonExistingComponent() { @Order(14) @Test @DisplayName("Verify that the sample script can not start a server that exceeds the max cluster size") - public void testStartManagedServerBeyondMaxClusterLimit() { + void testStartManagedServerBeyondMaxClusterLimit() { String configServerName = "config-cluster-server3"; String dynServerName = "managed-server6"; @@ -939,7 +939,7 @@ public void testStartManagedServerBeyondMaxClusterLimit() { @Order(15) @Test @DisplayName("verify the operator logs warning message when starting a server that exceeds max cluster size") - public void testOperatorLogWarningMsg() { + void testOperatorLogWarningMsg() { String operatorPodName = assertDoesNotThrow(() -> getOperatorPodName(OPERATOR_RELEASE_NAME, opNamespace)); logger.info("operator pod name: {0}", operatorPodName); @@ -969,7 +969,7 @@ public void testOperatorLogWarningMsg() { @Order(16) @Test @DisplayName("Manage dynamic cluster server in absence of Administration Server") - public void testDynamicServerLifeCycleWithoutAdmin() { + void testDynamicServerLifeCycleWithoutAdmin() { String serverName = "managed-server1"; // domainUid + "-" + serverName; String serverPodName = managedServerPrefix + "1"; @@ -1052,7 +1052,7 @@ public void testDynamicServerLifeCycleWithoutAdmin() { @Order(17) @Test @DisplayName("Manage configured cluster server in absence of Administration Server") - public void testConfiguredServerLifeCycleWithoutAdmin() { + void testConfiguredServerLifeCycleWithoutAdmin() { String serverName = "config-cluster-server1"; String serverPodName = domainUid + "-" + serverName; @@ -1124,7 +1124,7 @@ public void testConfiguredServerLifeCycleWithoutAdmin() { @Order(18) @Test @DisplayName("Restart the dynamic cluster managed server using sample scripts with constant replica count") - public void testRestartingMSWithExplicitServerStartStateWhileKeepingReplicaConstant() { + void testRestartingMSWithExplicitServerStartStateWhileKeepingReplicaConstant() { String serverName = managedServerNamePrefix + 1; String serverPodName = managedServerPrefix + 1; String keepReplicasConstant = "-k"; @@ -1149,7 +1149,7 @@ public void testRestartingMSWithExplicitServerStartStateWhileKeepingReplicaConst @Order(19) @Test @DisplayName("Restart the dynamic cluster managed server using sample scripts with varying replica count") - public void testRestartingMSWithExplicitServerStartStateWhileVaryingReplicaCount() { + void testRestartingMSWithExplicitServerStartStateWhileVaryingReplicaCount() { String serverName = managedServerNamePrefix + 1; String serverPodName = managedServerPrefix + 1; String keepReplicasConstant = "-k"; @@ -1180,7 +1180,7 @@ public void testRestartingMSWithExplicitServerStartStateWhileVaryingReplicaCount @Order(20) @Test @DisplayName("Rolling restart the configured cluster with rollCluster.sh script") - public void testConfigClusterRollingRestart() { + void testConfigClusterRollingRestart() { String configServerName = "config-cluster-server1"; String configServerPodName = domainUid + "-" + configServerName; String dynamicServerPodName = domainUid + "-managed-server1"; @@ -1230,7 +1230,7 @@ public void testConfigClusterRollingRestart() { @Order(21) @Test @DisplayName("Rolling restart the dynamic cluster with rollCluster.sh script") - public void testDynamicClusterRollingRestart() { + void testDynamicClusterRollingRestart() { String dynamicServerName = "managed-server1"; String dynamicServerPodName = domainUid + "-" + dynamicServerName; String configServerPodName = domainUid + "-config-cluster-server1"; @@ -1279,7 +1279,7 @@ public void testDynamicClusterRollingRestart() { @Order(22) @Test @DisplayName("Rolling restart the domain with rollDomain.shscript") - public void testConfigDomainRollingRestart() { + void testConfigDomainRollingRestart() { String configServerName = "config-cluster-server1"; String dynamicServerName = "managed-server1"; String configServerPodName = domainUid + "-" + configServerName; @@ -1321,7 +1321,7 @@ public void testConfigDomainRollingRestart() { @Order(23) @Test @DisplayName("Scale the configured cluster with scaleCluster.sh script") - public void testConfigClusterScale() { + void testConfigClusterScale() { int newReplicaCount = 2; String configServerName = "config-cluster-server" + newReplicaCount; String configServerPodName = domainUid + "-" + configServerName; @@ -1370,7 +1370,7 @@ public void testConfigClusterScale() { @Order(24) @Test @DisplayName("Scale the dynamic cluster with scaleCluster.sh script") - public void testDynamicClusterScale() { + void testDynamicClusterScale() { int newReplicaCount = 2; String dynamicServerName = "managed-server" + newReplicaCount; String dynamicServerPodName = domainUid + "-" + dynamicServerName; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSessionMigration.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSessionMigration.java index 49e623a93fe..d8b5fb7bee4 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSessionMigration.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSessionMigration.java @@ -172,7 +172,7 @@ void tearDown() { @Test @Order(1) @DisplayName("Stop the primary server, verify that a new primary server is picked and HTTP session state is migrated") - public void testSessionMigration() { + void testSessionMigration() { final String primaryServerAttr = "primary"; final String secondaryServerAttr = "secondary"; final String sessionCreateTimeAttr = "sessioncreatetime"; @@ -234,7 +234,7 @@ public void testSessionMigration() { @Test @Order(2) @DisplayName("Test that an annotation containing a slash in the name propagates to the server pod") - public void testPodAnnotationWithSlash() { + void testPodAnnotationWithSlash() { String managedServerPodName = domainUid + "-" + finalPrimaryServerName; V1Pod managedServerPod = null; diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItStickySession.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItStickySession.java index d89bae18658..0ea760c1789 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItStickySession.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItStickySession.java @@ -215,7 +215,7 @@ void tearDown() { @Test @DisplayName("Create a Voyager ingress resource and verify that two HTTP connections are sticky to the same server") @DisabledIfEnvironmentVariable(named = "OKD", matches = "true") - public void testSameSessionStickinessUsingVoyager() { + void testSameSessionStickinessUsingVoyager() { final String ingressName = domainUid + "-ingress-host-routing"; final String ingressServiceName = VOYAGER_CHART_NAME + "-" + ingressName; final String channelName = "tcp-80"; @@ -272,7 +272,7 @@ public void testSameSessionStickinessUsingVoyager() { @Test @DisplayName("Create a Traefik ingress resource and verify that two HTTP connections are sticky to the same server") @DisabledIfEnvironmentVariable(named = "OKD", matches = "true") - public void testSameSessionStickinessUsingTraefik() { + void testSameSessionStickinessUsingTraefik() { final String ingressServiceName = traefikHelmParams.getReleaseName(); final String channelName = "web"; @@ -304,7 +304,7 @@ public void testSameSessionStickinessUsingTraefik() { @Test @DisplayName("Create a Traefik ingress resource and verify that two HTTP connections are sticky to the same server") @EnabledIfEnvironmentVariable(named = "OKD", matches = "true") - public void testSameSessionStickinessinOKD() { + void testSameSessionStickinessinOKD() { final String serviceName = domainUid + "-cluster-" + clusterName; //final String channelName = "web"; @@ -340,7 +340,7 @@ public void testSameSessionStickinessinOKD() { @Test @DisplayName("Verify that two HTTP connections are sticky to the same server using cluster service") @DisabledIfEnvironmentVariable(named = "OKD", matches = "true") - public void testSameSessionStickinessUsingClusterService() { + void testSameSessionStickinessUsingClusterService() { //build cluster hostname String hostName = new StringBuffer() .append(domainUid) diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSystemResOverrides.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSystemResOverrides.java index 2b4c055f81f..8817b18173b 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSystemResOverrides.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSystemResOverrides.java @@ -91,7 +91,7 @@ */ @DisplayName("Verify the JMS and WLDF system resources are overridden with values from override files") @IntegrationTest -public class ItSystemResOverrides { +class ItSystemResOverrides { private static String opNamespace = null; private static String domainNamespace = null; @@ -171,7 +171,7 @@ public void initAll(@Namespaces(2) List namespaces) { */ @Test @DisplayName("Test JMS and WLDF system resources override") - public void testJmsWldfSystemResourceOverride() { + void testJmsWldfSystemResourceOverride() { //store the pod creation timestamps storePodCreationTimestamps(); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItT3Channel.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItT3Channel.java index 62158d2763e..1a60b043f6d 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItT3Channel.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItT3Channel.java @@ -126,7 +126,7 @@ public static void initAll(@Namespaces(2) List namespaces) { */ @Test @DisplayName("Test admin server t3 channel access by deploying a application") - public void testAdminServerT3Channel() { + void testAdminServerT3Channel() { // create pull secrets for WebLogic image when running in non Kind Kubernetes cluster // this secret is used only for non-kind cluster diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItTwoDomainsLoadBalancers.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItTwoDomainsLoadBalancers.java index 3ccaee3efe6..098583cadb4 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItTwoDomainsLoadBalancers.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItTwoDomainsLoadBalancers.java @@ -176,7 +176,7 @@ @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @DisplayName("Verify operator manages multiple domains") @IntegrationTest -public class ItTwoDomainsLoadBalancers { +class ItTwoDomainsLoadBalancers { private static final int numberOfDomains = 2; private static final int numberOfOperators = 2; @@ -314,7 +314,7 @@ public static void initAll(@Namespaces(7) List namespaces) { @Order(1) @Test @DisplayName("Create domain on PV using WLST script") - public void testTwoDomainsManagedByTwoOperators() { + void testTwoDomainsManagedByTwoOperators() { // create two domains on PV using WLST createTwoDomainsOnPVUsingWlstAndVerify(); @@ -342,7 +342,7 @@ public void testTwoDomainsManagedByTwoOperators() { */ @Order(2) @Test - public void testTwoDomainsManagedByOneOperatorSharingPV() { + void testTwoDomainsManagedByOneOperatorSharingPV() { // create two domains sharing one PV in default namespace createTwoDomainsSharingPVUsingWlstAndVerify(); @@ -364,7 +364,7 @@ public void testTwoDomainsManagedByOneOperatorSharingPV() { */ @Order(3) @Test - public void testDeployAppAndInstallIngressControllers() { + void testDeployAppAndInstallIngressControllers() { // install and verify Traefik logger.info("Installing Traefik controller using helm"); @@ -446,7 +446,7 @@ public void testDeployAppAndInstallIngressControllers() { @Order(4) @Test @DisplayName("Verify WebLogic admin console is accessible through NGINX path routing with HTTPS protocol") - public void testNginxTLSPathRoutingAdminServer() { + void testNginxTLSPathRoutingAdminServer() { assumeFalse(WEBLOGIC_SLIM, "Skipping the Console Test for slim image"); logger.info("Verifying WebLogic admin console is accessible through NGINX path routing with HTTPS protocol"); for (int i = 0; i < numberOfDomains; i++) { @@ -469,7 +469,7 @@ public void testNginxTLSPathRoutingAdminServer() { @Order(5) @Test @DisplayName("Verify NGINX path routing with HTTPS protocol across two domains") - public void testNginxTLSPathRoutingAcrossDomains() { + void testNginxTLSPathRoutingAcrossDomains() { // verify NGINX path routing with HTTP protocol across two domains logger.info("Verifying NGINX path routing with HTTPS protocol across two domains"); @@ -485,7 +485,7 @@ public void testNginxTLSPathRoutingAcrossDomains() { @Order(6) @Test @DisplayName("Verify WebLogic admin console is accessible through Voyager path routing with HTTPS protocol") - public void testVoyagerTLSPathRoutingAdminServer() { + void testVoyagerTLSPathRoutingAdminServer() { assumeFalse(WEBLOGIC_SLIM, "Skipping the Console Test for slim image"); logger.info("Verifying WebLogic admin console is accessible through Voyager path routing with HTTPS protocol"); String ingressName = "voyager-tls-pathrouting"; @@ -506,7 +506,7 @@ public void testVoyagerTLSPathRoutingAdminServer() { @Order(7) @Test @DisplayName("Verify WebLogic admin console is accessible through Traefik host routing with HTTP protocol") - public void testTraefikHostRoutingAdminServer() { + void testTraefikHostRoutingAdminServer() { assumeFalse(WEBLOGIC_SLIM, "Skipping the Console Test for slim image"); logger.info("Verifying WebLogic admin console is accessible through Traefik host routing with HTTP protocol"); for (String domainUid : domainUids) { @@ -524,7 +524,7 @@ public void testTraefikHostRoutingAdminServer() { @Order(8) @Test @DisplayName("Verify Traefik host routing with HTTP protocol across two domains") - public void testTraefikHttpHostRoutingAcrossDomains() { + void testTraefikHttpHostRoutingAcrossDomains() { // verify Traefik host routing with HTTP protocol across two domains logger.info("Verifying Traefik host routing with HTTP protocol across two domains"); @@ -542,7 +542,7 @@ public void testTraefikHttpHostRoutingAcrossDomains() { @Order(9) @Test @DisplayName("Verify Traefik host routing with HTTPS protocol across two domains") - public void testTraefikHttpsHostRoutingAcrossDomains() { + void testTraefikHttpsHostRoutingAcrossDomains() { logger.info("Verifying Traefik host routing with HTTPS protocol across two domains"); for (String domainUid : domainUids) { @@ -557,7 +557,7 @@ public void testTraefikHttpsHostRoutingAcrossDomains() { @Order(10) @Test @DisplayName("Verify Traefik path routing with HTTP protocol across two domains") - public void testTraefikPathRoutingAcrossDomains() { + void testTraefikPathRoutingAcrossDomains() { logger.info("Verifying Traefik path routing with HTTP protocol across two domains"); for (String domainUid : domainUids) { @@ -574,7 +574,7 @@ public void testTraefikPathRoutingAcrossDomains() { @Order(11) @Test @DisplayName("Verify Voyager host routing with HTTP protocol across two domains") - public void testVoyagerHostHttpRoutingAcrossDomains() { + void testVoyagerHostHttpRoutingAcrossDomains() { // verify Voyager host routing with HTTP protocol across two domains logger.info("Verifying Voyager host routing with HTTP protocol across two domains"); @@ -594,7 +594,7 @@ public void testVoyagerHostHttpRoutingAcrossDomains() { @Order(12) @Test @DisplayName("Verify Voyager host routing with HTTPS protocol across two domains") - public void testVoyagerHostHttpsRoutingAcrossDomains() { + void testVoyagerHostHttpsRoutingAcrossDomains() { // verify Voyager host routing with HTTPS protocol across two domains logger.info("Verifying Voyager host routing with HTTPS protocol across two domains"); @@ -614,7 +614,7 @@ public void testVoyagerHostHttpsRoutingAcrossDomains() { @Order(13) @Test @DisplayName("Verify Voyager path routing with HTTP protocol across two domains") - public void testVoyagerPathRoutingAcrossDomains() { + void testVoyagerPathRoutingAcrossDomains() { // verify Voyager path routing with HTTP protocol across two domains logger.info("Verifying Voyager path routing with HTTP protocol across two domains"); @@ -635,7 +635,7 @@ public void testVoyagerPathRoutingAcrossDomains() { @Order(14) @Test @DisplayName("verify Apache load balancer default sample through HTTP channel") - public void testApacheLoadBalancingDefaultSample() { + void testApacheLoadBalancingDefaultSample() { // verify Apache default sample logger.info("Verifying Apache default sample"); @@ -654,7 +654,7 @@ public void testApacheLoadBalancingDefaultSample() { @Order(15) @Test @DisplayName("verify Apache load balancer custom sample through HTTP and HTTPS channel") - public void testApacheLoadBalancingCustomSample() { + void testApacheLoadBalancingCustomSample() { // verify Apache custom sample logger.info("Verifying Apache custom sample"); @@ -678,7 +678,7 @@ public void testApacheLoadBalancingCustomSample() { @Order(16) @Test @DisplayName("verify NGINX host routing with HTTP protocol across two domains") - public void testNginxHttpHostRoutingAcrossDomains() { + void testNginxHttpHostRoutingAcrossDomains() { // verify NGINX host routing with HTTP protocol logger.info("Verifying NGINX host routing with HTTP protocol"); @@ -697,7 +697,7 @@ public void testNginxHttpHostRoutingAcrossDomains() { @Order(17) @Test @DisplayName("verify NGINX host routing with https protocol across two domains") - public void testNginxHttpsHostRoutingAcrossDomains() { + void testNginxHttpsHostRoutingAcrossDomains() { // verify NGINX host routing with HTTPS protocol across two domains logger.info("Verifying NGINX host routing with HTTPS protocol across two domains"); @@ -715,7 +715,7 @@ public void testNginxHttpsHostRoutingAcrossDomains() { @Order(18) @Test @DisplayName("Verify NGINX path routing with HTTP protocol across two domains") - public void testNginxPathRoutingAcrossDomains() { + void testNginxPathRoutingAcrossDomains() { // verify NGINX path routing with HTTP protocol across two domains logger.info("Verifying NGINX path routing with HTTP protocol across two domains"); @@ -733,7 +733,7 @@ public void testNginxPathRoutingAcrossDomains() { @Order(19) @Test @DisplayName("Verify Voyager path routing with HTTPS protocol across two domains") - public void testVoyagerTLSPathRoutingAcrossDomains() { + void testVoyagerTLSPathRoutingAcrossDomains() { // verify Voyager path routing with HTTP protocol across two domains logger.info("Verifying Voyager path routing with HTTPS protocol across two domains"); @@ -750,7 +750,7 @@ public void testVoyagerTLSPathRoutingAcrossDomains() { @Order(20) @Test @DisplayName("Verify WebLogic admin console is accessible through Traefik path routing with HTTPS protocol") - public void testTraefikTLSPathRoutingAdminServer() { + void testTraefikTLSPathRoutingAdminServer() { assumeFalse(WEBLOGIC_SLIM, "Skipping the Console Test for slim image"); logger.info("Verifying WebLogic admin console is accessible through Traefik path routing with HTTPS protocol"); @@ -770,7 +770,7 @@ public void testTraefikTLSPathRoutingAdminServer() { @Order(21) @Test @DisplayName("Verify Traefik path routing with HTTPS protocol across two domains") - public void testTraefikTLSPathRoutingAcrossDomains() { + void testTraefikTLSPathRoutingAcrossDomains() { // verify Voyager path routing with HTTP protocol across two domains logger.info("Verifying Traefik path routing with HTTPS protocol across two domains"); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItUsabilityOperatorHelmChart.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItUsabilityOperatorHelmChart.java index dfdfb7fba10..5d5824097cd 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItUsabilityOperatorHelmChart.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItUsabilityOperatorHelmChart.java @@ -204,7 +204,7 @@ public void tearDownAll() { @Test @DisplayName("install operator helm chart and domain, " + " then uninstall operator helm chart and verify the domain is still running") - public void testDeleteOperatorButNotDomain() { + void testDeleteOperatorButNotDomain() { // install and verify operator logger.info("Installing and verifying operator"); HelmParams opHelmParams = installAndVerifyOperator(opNamespace, domain1Namespace).getHelmParams(); @@ -293,7 +293,7 @@ public void testDeleteOperatorButNotDomain() { @Test @DisplayName("Install operator helm chart and domain, then uninstall operator helm chart, " + " install operator helm chart again and verify it can still manage domain") - public void testCreateDeleteCreateOperatorButNotDomain() { + void testCreateDeleteCreateOperatorButNotDomain() { String opReleaseName = OPERATOR_RELEASE_NAME; HelmParams op1HelmParams = new HelmParams().releaseName(opReleaseName) .namespace(opNamespace) @@ -356,7 +356,7 @@ public void testCreateDeleteCreateOperatorButNotDomain() { @Test @DisplayName("Create domain1, managed by operator and domain2, upgrade operator to add domain2," + "delete domain1 , verify operator management for domain2 and no access to domain1") - public void testAddRemoveDomainNameSpacesOnOperator() { + void testAddRemoveDomainNameSpacesOnOperator() { String opReleaseName = OPERATOR_RELEASE_NAME; HelmParams op1HelmParams = new HelmParams().releaseName(opReleaseName) @@ -466,7 +466,7 @@ public void testAddRemoveDomainNameSpacesOnOperator() { */ @Test @DisplayName("Negative test to install two operators sharing the same namespace") - public void testCreateSecondOperatorUsingSameOperatorNsNegativeInstall() { + void testCreateSecondOperatorUsingSameOperatorNsNegativeInstall() { HelmParams opHelmParams = installAndVerifyOperator(opNamespace, domain1Namespace).getHelmParams(); if (!isDomain1Running) { logger.info("Installing and verifying domain"); @@ -508,7 +508,7 @@ public void testCreateSecondOperatorUsingSameOperatorNsNegativeInstall() { */ @Test @DisplayName("Negative test to install two operators sharing the same domain namespace") - public void testSecondOpSharingSameDomainNamespacesNegativeInstall() { + void testSecondOpSharingSameDomainNamespacesNegativeInstall() { // install and verify operator1 logger.info("Installing and verifying operator1"); HelmParams opHelmParams = installAndVerifyOperator(opNamespace, domain2Namespace).getHelmParams(); @@ -549,7 +549,7 @@ public void testSecondOpSharingSameDomainNamespacesNegativeInstall() { */ @Test @DisplayName("Negative test to try to create the operator with not preexisted namespace") - public void testSecondOpSharingSameExternalRestPortNegativeInstall() { + void testSecondOpSharingSameExternalRestPortNegativeInstall() { String opServiceAccount = opNamespace + "-sa"; String op2ServiceAccount = op2Namespace + "-sa2"; String opReleaseName = OPERATOR_RELEASE_NAME + "1"; @@ -594,7 +594,7 @@ public void testSecondOpSharingSameExternalRestPortNegativeInstall() { */ @Test @DisplayName("Negative test to try to create the operator with not preexisted namespace") - public void testNotPreCreatedOpNsCreateOperatorNegativeInstall() { + void testNotPreCreatedOpNsCreateOperatorNegativeInstall() { String opReleaseName = OPERATOR_RELEASE_NAME + "2"; HelmParams op2HelmParams = new HelmParams().releaseName(opReleaseName) .namespace("ns-somens") @@ -622,7 +622,7 @@ public void testNotPreCreatedOpNsCreateOperatorNegativeInstall() { */ @Test @DisplayName("Test to create the operator with empty string for domains namespace") - public void testCreateWithEmptyDomainNamespaceInstall() { + void testCreateWithEmptyDomainNamespaceInstall() { String opReleaseName = OPERATOR_RELEASE_NAME; String opServiceAccount = op2Namespace + "-sa"; HelmParams op2HelmParams = new HelmParams().releaseName(opReleaseName) @@ -687,7 +687,7 @@ public void testCreateWithEmptyDomainNamespaceInstall() { @Test @DisplayName("Install operator with non existing operator service account and verify helm chart is failed, " + "create service account and verify the operator is running") - public void testNotPreexistedOpServiceAccountCreateOperatorNegativeInstall() { + void testNotPreexistedOpServiceAccountCreateOperatorNegativeInstall() { String opServiceAccount = op2Namespace + "-sa"; String opReleaseName = OPERATOR_RELEASE_NAME + "1"; String errorMsg = null; @@ -760,7 +760,7 @@ public void testNotPreexistedOpServiceAccountCreateOperatorNegativeInstall() { @Test @DisplayName("Create domain4, domain5 in the same namespace managed by operator ," + " verify scaling via scalingAction.sh script and restAPI") - public void testTwoDomainsInSameNameSpaceOnOperator() { + void testTwoDomainsInSameNameSpaceOnOperator() { String opReleaseName = OPERATOR_RELEASE_NAME; HelmParams op1HelmParams = new HelmParams().releaseName(opReleaseName) diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItWlsSamples.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItWlsSamples.java index 574397045c8..ed3fa5e60be 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItWlsSamples.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItWlsSamples.java @@ -70,7 +70,7 @@ @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @DisplayName("Verify the domain on pv, domain in image samples using wlst and wdt and domain lifecycle scripts") @IntegrationTest -public class ItWlsSamples { +class ItWlsSamples { public static final String SERVER_LIFECYCLE = "Server"; public static final String CLUSTER_LIFECYCLE = "Cluster"; @@ -155,7 +155,7 @@ public static void initAll(@Namespaces(5) List namespaces) { @ParameterizedTest @MethodSource("paramProvider") @DisplayName("Test samples using domain in image") - public void testSampleDomainInImage(String model) { + void testSampleDomainInImage(String model) { String domainName = model.split(":")[1]; String script = model.split(":")[0]; String imageName = (KIND_REPO != null @@ -217,7 +217,7 @@ public void testSampleDomainInImage(String model) { @ParameterizedTest @MethodSource("paramProvider") @DisplayName("Test samples using domain in pv") - public void testSampleDomainInPv(String model) { + void testSampleDomainInPv(String model) { String domainName = model.split(":")[1]; String script = model.split(":")[0]; @@ -268,7 +268,7 @@ public void testSampleDomainInPv(String model) { @Order(3) @Test @DisplayName("Test server lifecycle samples scripts") - public void testServerLifecycleScripts() { + void testServerLifecycleScripts() { // Verify that stopServer script execution shuts down server pod and replica count is decremented String serverName = managedServerNameBase + "1"; @@ -292,7 +292,7 @@ public void testServerLifecycleScripts() { @Order(4) @Test @DisplayName("Test server lifecycle samples scripts with constant replica count") - public void testServerLifecycleScriptsWithConstantReplicaCount() { + void testServerLifecycleScriptsWithConstantReplicaCount() { String serverName = managedServerNameBase + "1"; String keepReplicaCountConstantParameter = "-k"; // Verify that replica count is not changed when using "-k" parameter and a replacement server is started @@ -318,7 +318,7 @@ public void testServerLifecycleScriptsWithConstantReplicaCount() { @Order(5) @Test @DisplayName("Test cluster lifecycle scripts") - public void testClusterLifecycleScripts() { + void testClusterLifecycleScripts() { // Verify all clustered server pods are shut down after stopCluster script execution executeLifecycleScript(STOP_CLUSTER_SCRIPT, CLUSTER_LIFECYCLE, clusterName); @@ -339,7 +339,7 @@ public void testClusterLifecycleScripts() { @Order(6) @Test @DisplayName("Test domain lifecycle scripts") - public void testDomainLifecycleScripts() { + void testDomainLifecycleScripts() { // Verify all WebLogic server instance pods are shut down after stopDomain script execution executeLifecycleScript(STOP_DOMAIN_SCRIPT, DOMAIN, null); for (int i = 1; i <= replicaCount; i++) { @@ -363,7 +363,7 @@ public void testDomainLifecycleScripts() { @Order(7) @Test @DisplayName("Manage Traefik Ingress Controller with setupLoadBalancer") - public void testTraefikIngressController() { + void testTraefikIngressController() { setupSample(); Path scriptBase = Paths.get(tempSamplePath.toString(), "charts/util"); setupLoadBalancer(scriptBase, "traefik", " -c -n " + traefikNamespace); @@ -376,7 +376,7 @@ public void testTraefikIngressController() { @Order(8) @Test @DisplayName("Manage Voyager Ingress Controller with setupLoadBalancer") - public void testVoyagerIngressController() { + void testVoyagerIngressController() { setupSample(); Path scriptBase = Paths.get(tempSamplePath.toString(), "charts/util"); setupLoadBalancer(scriptBase, "voyager", " -c -n " + voyagerNamespace); @@ -389,7 +389,7 @@ public void testVoyagerIngressController() { @Order(9) @Test @DisplayName("Manage Nginx Ingress Controller with setupLoadBalancer") - public void testNginxIngressController() { + void testNginxIngressController() { setupSample(); Path scriptBase = Paths.get(tempSamplePath.toString(), "charts/util"); setupLoadBalancer(scriptBase, "nginx", " -c -n " + nginxNamespace); diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/K8sEvents.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/K8sEvents.java index eb33b62c96b..a3594d3635e 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/K8sEvents.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/K8sEvents.java @@ -14,7 +14,6 @@ import io.kubernetes.client.openapi.ApiException; import io.kubernetes.client.openapi.models.CoreV1Event; import io.kubernetes.client.util.Yaml; -import oracle.weblogic.kubernetes.ItKubernetesEvents; import oracle.weblogic.kubernetes.TestConstants; import oracle.weblogic.kubernetes.actions.TestActions; import oracle.weblogic.kubernetes.actions.impl.primitive.Kubernetes; @@ -188,7 +187,7 @@ public static CoreV1Event getEvent(String opNamespace, String domainNamespace, S } } } catch (ApiException ex) { - Logger.getLogger(ItKubernetesEvents.class.getName()).log(Level.SEVERE, null, ex); + Logger.getLogger(K8sEvents.class.getName()).log(Level.SEVERE, null, ex); } return null; } @@ -223,7 +222,7 @@ public static Callable checkDomainEventWithCount( } } } catch (ApiException ex) { - Logger.getLogger(ItKubernetesEvents.class.getName()).log(Level.SEVERE, null, ex); + Logger.getLogger(K8sEvents.class.getName()).log(Level.SEVERE, null, ex); } return false; }; @@ -252,7 +251,7 @@ public static int getDomainEventCount( } } } catch (ApiException ex) { - Logger.getLogger(ItKubernetesEvents.class.getName()).log(Level.SEVERE, null, ex); + Logger.getLogger(K8sEvents.class.getName()).log(Level.SEVERE, null, ex); } return 0; } @@ -279,7 +278,7 @@ public static int getEventCount( } } } catch (ApiException ex) { - Logger.getLogger(ItKubernetesEvents.class.getName()).log(Level.SEVERE, null, ex); + Logger.getLogger(K8sEvents.class.getName()).log(Level.SEVERE, null, ex); return -1; } return count; @@ -304,7 +303,7 @@ public static Callable checkPodEventLoggedOnce( .filter(e -> e.getReason().contains(reason)) .filter(e -> isEqualOrAfter(timestamp, e)).collect(Collectors.toList()).size()); } catch (ApiException ex) { - Logger.getLogger(ItKubernetesEvents.class.getName()).log(Level.SEVERE, null, ex); + Logger.getLogger(K8sEvents.class.getName()).log(Level.SEVERE, null, ex); } return false; }; @@ -320,7 +319,7 @@ private static Boolean isEventLoggedOnce(String serverName, int count) { } private static Boolean logErrorAndFail(String serverName, int count) { - Logger.getLogger(ItKubernetesEvents.class.getName()).log(Level.SEVERE, + Logger.getLogger(K8sEvents.class.getName()).log(Level.SEVERE, "Pod " + serverName + " restarted " + count + " times"); return false; } diff --git a/integration-tests/src/test/resources/apps/sitconfig/src/java/oracle/weblogic/kubernetes/applications/sitconfig/SitconfigServlet.java b/integration-tests/src/test/resources/apps/sitconfig/src/java/oracle/weblogic/kubernetes/applications/sitconfig/SitconfigServlet.java index 501b434ae59..05ece7c16e6 100644 --- a/integration-tests/src/test/resources/apps/sitconfig/src/java/oracle/weblogic/kubernetes/applications/sitconfig/SitconfigServlet.java +++ b/integration-tests/src/test/resources/apps/sitconfig/src/java/oracle/weblogic/kubernetes/applications/sitconfig/SitconfigServlet.java @@ -94,7 +94,7 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re } } - public void testSystemResourcesJmsAttributeChange(PrintWriter out) { + void testSystemResourcesJmsAttributeChange(PrintWriter out) { String jmsModuleName = "ClusterJmsSystemResource"; String topicName = "UniformReplicatedTestTopic"; @@ -135,7 +135,7 @@ protected JMSSystemResourceMBean getJmsSystemModule(String resourceName, PrintWr * diagnostics-WLDF-MODULE-0.xml. The added elements wldf-instrumentation-monitor harvested-type are expected to show * up in the domain configuration. */ - public void testSystemResourcesWldfAttributeChange(PrintWriter out) { + void testSystemResourcesWldfAttributeChange(PrintWriter out) { final String wldfModName0 = "WLDF-MODULE-0"; // verify the changed properties diff --git a/json-schema-generator/src/test/java/oracle/kubernetes/json/KubernetesApiNamesTest.java b/json-schema-generator/src/test/java/oracle/kubernetes/json/KubernetesApiNamesTest.java index b6b5e7ebe3d..bd054ed1b86 100644 --- a/json-schema-generator/src/test/java/oracle/kubernetes/json/KubernetesApiNamesTest.java +++ b/json-schema-generator/src/test/java/oracle/kubernetes/json/KubernetesApiNamesTest.java @@ -11,20 +11,20 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class KubernetesApiNamesTest { +class KubernetesApiNamesTest { @Test - public void matchTopLevelClass() { + void matchTopLevelClass() { assertThat(KubernetesApiNames.matches("io.k8s.api.core.v1.EnvVar", V1EnvVar.class), is(true)); } @Test - public void matchNestedClass() { + void matchNestedClass() { assertThat(KubernetesApiNames.matches("io.k8s.api.core.v1.EnvVar", V1.EnvVar.class), is(true)); } @Test - public void dontMatchOthers() { + void dontMatchOthers() { assertThat(KubernetesApiNames.matches("abc", V1EnvVarSource.class), is(false)); assertThat( KubernetesApiNames.matches("io.k8s.api.core.v1.EnvVar", V1EnvVarSource.class), is(false)); diff --git a/json-schema-generator/src/test/java/oracle/kubernetes/json/SchemaGeneratorTest.java b/json-schema-generator/src/test/java/oracle/kubernetes/json/SchemaGeneratorTest.java index 0371cb1344f..ad8bee5971c 100644 --- a/json-schema-generator/src/test/java/oracle/kubernetes/json/SchemaGeneratorTest.java +++ b/json-schema-generator/src/test/java/oracle/kubernetes/json/SchemaGeneratorTest.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public class SchemaGeneratorTest { +class SchemaGeneratorTest { private static final String K8S_SCHEMA_URL = "https://github.com/garethr/kubernetes-json-schema/blob/master/v1.9.0/_definitions.json"; @@ -93,7 +93,7 @@ public void setUp() throws Exception { } @Test - public void generateSchemaForBoolean() throws NoSuchFieldException { + void generateSchemaForBoolean() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("unAnnotatedBoolean")); assertThat(schema, hasJsonPath("$.unAnnotatedBoolean.type", equalTo("boolean"))); @@ -106,28 +106,28 @@ private Object generateForField(Field field) { } @Test - public void generateSchemaForInteger() throws NoSuchFieldException { + void generateSchemaForInteger() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("unAnnotatedInteger")); assertThat(schema, hasJsonPath("$.unAnnotatedInteger.type", equalTo("number"))); } @Test - public void generateSchemaForLong() throws NoSuchFieldException { + void generateSchemaForLong() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("unAnnotatedLong")); assertThat(schema, hasJsonPath("$.unAnnotatedLong.type", equalTo("number"))); } @Test - public void generateSchemaForString() throws NoSuchFieldException { + void generateSchemaForString() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("unAnnotatedString")); assertThat(schema, hasJsonPath("$.unAnnotatedString.type", equalTo("string"))); } @Test - public void generateSchemaForIntArray() throws NoSuchFieldException { + void generateSchemaForIntArray() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("intArray")); assertThat(schema, hasJsonPath("$.intArray.type", equalTo("array"))); @@ -135,14 +135,14 @@ public void generateSchemaForIntArray() throws NoSuchFieldException { } @Test - public void doNotGenerateSchemaForVolatileFields() throws NoSuchFieldException { + void doNotGenerateSchemaForVolatileFields() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("ignoreMe")); assertThat(schema, hasNoJsonPath("$.ignoreMe")); } @Test - public void generateSchemaForEnum() throws NoSuchFieldException { + void generateSchemaForEnum() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("colors")); assertThat(schema, hasJsonPath("$.colors.type", equalTo("string"))); @@ -151,7 +151,7 @@ public void generateSchemaForEnum() throws NoSuchFieldException { } @Test - public void generateSchemaForEnumAnnotatedString() throws NoSuchFieldException { + void generateSchemaForEnumAnnotatedString() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("colorString")); assertThat(schema, hasJsonPath("$.colorString.type", equalTo("string"))); @@ -161,7 +161,7 @@ public void generateSchemaForEnumAnnotatedString() throws NoSuchFieldException { } @Test - public void generateSchemaForEnumAnnotatedStringWithQualifier() throws NoSuchFieldException { + void generateSchemaForEnumAnnotatedStringWithQualifier() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("twoColorString")); assertThat(schema, hasJsonPath("$.twoColorString.type", equalTo("string"))); @@ -170,7 +170,7 @@ public void generateSchemaForEnumAnnotatedStringWithQualifier() throws NoSuchFie } @Test - public void whenIntegerAnnotatedWithMinimumOnly_addToSchema() throws NoSuchFieldException { + void whenIntegerAnnotatedWithMinimumOnly_addToSchema() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("valueWithMinimum")); assertThat(schema, hasJsonPath("$.valueWithMinimum.minimum", equalTo(7))); @@ -178,7 +178,7 @@ public void whenIntegerAnnotatedWithMinimumOnly_addToSchema() throws NoSuchField } @Test - public void whenIntegerAnnotatedWithMaximumOnly_addToSchema() throws NoSuchFieldException { + void whenIntegerAnnotatedWithMaximumOnly_addToSchema() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("valueWithMaximum")); assertThat(schema, hasNoJsonPath("$.valueWithMaximum.minimum")); @@ -186,7 +186,7 @@ public void whenIntegerAnnotatedWithMaximumOnly_addToSchema() throws NoSuchField } @Test - public void whenIntegerAnnotatedWithRange_addToSchema() throws NoSuchFieldException { + void whenIntegerAnnotatedWithRange_addToSchema() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("valueWithRange")); assertThat(schema, hasJsonPath("$.valueWithRange.minimum", equalTo(12))); @@ -194,14 +194,14 @@ public void whenIntegerAnnotatedWithRange_addToSchema() throws NoSuchFieldExcept } @Test - public void whenStringAnnotatedWithPatterne_addToSchema() throws NoSuchFieldException { + void whenStringAnnotatedWithPatterne_addToSchema() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("codeName")); assertThat(schema, hasJsonPath("$.codeName.pattern", equalTo("[A-Z][a-zA-Z_]*"))); } @Test - public void generateSchemaForAnnotatedDouble() throws NoSuchFieldException { + void generateSchemaForAnnotatedDouble() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("annotatedDouble")); assertThat(schema, hasJsonPath("$.annotatedDouble.type", equalTo("number"))); @@ -209,7 +209,7 @@ public void generateSchemaForAnnotatedDouble() throws NoSuchFieldException { } @Test - public void doNotGenerateSchemaForStatics() { + void doNotGenerateSchemaForStatics() { Object schema = generator.generate(SimpleObject.class); assertThat(schema, hasNoJsonPath("$.properties.staticInt")); @@ -217,7 +217,7 @@ public void doNotGenerateSchemaForStatics() { } @Test - public void generateSchemaForEnabledFeature() throws NoSuchFieldException { + void generateSchemaForEnabledFeature() throws NoSuchFieldException { generator.defineEnabledFeatures(List.of("Binding")); Object schema = generator.generate(SimpleObject.class); @@ -225,7 +225,7 @@ public void generateSchemaForEnabledFeature() throws NoSuchFieldException { } @Test - public void doNotGenerateSchemaForDisabledFeature() { + void doNotGenerateSchemaForDisabledFeature() { Object schema = generator.generate(SimpleObject.class); assertThat(schema, hasNoJsonPath("$.properties.fieldAssociatedWithMountFeature")); @@ -234,7 +234,7 @@ public void doNotGenerateSchemaForDisabledFeature() { @SuppressWarnings("unused") @Test - public void generateSchemaForSimpleObject() { + void generateSchemaForSimpleObject() { Object schema = generator.generate(SimpleObject.class); assertThat( @@ -248,14 +248,14 @@ public void generateSchemaForSimpleObject() { } @Test - public void generateReferenceForSimpleObjectField() throws NoSuchFieldException { + void generateReferenceForSimpleObjectField() throws NoSuchFieldException { Object schema = generateForField(getClass().getDeclaredField("simpleObject")); assertThat(schema, hasJsonPath("$.simpleObject.$ref", equalTo("#/definitions/SimpleObject"))); } @Test - public void whenAdditionalPropertiesDisabled_doNotGenerateTheProperty() { + void whenAdditionalPropertiesDisabled_doNotGenerateTheProperty() { generator.setForbidAdditionalProperties(false); Object schema = generator.generate(SimpleObject.class); @@ -264,7 +264,7 @@ public void whenAdditionalPropertiesDisabled_doNotGenerateTheProperty() { } @Test - public void generateSchemaForDerivedObject() { + void generateSchemaForDerivedObject() { Object schema = generator.generate(DerivedObject.class); assertThat(schema, hasJsonPath("$.description", equalTo("A simple object used for testing"))); @@ -283,7 +283,7 @@ public void generateSchemaForDerivedObject() { } @Test - public void generateDefinitionsForReferencedClasses() { + void generateDefinitionsForReferencedClasses() { Object schema = generator.generate(ReferencingObject.class); assertThat( @@ -305,7 +305,7 @@ public void generateDefinitionsForReferencedClasses() { } @Test - public void whenSupportObjectReferencesDisabled_includeNestedClasses() { + void whenSupportObjectReferencesDisabled_includeNestedClasses() { generator.setSupportObjectReferences(false); Object schema = generator.generate(ReferencingObject.class); @@ -357,7 +357,7 @@ void whenFieldIsObjectMapAnnotatedWithPreserveFields_addK8sPreserveElement() thr } @Test - public void generateDefinitionsForTransitiveReferences() { + void generateDefinitionsForTransitiveReferences() { Object schema = generator.generate(TransitiveObject.class); assertThat( @@ -371,7 +371,7 @@ public void generateDefinitionsForTransitiveReferences() { } @Test - public void treatContainerValuesProperties_asArrays() { + void treatContainerValuesProperties_asArrays() { Object schema = generator.generate(TransitiveObject.class); assertThat(schema, hasJsonPath("$.properties.simpleObjects.type", equalTo("array"))); @@ -382,14 +382,14 @@ public void treatContainerValuesProperties_asArrays() { } @Test - public void whenFieldIsDeprecated_includeIt() { + void whenFieldIsDeprecated_includeIt() { Object schema = generator.generate(ReferencingObject.class); assertThat(schema, hasJsonPath("$.properties.deprecatedField.type", equalTo("number"))); } @Test - public void whenObjectDefinedInExternalSchema_useFullReference() throws IOException { + void whenObjectDefinedInExternalSchema_useFullReference() throws IOException { URL schemaUrl = getClass().getResource("k8smini.json"); generator.addExternalSchema(schemaUrl, cacheUrl); Object schema = generator.generate(ExternalReferenceObject.class); @@ -405,7 +405,7 @@ public void whenObjectDefinedInExternalSchema_useFullReference() throws IOExcept } @Test - public void whenObjectDefinedInCachedKubernetesSchema_useFullReference() throws IOException { + void whenObjectDefinedInCachedKubernetesSchema_useFullReference() throws IOException { generator.addExternalSchema(schemaUrl, cacheUrl); Object schema = generator.generate(ExternalReferenceObject.class); @@ -420,7 +420,7 @@ public void whenObjectDefinedInCachedKubernetesSchema_useFullReference() throws } @Test - public void whenObjectDefinedInCachedKubernetesSchema_doNotAddToDefinitions() throws IOException { + void whenObjectDefinedInCachedKubernetesSchema_doNotAddToDefinitions() throws IOException { generator.addExternalSchema(schemaUrl, cacheUrl); Object schema = generator.generate(ExternalReferenceObject.class); @@ -428,7 +428,7 @@ public void whenObjectDefinedInCachedKubernetesSchema_doNotAddToDefinitions() th } @Test - public void whenK8sVersionSpecified_useFullReferenceForK8sObject() throws IOException { + void whenK8sVersionSpecified_useFullReferenceForK8sObject() throws IOException { generator.useKubernetesVersion("1.9.0"); Object schema = generator.generate(ExternalReferenceObject.class); @@ -440,7 +440,7 @@ public void whenK8sVersionSpecified_useFullReferenceForK8sObject() throws IOExce } @Test - public void whenNonCachedK8sVersionSpecified_throwException() { + void whenNonCachedK8sVersionSpecified_throwException() { assertThrows(IOException.class, () -> generator.useKubernetesVersion("1.12.0")); } diff --git a/json-schema-generator/src/test/java/oracle/kubernetes/json/YamlDocGeneratorTest.java b/json-schema-generator/src/test/java/oracle/kubernetes/json/YamlDocGeneratorTest.java index 38011c03745..b42eb52ecae 100644 --- a/json-schema-generator/src/test/java/oracle/kubernetes/json/YamlDocGeneratorTest.java +++ b/json-schema-generator/src/test/java/oracle/kubernetes/json/YamlDocGeneratorTest.java @@ -18,7 +18,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class YamlDocGeneratorTest { +class YamlDocGeneratorTest { private static final String K8S_VERSION = "1.13.5"; private final SchemaGenerator schemaGenerator = new SchemaGenerator(); @SuppressWarnings("unused") @@ -38,7 +38,7 @@ public class YamlDocGeneratorTest { private SimpleObject[] simpleArray; @Test - public void generateMarkdownForProperty() throws NoSuchFieldException { + void generateMarkdownForProperty() throws NoSuchFieldException { String markdown = generateForProperty(getClass().getDeclaredField("annotatedDouble")); assertThat( markdown, containsString(tableEntry("`annotatedDouble`", "number", "An annotated field"))); @@ -61,7 +61,7 @@ private Map generateSchemaForField(Field field) { } @Test - public void whenSchemaHasUknownTypeAndNoReference_useAsSpecified() { + void whenSchemaHasUknownTypeAndNoReference_useAsSpecified() { Map schema = of("anInt", of("type", "integer")); String markdown = new YamlDocGenerator(schema).generateForProperty("anInt", schema); @@ -70,25 +70,25 @@ public void whenSchemaHasUknownTypeAndNoReference_useAsSpecified() { } @Test - public void whenPropertyTypeIsDateTime_doNotGenerateReference() throws NoSuchFieldException { + void whenPropertyTypeIsDateTime_doNotGenerateReference() throws NoSuchFieldException { String markdown = generateForProperty(getClass().getDeclaredField("dateTime")); assertThat(markdown, containsString(tableEntry("`dateTime`", "DateTime", ""))); } @Test - public void whenPropertyTypeIsMap_doNotGenerateReference() throws NoSuchFieldException { + void whenPropertyTypeIsMap_doNotGenerateReference() throws NoSuchFieldException { String markdown = generateForProperty(getClass().getDeclaredField("notes")); assertThat(markdown, containsString(tableEntry("`notes`", "Map", ""))); } @Test - public void whenPropertyTypeIsArrayOfStrings_generateType() throws NoSuchFieldException { + void whenPropertyTypeIsArrayOfStrings_generateType() throws NoSuchFieldException { String markdown = generateForProperty(getClass().getDeclaredField("myList")); assertThat(markdown, containsString(tableEntry("`myList`", "Array of string", ""))); } @Test - public void whenPropertyTypeIsReferenceWithDescription_includeBoth() throws NoSuchFieldException { + void whenPropertyTypeIsReferenceWithDescription_includeBoth() throws NoSuchFieldException { String markdown = generateForProperty(getClass().getDeclaredField("simpleUsage")); assertThat( markdown, @@ -101,7 +101,7 @@ private String linkTo(String section, String anchor) { } @Test - public void whenPropertyTypeIsReferenceArrayWithDescription_includeBoth() + void whenPropertyTypeIsReferenceArrayWithDescription_includeBoth() throws NoSuchFieldException { String markdown = generateForProperty(getClass().getDeclaredField("simpleArray")); assertThat( @@ -114,7 +114,7 @@ public void whenPropertyTypeIsReferenceArrayWithDescription_includeBoth() } @Test - public void generateMarkdownForSimpleObject() { + void generateMarkdownForSimpleObject() { YamlDocGenerator generator = new YamlDocGenerator(new HashMap<>()); String markdown = generator.generateForClass(generateSchema(SimpleObject.class)); assertThat( @@ -133,7 +133,7 @@ private Map generateSchema(Class aaClass) { } @Test - public void generateMarkdownForSimpleObjectWithHeader() { + void generateMarkdownForSimpleObjectWithHeader() { Map schema = generateSchema(SimpleObject.class); YamlDocGenerator generator = new YamlDocGenerator(schema); String markdown = generator.generate("simpleObject"); @@ -151,7 +151,7 @@ public void generateMarkdownForSimpleObjectWithHeader() { } @Test - public void generateMarkdownForObjectWithReferences() { + void generateMarkdownForObjectWithReferences() { Map schema = generateSchema(ReferencingObject.class); YamlDocGenerator generator = new YamlDocGenerator(schema); String markdown = generator.generate("start"); @@ -169,7 +169,7 @@ public void generateMarkdownForObjectWithReferences() { } @Test - public void whenKubernetesSchemaNotUsed_kubernetesMarkdownIsNull() { + void whenKubernetesSchemaNotUsed_kubernetesMarkdownIsNull() { Map schema = generateSchema(ReferencingObject.class); YamlDocGenerator generator = new YamlDocGenerator(schema); generator.generate("start"); @@ -177,7 +177,7 @@ public void whenKubernetesSchemaNotUsed_kubernetesMarkdownIsNull() { } @Test - public void generateMarkdownWithReferencedSections() { + void generateMarkdownWithReferencedSections() { Map schema = generateSchema(ReferencingObject.class); YamlDocGenerator generator = new YamlDocGenerator(schema); String markdown = generator.generate("start"); @@ -215,7 +215,7 @@ private String tableDivider(int numColumns) { } @Test - public void whenExternalSchemaSpecified_returnFileName() throws IOException { + void whenExternalSchemaSpecified_returnFileName() throws IOException { schemaGenerator.useKubernetesVersion(K8S_VERSION); Map schema = schemaGenerator.generate(KubernetesReferenceObject.class); @@ -228,7 +228,7 @@ public void whenExternalSchemaSpecified_returnFileName() throws IOException { } @Test - public void whenExternalSchemaSpecified_generateWithReferencedSections() throws IOException { + void whenExternalSchemaSpecified_generateWithReferencedSections() throws IOException { schemaGenerator.useKubernetesVersion(K8S_VERSION); Map schema = schemaGenerator.generate(KubernetesReferenceObject.class); @@ -249,7 +249,7 @@ public void whenExternalSchemaSpecified_generateWithReferencedSections() throws } @Test - public void whenExternalSchemaSpecified_generateMarkdownForIt() throws IOException { + void whenExternalSchemaSpecified_generateMarkdownForIt() throws IOException { schemaGenerator.useKubernetesVersion(K8S_VERSION); Map schema = schemaGenerator.generate(KubernetesReferenceObject.class); @@ -273,7 +273,7 @@ public void whenExternalSchemaSpecified_generateMarkdownForIt() throws IOExcepti } @Test - public void whenExternalSchemaSpecified_generateMarkdownForItsLinks() throws IOException { + void whenExternalSchemaSpecified_generateMarkdownForItsLinks() throws IOException { schemaGenerator.useKubernetesVersion(K8S_VERSION); Map schema = schemaGenerator.generate(KubernetesReferenceObject.class); @@ -286,7 +286,7 @@ public void whenExternalSchemaSpecified_generateMarkdownForItsLinks() throws IOE } @Test - public void whenExternalSchemaSpecified_generateMarkdownForItsDependencies() throws IOException { + void whenExternalSchemaSpecified_generateMarkdownForItsDependencies() throws IOException { schemaGenerator.useKubernetesVersion(K8S_VERSION); Map schema = schemaGenerator.generate(KubernetesReferenceObject.class); diff --git a/kubernetes/src/test/java/oracle/kubernetes/operator/create/CreateOperatorGeneratedFilesTestBase.java b/kubernetes/src/test/java/oracle/kubernetes/operator/create/CreateOperatorGeneratedFilesTestBase.java index 1f6baa9fc40..cb0ce4055b4 100644 --- a/kubernetes/src/test/java/oracle/kubernetes/operator/create/CreateOperatorGeneratedFilesTestBase.java +++ b/kubernetes/src/test/java/oracle/kubernetes/operator/create/CreateOperatorGeneratedFilesTestBase.java @@ -68,7 +68,7 @@ * Base class for testing that the all artifacts in the yaml files that create-weblogic-operator.sh * generates */ -public abstract class CreateOperatorGeneratedFilesTestBase { +abstract class CreateOperatorGeneratedFilesTestBase { private static OperatorValues inputs; private static GeneratedOperatorObjects generatedFiles; @@ -87,7 +87,7 @@ static void setup(OperatorYamlFactory factory, OperatorValues val) throws Except } @Test - public void generatesCorrect_operatorConfigMap() { + void generatesCorrect_operatorConfigMap() { assertThat( getActualWeblogicOperatorConfigMap(), yamlEqualTo(getExpectedWeblogicOperatorConfigMap())); } @@ -121,7 +121,7 @@ private V1ConfigMap getExpectedWeblogicOperatorConfigMap() { protected abstract String getExpectedExternalWeblogicOperatorCert(); @Test - public void generatesCorrect_operatorSecrets() { + void generatesCorrect_operatorSecrets() { assertThat( getActualWeblogicOperatorSecrets(), yamlEqualTo(getExpectedWeblogicOperatorSecrets())); } @@ -157,7 +157,7 @@ private boolean isExternalRestPortEnabled() { protected abstract String getExpectedExternalWeblogicOperatorKey(); @Test - public void generatesCorrect_operatorDeployment() { + void generatesCorrect_operatorDeployment() { assertThat( getActualWeblogicOperatorDeployment(), yamlEqualTo(getExpectedWeblogicOperatorDeployment())); @@ -265,7 +265,7 @@ private V1Probe createProbe(int initialDelaySeconds, int periodSeconds, String s } @Test - public void generatesCorrect_externalWeblogicOperatorService() { + void generatesCorrect_externalWeblogicOperatorService() { V1Service expected = getExpectedExternalWeblogicOperatorService(); if (expected != null) { assertThat(getGeneratedFiles().getExternalOperatorService(), yamlEqualTo(expected)); @@ -312,7 +312,7 @@ V1Service getExpectedExternalWeblogicOperatorService( } @Test - public void generatesCorrect_internalWeblogicOperatorService() { + void generatesCorrect_internalWeblogicOperatorService() { assertThat( getActualInternalWeblogicOperatorService(), yamlEqualTo(getExpectedInternalWeblogicOperatorService())); @@ -337,7 +337,7 @@ private V1Service getExpectedInternalWeblogicOperatorService() { } @Test - public void generatesCorrect_weblogicOperatorNamespace() { + protected void generatesCorrect_weblogicOperatorNamespace() { assertThat( getActualWeblogicOperatorNamespace(), yamlEqualTo(getExpectedWeblogicOperatorNamespace())); } @@ -355,7 +355,7 @@ private V1Namespace getExpectedWeblogicOperatorNamespace() { } @Test - public void generatesCorrect_weblogicOperatorServiceAccount() { + protected void generatesCorrect_weblogicOperatorServiceAccount() { assertThat( getActualWeblogicOperatorServiceAccount(), yamlEqualTo(getExpectedWeblogicOperatorServiceAccount())); @@ -375,7 +375,7 @@ private V1ServiceAccount getExpectedWeblogicOperatorServiceAccount() { } @Test - public void generatesCorrect_weblogicOperatorClusterRole() { + void generatesCorrect_weblogicOperatorClusterRole() { assertThat( getActualWeblogicOperatorClusterRole(), yamlEqualTo(getExpectedWeblogicOperatorClusterRole())); @@ -427,7 +427,7 @@ private V1ClusterRole getExpectedWeblogicOperatorClusterRole() { } @Test - public void generatesCorrect_weblogicOperatorClusterRoleNonResource() { + void generatesCorrect_weblogicOperatorClusterRoleNonResource() { assertThat( getGeneratedFiles().getWeblogicOperatorClusterRoleNonResource(), yamlEqualTo(getExpectedWeblogicOperatorClusterRoleNonResource())); @@ -443,7 +443,7 @@ private V1ClusterRole getExpectedWeblogicOperatorClusterRoleNonResource() { } @Test - public void generatesCorrect_operatorRoleBinding() { + void generatesCorrect_operatorRoleBinding() { assertThat( getGeneratedFiles().getOperatorRoleBinding(), yamlEqualTo( @@ -467,7 +467,7 @@ public void generatesCorrect_operatorRoleBinding() { } @Test - public void generatesCorrect_operatorRoleBindingNonResource() { + void generatesCorrect_operatorRoleBindingNonResource() { assertThat( getActualOperatorRoleBindingNonResource(), yamlEqualTo(getExpectedOperatorRoleBindingNonResource())); @@ -498,7 +498,7 @@ private V1ClusterRoleBinding getExpectedOperatorRoleBindingNonResource() { } @Test - public void generatesCorrect_operatorRoleBindingDiscovery() { + void generatesCorrect_operatorRoleBindingDiscovery() { assertThat( getGeneratedFiles().getOperatorRoleBindingDiscovery(), yamlEqualTo(getExpectedOperatorRoleBindingDiscovery())); @@ -524,7 +524,7 @@ private V1ClusterRoleBinding getExpectedOperatorRoleBindingDiscovery() { } @Test - public void generatesCorrect_operatorRoleBindingAuthDelegator() { + void generatesCorrect_operatorRoleBindingAuthDelegator() { assertThat( getGeneratedFiles().getOperatorRoleBindingAuthDelegator(), yamlEqualTo(getExpectedOperatorRoleBindingAuthDelegator())); @@ -551,7 +551,7 @@ private V1ClusterRoleBinding getExpectedOperatorRoleBindingAuthDelegator() { } @Test - public void generatesCorrect_weblogicOperatorNamespaceRole() { + void generatesCorrect_weblogicOperatorNamespaceRole() { assertThat( getGeneratedFiles().getWeblogicOperatorNamespaceRole(), yamlEqualTo(getExpectedWeblogicOperatorNamespaceRole())); @@ -614,7 +614,7 @@ private V1ClusterRole getExpectedWeblogicOperatorNamespaceRole() { } @Test - public void generatesCorrect_domainNamespaces_weblogicOperatorRoleBindings() { + void generatesCorrect_domainNamespaces_weblogicOperatorRoleBindings() { for (String domainNamespace : getInputs().getDomainNamespaces().split(",")) { String namespace = domainNamespace.trim(); assertThat( @@ -662,7 +662,7 @@ private V1RoleBinding getExpectedWeblogicOperatorRoleBinding() { } @Test - public void generatesCorrect_weblogicOperatorRole() { + void generatesCorrect_weblogicOperatorRole() { assertThat( getGeneratedFiles().getWeblogicOperatorRole(), yamlEqualTo(getExpectedWeblogicOperatorRole())); @@ -692,7 +692,7 @@ private V1Role getExpectedWeblogicOperatorRole() { } @Test - public void generatesCorrect_weblogicOperatorRoleBinding() { + void generatesCorrect_weblogicOperatorRoleBinding() { assertThat( getGeneratedFiles().getWeblogicOperatorRoleBinding(), yamlEqualTo(getExpectedWeblogicOperatorRoleBinding())); diff --git a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesDebugEnabledIT.java b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesDebugEnabledIT.java index 3bae34f9f84..0680e65daf8 100644 --- a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesDebugEnabledIT.java +++ b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesDebugEnabledIT.java @@ -7,7 +7,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -public class CreateOperatorGeneratedFilesDebugEnabledIT +class CreateOperatorGeneratedFilesDebugEnabledIT extends CreateOperatorGeneratedFilesDebugEnabledTestBase { @BeforeAll @@ -17,13 +17,13 @@ public static void setup() throws Exception { @Test @Override - public void generatesCorrect_weblogicOperatorNamespace() { + protected void generatesCorrect_weblogicOperatorNamespace() { // the user is responsible for creating the namespace } @Test @Override - public void generatesCorrect_weblogicOperatorServiceAccount() { + protected void generatesCorrect_weblogicOperatorServiceAccount() { // the user is responsible for creating the service account } } diff --git a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesOptionalFeaturesDisabledIT.java b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesOptionalFeaturesDisabledIT.java index 91290db2f54..e7162d21203 100644 --- a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesOptionalFeaturesDisabledIT.java +++ b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesOptionalFeaturesDisabledIT.java @@ -7,7 +7,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -public class CreateOperatorGeneratedFilesOptionalFeaturesDisabledIT +class CreateOperatorGeneratedFilesOptionalFeaturesDisabledIT extends CreateOperatorGeneratedFilesOptionalFeaturesDisabledTestBase { @BeforeAll @@ -17,13 +17,13 @@ public static void setup() throws Exception { @Test @Override - public void generatesCorrect_weblogicOperatorNamespace() { + protected void generatesCorrect_weblogicOperatorNamespace() { // the user is responsible for creating the namespace } @Test @Override - public void generatesCorrect_weblogicOperatorServiceAccount() { + protected void generatesCorrect_weblogicOperatorServiceAccount() { // the user is responsible for creating the service account } } diff --git a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesOptionalFeaturesEnabledIT.java b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesOptionalFeaturesEnabledIT.java index 684752bf5a0..eb73148c5a9 100644 --- a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesOptionalFeaturesEnabledIT.java +++ b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorGeneratedFilesOptionalFeaturesEnabledIT.java @@ -7,7 +7,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -public class CreateOperatorGeneratedFilesOptionalFeaturesEnabledIT +class CreateOperatorGeneratedFilesOptionalFeaturesEnabledIT extends CreateOperatorGeneratedFilesOptionalFeaturesEnabledTestBase { @BeforeAll @@ -17,13 +17,13 @@ public static void setup() throws Exception { @Test @Override - public void generatesCorrect_weblogicOperatorNamespace() { + protected void generatesCorrect_weblogicOperatorNamespace() { // the user is responsible for creating the namespace } @Test @Override - public void generatesCorrect_weblogicOperatorServiceAccount() { + protected void generatesCorrect_weblogicOperatorServiceAccount() { // the user is responsible for creating the service account } } diff --git a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorInputsValidationIt.java b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorInputsValidationIt.java index 269578420e2..cbe79b35c69 100644 --- a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorInputsValidationIt.java +++ b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorInputsValidationIt.java @@ -15,7 +15,7 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.emptyString; -public class CreateOperatorInputsValidationIt extends OperatorChartItBase { +class CreateOperatorInputsValidationIt extends OperatorChartItBase { private static final String MUTEX = "%s can not be present when %s is defined"; @@ -48,7 +48,7 @@ public void setUp() throws Exception { } @Test - public void whenStringSpecifiedForOperatorLevelProperties_reportError() throws Exception { + void whenStringSpecifiedForOperatorLevelProperties_reportError() throws Exception { for (String propertyName : OPERATOR_LEVEL_BOOLEAN_PROPERTIES) { setProperty(propertyName, "this is not a boolean"); } @@ -61,7 +61,7 @@ public void whenStringSpecifiedForOperatorLevelProperties_reportError() throws E } @Test - public void whenOperatorLevelBooleanPropertiesMissing_reportError() throws Exception { + void whenOperatorLevelBooleanPropertiesMissing_reportError() throws Exception { for (String propertyName : OPERATOR_LEVEL_BOOLEAN_PROPERTIES) { removeProperty(propertyName); } @@ -74,7 +74,7 @@ public void whenOperatorLevelBooleanPropertiesMissing_reportError() throws Excep } @Test - public void whenOperatorLevelStringPropertiesMissing_reportError() throws Exception { + void whenOperatorLevelStringPropertiesMissing_reportError() throws Exception { for (String propertyName : OPERATOR_LEVEL_STRING_PROPERTIES) { removeProperty(propertyName); } @@ -87,7 +87,7 @@ public void whenOperatorLevelStringPropertiesMissing_reportError() throws Except } @Test - public void whenOperatorLevelEnumPropertiesMissing_reportError() throws Exception { + void whenOperatorLevelEnumPropertiesMissing_reportError() throws Exception { for (String propertyName : OPERATOR_LEVEL_ENUM_PROPERTIES) { removeProperty(propertyName); } @@ -100,7 +100,7 @@ public void whenOperatorLevelEnumPropertiesMissing_reportError() throws Exceptio } @Test - public void whenBadValuesSpecifiedForOperatorLevelEnumProperties_reportError() throws Exception { + void whenBadValuesSpecifiedForOperatorLevelEnumProperties_reportError() throws Exception { String badValue = "bogus"; for (String propertyName : OPERATOR_LEVEL_ENUM_PROPERTIES) { setProperty(propertyName, badValue); @@ -114,7 +114,7 @@ public void whenBadValuesSpecifiedForOperatorLevelEnumProperties_reportError() t } @Test - public void whenExternalRestEnabled_reportMissingRelatedParameters() throws Exception { + void whenExternalRestEnabled_reportMissingRelatedParameters() throws Exception { setProperty("externalRestEnabled", true); removeProperty("externalRestHttpsPort"); @@ -130,7 +130,7 @@ public void whenExternalRestEnabled_reportMissingRelatedParameters() throws Exce } @Test - public void whenExternalRestNotEnabled_ignoreMissingRelatedParameters() throws Exception { + void whenExternalRestNotEnabled_ignoreMissingRelatedParameters() throws Exception { setProperty("externalRestEnabled", false); removeProperty("externalRestHttpsPort"); @@ -141,7 +141,7 @@ public void whenExternalRestNotEnabled_ignoreMissingRelatedParameters() throws E } @Test - public void whenExternalRestEnabled_reportRelatedParameterErrorsLegacy() throws Exception { + void whenExternalRestEnabled_reportRelatedParameterErrorsLegacy() throws Exception { setProperty("externalRestEnabled", true); setProperty("externalRestHttpsPort", "Not a number"); @@ -157,7 +157,7 @@ public void whenExternalRestEnabled_reportRelatedParameterErrorsLegacy() throws } @Test - public void whenExternalRestEnabled_reportRelatedParameterErrors() throws Exception { + void whenExternalRestEnabled_reportRelatedParameterErrors() throws Exception { setProperty("externalRestEnabled", true); setProperty("externalRestHttpsPort", "Not a number"); setProperty("externalRestIdentitySecret", 1234); @@ -170,7 +170,7 @@ public void whenExternalRestEnabled_reportRelatedParameterErrors() throws Except } @Test - public void whenExternalRestNotEnabled_ignoreRelatedParameterErrors() throws Exception { + void whenExternalRestNotEnabled_ignoreRelatedParameterErrors() throws Exception { setProperty("externalRestEnabled", false); setProperty("externalRestHttpsPort", "Not a number"); @@ -182,7 +182,7 @@ public void whenExternalRestNotEnabled_ignoreRelatedParameterErrors() throws Exc } @Test - public void whenExternalOperatorSecret_ExcludeCertKeyErrors() throws Exception { + void whenExternalOperatorSecret_ExcludeCertKeyErrors() throws Exception { setProperty("externalRestEnabled", true); setProperty("externalRestIdentitySecret", "secretName"); @@ -197,7 +197,7 @@ public void whenExternalOperatorSecret_ExcludeCertKeyErrors() throws Exception { } @Test - public void whenRemoteDebugNodePortEnabled_reportMissingRelatedParameters() throws Exception { + void whenRemoteDebugNodePortEnabled_reportMissingRelatedParameters() throws Exception { setProperty("remoteDebugNodePortEnabled", true); removeProperty("internalDebugHttpPort"); @@ -210,7 +210,7 @@ public void whenRemoteDebugNodePortEnabled_reportMissingRelatedParameters() thro } @Test - public void whenRemoteDebugNodePortNotEnabled_ignoreMissingRelatedParameters() throws Exception { + void whenRemoteDebugNodePortNotEnabled_ignoreMissingRelatedParameters() throws Exception { setProperty("remoteDebugNodePortEnabled", false); removeProperty("internalDebugHttpPort"); @@ -220,7 +220,7 @@ public void whenRemoteDebugNodePortNotEnabled_ignoreMissingRelatedParameters() t } @Test - public void whenRemoteDebugNodePortEnabled_reportRelatedParameterErrors() throws Exception { + void whenRemoteDebugNodePortEnabled_reportRelatedParameterErrors() throws Exception { setProperty("remoteDebugNodePortEnabled", true); setProperty("internalDebugHttpPort", true); @@ -233,7 +233,7 @@ public void whenRemoteDebugNodePortEnabled_reportRelatedParameterErrors() throws } @Test - public void whenRemoteDebugNodePortNotEnabled_ignoreRelatedParameterErrors() throws Exception { + void whenRemoteDebugNodePortNotEnabled_ignoreRelatedParameterErrors() throws Exception { setProperty("remoteDebugNodePortEnabled", false); setProperty("internalDebugHttpPort", true); @@ -243,7 +243,7 @@ public void whenRemoteDebugNodePortNotEnabled_ignoreRelatedParameterErrors() thr } @Test - public void whenElkIntegrationEnabled_reportMissingRelatedParameters() throws Exception { + void whenElkIntegrationEnabled_reportMissingRelatedParameters() throws Exception { setProperty("elkIntegrationEnabled", true); removeProperty("logStashImage"); @@ -259,7 +259,7 @@ public void whenElkIntegrationEnabled_reportMissingRelatedParameters() throws Ex } @Test - public void whenElkIntegrationNotEnabled_ignoreMissingRelatedParameters() throws Exception { + void whenElkIntegrationNotEnabled_ignoreMissingRelatedParameters() throws Exception { setProperty("elkIntegrationEnabled", false); setProperty("logStashImage", true); @@ -270,7 +270,7 @@ public void whenElkIntegrationNotEnabled_ignoreMissingRelatedParameters() throws } @Test - public void whenElkIntegrationEnabled_reportRelatedParametersErrors() throws Exception { + void whenElkIntegrationEnabled_reportRelatedParametersErrors() throws Exception { setProperty("elkIntegrationEnabled", true); setProperty("logStashImage", true); @@ -286,7 +286,7 @@ public void whenElkIntegrationEnabled_reportRelatedParametersErrors() throws Exc } @Test - public void whenElkIntegrationEnabled_ignoreRelatedParametersErrors() throws Exception { + void whenElkIntegrationEnabled_ignoreRelatedParametersErrors() throws Exception { setProperty("elkIntegrationEnabled", false); setProperty("logStashImage", true); @@ -297,14 +297,14 @@ public void whenElkIntegrationEnabled_ignoreRelatedParametersErrors() throws Exc } @Test - public void whenDomainNamespacesPrimitiveType_reportError() throws Exception { + void whenDomainNamespacesPrimitiveType_reportError() throws Exception { setProperty("domainNamespaces", true); assertThat(getProcessingError(), containsTypeError("domainNamespaces", "slice", "bool")); } @Test - public void whenImagePullSecretsPrimitiveType_reportError() throws Exception { + void whenImagePullSecretsPrimitiveType_reportError() throws Exception { setProperty("imagePullSecrets", true); assertThat(getProcessingError(), containsTypeError("imagePullSecrets", "slice", "bool")); diff --git a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/HelmOperatorValuesTest.java b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/HelmOperatorValuesTest.java index 689f1eef5c3..b98015ed390 100644 --- a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/HelmOperatorValuesTest.java +++ b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/HelmOperatorValuesTest.java @@ -17,7 +17,7 @@ import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; -public class HelmOperatorValuesTest { +class HelmOperatorValuesTest { private final int intValue = getRandomInt(); private final String stringValue = Integer.toString(intValue); @@ -28,28 +28,28 @@ private static int getRandomInt() { } @Test - public void whenServiceAccountSet_createdMapContainsValue() { + void whenServiceAccountSet_createdMapContainsValue() { operatorValues.serviceAccount(stringValue); assertThat(operatorValues.createMap(), hasEntry("serviceAccount", stringValue)); } @Test - public void serviceAccountIsGettableStringValue() { + void serviceAccountIsGettableStringValue() { operatorValues.serviceAccount(stringValue); assertThat(operatorValues.getServiceAccount(), equalTo(stringValue)); } @Test - public void whenCreatedFromMapWithoutServiceAccount_hasEmptyString() { + void whenCreatedFromMapWithoutServiceAccount_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getServiceAccount(), equalTo("")); } @Test - public void whenCreatedFromMapWithServiceAccount_hasSpecifiedValue() { + void whenCreatedFromMapWithServiceAccount_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("serviceAccount", stringValue)); @@ -57,28 +57,28 @@ public void whenCreatedFromMapWithServiceAccount_hasSpecifiedValue() { } @Test - public void whenWeblogicOperatorImageSet_createdMapContainsValue() { + void whenWeblogicOperatorImageSet_createdMapContainsValue() { operatorValues.weblogicOperatorImage(stringValue); assertThat(operatorValues.createMap(), hasEntry("image", stringValue)); } @Test - public void weblogicOperatorImageIsGettableStringValue() { + void weblogicOperatorImageIsGettableStringValue() { operatorValues.weblogicOperatorImage(stringValue); assertThat(operatorValues.getWeblogicOperatorImage(), equalTo(stringValue)); } @Test - public void whenCreatedFromMapWithoutImage_hasEmptyString() { + void whenCreatedFromMapWithoutImage_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getWeblogicOperatorImage(), equalTo("")); } @Test - public void whenCreatedFromMapWithImage_hasSpecifiedValue() { + void whenCreatedFromMapWithImage_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("image", stringValue)); assertThat(values.getWeblogicOperatorImage(), equalTo(stringValue)); @@ -87,33 +87,33 @@ public void whenCreatedFromMapWithImage_hasSpecifiedValue() { // ----- javaLoggingLevel @Test - public void whenJavaLoggingLevelSet_createdMapContainsValue() { + void whenJavaLoggingLevelSet_createdMapContainsValue() { operatorValues.javaLoggingLevel(stringValue); assertThat(operatorValues.createMap(), hasEntry("javaLoggingLevel", stringValue)); } @Test - public void whenJavaLoggingLevelNotSet_createdMapLacksValue() { + void whenJavaLoggingLevelNotSet_createdMapLacksValue() { assertThat(operatorValues.createMap(), not(hasKey("javaLoggingLevel"))); } @Test - public void javaLoggingLevelIsGettableStringValue() { + void javaLoggingLevelIsGettableStringValue() { operatorValues.javaLoggingLevel(stringValue); assertThat(operatorValues.getJavaLoggingLevel(), equalTo(stringValue)); } @Test - public void whenCreatedFromMapWithoutJavaLoggingLevel_hasEmptyString() { + void whenCreatedFromMapWithoutJavaLoggingLevel_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getJavaLoggingLevel(), equalTo("")); } @Test - public void whenCreatedFromMapWithJavaLoggingLevel_hasSpecifiedValue() { + void whenCreatedFromMapWithJavaLoggingLevel_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("javaLoggingLevel", stringValue)); @@ -123,28 +123,28 @@ public void whenCreatedFromMapWithJavaLoggingLevel_hasSpecifiedValue() { // ------------ operatorNamespace @Test - public void whenWeblogicOperatorNamespaceSet_createdMapContainsValue() { + void whenWeblogicOperatorNamespaceSet_createdMapContainsValue() { operatorValues.namespace(stringValue); assertThat(operatorValues.createMap(), hasEntry("operatorNamespace", stringValue)); } @Test - public void weblogicOperatorNamespaceIsGettableStringValue() { + void weblogicOperatorNamespaceIsGettableStringValue() { operatorValues.namespace(stringValue); assertThat(operatorValues.getNamespace(), equalTo(stringValue)); } @Test - public void whenCreatedFromMapWithoutWeblogicOperatorNamespace_hasEmptyString() { + void whenCreatedFromMapWithoutWeblogicOperatorNamespace_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getNamespace(), equalTo("")); } @Test - public void whenCreatedFromMapWithWeblogicOperatorNamespace_hasSpecifiedValue() { + void whenCreatedFromMapWithWeblogicOperatorNamespace_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("operatorNamespace", stringValue)); @@ -152,28 +152,28 @@ public void whenCreatedFromMapWithWeblogicOperatorNamespace_hasSpecifiedValue() } @Test - public void whenWeblogicOperatorImagePullPolicySet_createdMapContainsValue() { + void whenWeblogicOperatorImagePullPolicySet_createdMapContainsValue() { operatorValues.weblogicOperatorImagePullPolicy(stringValue); assertThat(operatorValues.createMap(), hasEntry("imagePullPolicy", stringValue)); } @Test - public void weblogicOperatorImagePullPolicyIsGettableStringValue() { + void weblogicOperatorImagePullPolicyIsGettableStringValue() { operatorValues.weblogicOperatorImagePullPolicy(stringValue); assertThat(operatorValues.getWeblogicOperatorImagePullPolicy(), equalTo(stringValue)); } @Test - public void whenCreatedFromMapWithoutImagePullPolicy_hasEmptyString() { + void whenCreatedFromMapWithoutImagePullPolicy_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getWeblogicOperatorImagePullPolicy(), equalTo("")); } @Test - public void whenCreatedFromMapWithImagePullPolicy_hasSpecifiedValue() { + void whenCreatedFromMapWithImagePullPolicy_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("imagePullPolicy", stringValue)); @@ -181,7 +181,7 @@ public void whenCreatedFromMapWithImagePullPolicy_hasSpecifiedValue() { } @Test - public void whenCreatedFromMapWithExternalRestEnabled_hasSpecifiedValue() { + void whenCreatedFromMapWithExternalRestEnabled_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("externalRestEnabled", true)); @@ -189,7 +189,7 @@ public void whenCreatedFromMapWithExternalRestEnabled_hasSpecifiedValue() { } @Test - public void whenCreatedFromMapWithoutExternalRestEnabled_hasEmptyString() { + void whenCreatedFromMapWithoutExternalRestEnabled_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getExternalRestEnabled(), equalTo("")); @@ -198,33 +198,33 @@ public void whenCreatedFromMapWithoutExternalRestEnabled_hasEmptyString() { // --------------- remoteDebugNodePortEnabled @Test - public void whenRemoteDebugNodePortEnabledTrue_createdMapContainsValue() { + void whenRemoteDebugNodePortEnabledTrue_createdMapContainsValue() { operatorValues.remoteDebugNodePortEnabled("true"); assertThat(operatorValues.createMap(), hasEntry("remoteDebugNodePortEnabled", true)); } @Test - public void whenRemoteDebugNodePortEnabledFalse_createdMapContainsValue() { + void whenRemoteDebugNodePortEnabledFalse_createdMapContainsValue() { operatorValues.remoteDebugNodePortEnabled("false"); assertThat(operatorValues.createMap(), hasEntry("remoteDebugNodePortEnabled", false)); } @Test - public void whenRemoteDebugNodePortEnabledNotSet_createdMapLacksValue() { + void whenRemoteDebugNodePortEnabledNotSet_createdMapLacksValue() { assertThat(operatorValues.createMap(), not(hasKey("remoteDebugNodePortEnabled"))); } @Test - public void whenCreatedFromMapWithoutRemoteDebugNodePortEnabled_hasEmptyString() { + void whenCreatedFromMapWithoutRemoteDebugNodePortEnabled_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getRemoteDebugNodePortEnabled(), equalTo("")); } @Test - public void whenCreatedFromMapWithRemoteDebugNodePortTrue_hasSpecifiedValue() { + void whenCreatedFromMapWithRemoteDebugNodePortTrue_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("remoteDebugNodePortEnabled", true)); @@ -232,7 +232,7 @@ public void whenCreatedFromMapWithRemoteDebugNodePortTrue_hasSpecifiedValue() { } @Test - public void whenCreatedFromMapWithRemoteDebugNodePortFalse_hasSpecifiedValue() { + void whenCreatedFromMapWithRemoteDebugNodePortFalse_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("remoteDebugNodePortEnabled", false)); @@ -242,33 +242,33 @@ public void whenCreatedFromMapWithRemoteDebugNodePortFalse_hasSpecifiedValue() { // --------------- suspendOnDebugStartup @Test - public void whenSuspendOnDebugStartupTrue_createdMapContainsValue() { + void whenSuspendOnDebugStartupTrue_createdMapContainsValue() { operatorValues.suspendOnDebugStartup("true"); assertThat(operatorValues.createMap(), hasEntry("suspendOnDebugStartup", true)); } @Test - public void whenSuspendOnDebugStartupFalse_createdMapContainsValue() { + void whenSuspendOnDebugStartupFalse_createdMapContainsValue() { operatorValues.suspendOnDebugStartup("false"); assertThat(operatorValues.createMap(), hasEntry("suspendOnDebugStartup", false)); } @Test - public void whenSuspendOnDebugStartupNotSet_createdMapLacksValue() { + void whenSuspendOnDebugStartupNotSet_createdMapLacksValue() { assertThat(operatorValues.createMap(), not(hasKey("suspendOnDebugStartup"))); } @Test - public void whenCreatedFromMapWithoutSuspendOnDebugStartup_hasEmptyString() { + void whenCreatedFromMapWithoutSuspendOnDebugStartup_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getSuspendOnDebugStartup(), equalTo("")); } @Test - public void whenCreatedFromMapWithSuspendOnDebugStartupTrue_hasSpecifiedValue() { + void whenCreatedFromMapWithSuspendOnDebugStartupTrue_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("suspendOnDebugStartup", true)); @@ -276,7 +276,7 @@ public void whenCreatedFromMapWithSuspendOnDebugStartupTrue_hasSpecifiedValue() } @Test - public void whenCreatedFromMapWithSuspendOnDebugStartupFalse_hasSpecifiedValue() { + void whenCreatedFromMapWithSuspendOnDebugStartupFalse_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("suspendOnDebugStartup", false)); @@ -286,33 +286,33 @@ public void whenCreatedFromMapWithSuspendOnDebugStartupFalse_hasSpecifiedValue() // --------------- elkIntegrationEnabled @Test - public void whenElkIntegrationEnabledTrue_createdMapContainsValue() { + void whenElkIntegrationEnabledTrue_createdMapContainsValue() { operatorValues.elkIntegrationEnabled("true"); assertThat(operatorValues.createMap(), hasEntry("elkIntegrationEnabled", true)); } @Test - public void whenElkIntegrationEnabledFalse_createdMapContainsValue() { + void whenElkIntegrationEnabledFalse_createdMapContainsValue() { operatorValues.elkIntegrationEnabled("false"); assertThat(operatorValues.createMap(), hasEntry("elkIntegrationEnabled", false)); } @Test - public void whenElkIntegrationEnabledNotSet_createdMapLacksValue() { + void whenElkIntegrationEnabledNotSet_createdMapLacksValue() { assertThat(operatorValues.createMap(), not(hasKey("elkIntegrationEnabled"))); } @Test - public void whenCreatedFromMapWithoutElkIntegrationEnabled_hasEmptyString() { + void whenCreatedFromMapWithoutElkIntegrationEnabled_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getElkIntegrationEnabled(), equalTo("")); } @Test - public void whenCreatedFromMapWithElkIntegrationTrue_hasSpecifiedValue() { + void whenCreatedFromMapWithElkIntegrationTrue_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("elkIntegrationEnabled", true)); @@ -320,7 +320,7 @@ public void whenCreatedFromMapWithElkIntegrationTrue_hasSpecifiedValue() { } @Test - public void whenCreatedFromMapWithElkIntegrationFalse_hasSpecifiedValue() { + void whenCreatedFromMapWithElkIntegrationFalse_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("elkIntegrationEnabled", false)); @@ -330,33 +330,33 @@ public void whenCreatedFromMapWithElkIntegrationFalse_hasSpecifiedValue() { // ----- externalRestHttpPort @Test - public void whenExternalRestHttpsPortSet_createdMapContainsValue() { + void whenExternalRestHttpsPortSet_createdMapContainsValue() { operatorValues.externalRestHttpsPort(stringValue); assertThat(operatorValues.createMap(), hasEntry("externalRestHttpsPort", intValue)); } @Test - public void whenExternalRestHttpsPortNotSet_createdMapLacksValue() { + void whenExternalRestHttpsPortNotSet_createdMapLacksValue() { assertThat(operatorValues.createMap(), not(hasKey("externalRestHttpsPort"))); } @Test - public void externalRestHttpsPortIsGettableStringValue() { + void externalRestHttpsPortIsGettableStringValue() { operatorValues.externalRestHttpsPort(stringValue); assertThat(operatorValues.getExternalRestHttpsPort(), equalTo(stringValue)); } @Test - public void whenCreatedFromMapWithoutExternalRestHttpsPort_hasEmptyString() { + void whenCreatedFromMapWithoutExternalRestHttpsPort_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getExternalRestHttpsPort(), equalTo("")); } @Test - public void whenCreatedFromMapWithExternalRestHttpsPort_hasSpecifiedValue() { + void whenCreatedFromMapWithExternalRestHttpsPort_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("externalRestHttpsPort", intValue)); @@ -366,33 +366,33 @@ public void whenCreatedFromMapWithExternalRestHttpsPort_hasSpecifiedValue() { // ----- internalDebugHttpPort @Test - public void whenInternalDebugHttpPortSet_createdMapContainsValue() { + void whenInternalDebugHttpPortSet_createdMapContainsValue() { operatorValues.internalDebugHttpPort(stringValue); assertThat(operatorValues.createMap(), hasEntry("internalDebugHttpPort", intValue)); } @Test - public void whenInternalDebugHttpPortNotSet_createdMapLacksValue() { + void whenInternalDebugHttpPortNotSet_createdMapLacksValue() { assertThat(operatorValues.createMap(), not(hasKey("internalDebugHttpPort"))); } @Test - public void internalDebugHttpPortIsGettableStringValue() { + void internalDebugHttpPortIsGettableStringValue() { operatorValues.internalDebugHttpPort(stringValue); assertThat(operatorValues.getInternalDebugHttpPort(), equalTo(stringValue)); } @Test - public void whenCreatedFromMapWithoutInternalDebugHttpPort_hasEmptyString() { + void whenCreatedFromMapWithoutInternalDebugHttpPort_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getInternalDebugHttpPort(), equalTo("")); } @Test - public void whenCreatedFromMapWithInternalDebugHttpPort_hasSpecifiedValue() { + void whenCreatedFromMapWithInternalDebugHttpPort_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("internalDebugHttpPort", intValue)); @@ -402,12 +402,12 @@ public void whenCreatedFromMapWithInternalDebugHttpPort_hasSpecifiedValue() { // ----- externalDebugHttpPort @Test - public void whenTargetNamespacesNotDefined_createdMapLacksValue() { + void whenTargetNamespacesNotDefined_createdMapLacksValue() { assertThat(operatorValues.createMap(), not(hasKey("domainNamespaces"))); } @Test - public void whenSingleTargetNamespaceDefined_createdMapContainsValue() { + void whenSingleTargetNamespaceDefined_createdMapContainsValue() { operatorValues.domainNamespaces(stringValue); assertThat(getDomainNamespaces(), hasItem(stringValue)); @@ -419,21 +419,21 @@ private List getDomainNamespaces() { } @Test - public void whenMultipleTargetNamespaceDefined_createdMapContainsValue() { + void whenMultipleTargetNamespaceDefined_createdMapContainsValue() { operatorValues.domainNamespaces("aaa,bbb"); assertThat(getDomainNamespaces(), hasItems("aaa", "bbb")); } @Test - public void whenCreatedFromMapWithoutDomainNamespaces_hasEmptyString() { + void whenCreatedFromMapWithoutDomainNamespaces_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getDomainNamespaces(), equalTo("")); } @Test - public void whenCreatedFromMapWithSingleNamespace_hasSpecifiedValue() { + void whenCreatedFromMapWithSingleNamespace_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("domainNamespaces", ImmutableList.of("namespace1"))); @@ -441,7 +441,7 @@ public void whenCreatedFromMapWithSingleNamespace_hasSpecifiedValue() { } @Test - public void whenCreatedFromMapWithMultipleNamespaces_hasSpecifiedValue() { + void whenCreatedFromMapWithMultipleNamespaces_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues( ImmutableMap.of("domainNamespaces", ImmutableList.of("namespace1", "namespace2"))); @@ -452,33 +452,33 @@ public void whenCreatedFromMapWithMultipleNamespaces_hasSpecifiedValue() { // ----- externalDebugHttpPort @Test - public void whenExternalDebugHttpPortSet_createdMapContainsValue() { + void whenExternalDebugHttpPortSet_createdMapContainsValue() { operatorValues.externalDebugHttpPort(stringValue); assertThat(operatorValues.createMap(), hasEntry("externalDebugHttpPort", intValue)); } @Test - public void whenExternalDebugHttpPortNotSet_createdMapLacksValue() { + void whenExternalDebugHttpPortNotSet_createdMapLacksValue() { assertThat(operatorValues.createMap(), not(hasKey("externalDebugHttpPort"))); } @Test - public void externalDebugHttpPortIsGettableStringValue() { + void externalDebugHttpPortIsGettableStringValue() { operatorValues.externalDebugHttpPort(stringValue); assertThat(operatorValues.getExternalDebugHttpPort(), equalTo(stringValue)); } @Test - public void whenCreatedFromMapWithoutExternalDebugHttpPort_hasEmptyString() { + void whenCreatedFromMapWithoutExternalDebugHttpPort_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getExternalDebugHttpPort(), equalTo("")); } @Test - public void whenCreatedFromMapWithExternalDebugHttpPort_hasSpecifiedValue() { + void whenCreatedFromMapWithExternalDebugHttpPort_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("externalDebugHttpPort", intValue)); @@ -488,33 +488,33 @@ public void whenCreatedFromMapWithExternalDebugHttpPort_hasSpecifiedValue() { // --------------- dedicated @Test - public void whenDedicatedTrue_createdMapContainsValue() { + void whenDedicatedTrue_createdMapContainsValue() { operatorValues.dedicated("true"); assertThat(operatorValues.createMap(), hasEntry("dedicated", true)); } @Test - public void whenDedicatedFalse_createdMapContainsValue() { + void whenDedicatedFalse_createdMapContainsValue() { operatorValues.dedicated("false"); assertThat(operatorValues.createMap(), hasEntry("dedicated", false)); } @Test - public void whenDedicatedNotSet_createdMapLacksValue() { + void whenDedicatedNotSet_createdMapLacksValue() { assertThat(operatorValues.createMap(), not(hasKey("dedicated"))); } @Test - public void whenCreatedFromMapWithoutDedicated_hasEmptyString() { + void whenCreatedFromMapWithoutDedicated_hasEmptyString() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of()); assertThat(values.getDedicated(), equalTo("")); } @Test - public void whenCreatedFromMapWithDedicatedTrue_hasSpecifiedValue() { + void whenCreatedFromMapWithDedicatedTrue_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("dedicated", true)); @@ -522,7 +522,7 @@ public void whenCreatedFromMapWithDedicatedTrue_hasSpecifiedValue() { } @Test - public void whenCreatedFromMapWithDedicatedFalse_hasSpecifiedValue() { + void whenCreatedFromMapWithDedicatedFalse_hasSpecifiedValue() { HelmOperatorValues values = new HelmOperatorValues(ImmutableMap.of("dedicated", false)); @@ -530,7 +530,7 @@ public void whenCreatedFromMapWithDedicatedFalse_hasSpecifiedValue() { } @Test - public void whenCreatedFromMap_hasSpecifiedValues() { + void whenCreatedFromMap_hasSpecifiedValues() { HelmOperatorValues values = new HelmOperatorValues( new ImmutableMap.Builder() diff --git a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/OperatorChartIt.java b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/OperatorChartIt.java index d215b093d8e..1246294662c 100644 --- a/kubernetes/src/test/java/oracle/kubernetes/operator/helm/OperatorChartIt.java +++ b/kubernetes/src/test/java/oracle/kubernetes/operator/helm/OperatorChartIt.java @@ -11,12 +11,12 @@ import static org.hamcrest.Matchers.hasSize; @SuppressWarnings("SameParameterValue") -public class OperatorChartIt extends OperatorChartItBase { +class OperatorChartIt extends OperatorChartItBase { private static final InstallArgs NO_VALUES_INSTALL_ARGS = newInstallArgs(Collections.emptyMap()); @Test - public void whenChartsGenerated_haveTwoRoleBindings() throws Exception { + void whenChartsGenerated_haveTwoRoleBindings() throws Exception { ProcessedChart chart = getChart(NO_VALUES_INSTALL_ARGS); assertThat(chart.getDocuments("RoleBinding"), hasSize(2)); diff --git a/operator-build-maven-plugin/src/test/java/oracle/kubernetes/json/mojo/JsonSchemaMojoTest.java b/operator-build-maven-plugin/src/test/java/oracle/kubernetes/json/mojo/JsonSchemaMojoTest.java index aa08c656f0e..3e1c44a96e3 100644 --- a/operator-build-maven-plugin/src/test/java/oracle/kubernetes/json/mojo/JsonSchemaMojoTest.java +++ b/operator-build-maven-plugin/src/test/java/oracle/kubernetes/json/mojo/JsonSchemaMojoTest.java @@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; @SuppressWarnings("SameParameterValue") -public class JsonSchemaMojoTest extends MojoTestBase { +class JsonSchemaMojoTest extends MojoTestBase { private static final List EMPTY_CLASSPATH = new ArrayList<>(); private static final String TARGET_DIR = "/target/dir"; @@ -70,17 +70,17 @@ public void setUp() throws Exception { } @Test - public void mojoAnnotatedWithName() { + void mojoAnnotatedWithName() { assertThat(getClassAnnotation(Mojo.class).getField("name"), equalTo("generate")); } @Test - public void mojoAnnotatedWithDefaultPhase() { + void mojoAnnotatedWithDefaultPhase() { assertThat(getClassAnnotation(Mojo.class).getField("defaultPhase"), equalTo(PROCESS_CLASSES)); } @Test - public void hasClasspathElementsField_withAnnotation() throws NoSuchFieldException { + void hasClasspathElementsField_withAnnotation() throws NoSuchFieldException { Field classPathField = JsonSchemaMojo.class.getDeclaredField("compileClasspathElements"); assertThat(classPathField.getType(), equalTo(List.class)); assertThat( @@ -89,7 +89,7 @@ public void hasClasspathElementsField_withAnnotation() throws NoSuchFieldExcepti } @Test - public void hasTargetDirField_withAnnotation() throws NoSuchFieldException { + void hasTargetDirField_withAnnotation() throws NoSuchFieldException { Field targetDirField = JsonSchemaMojo.class.getDeclaredField("targetDir"); assertThat(targetDirField.getType(), equalTo(String.class)); assertThat( @@ -98,14 +98,14 @@ public void hasTargetDirField_withAnnotation() throws NoSuchFieldException { } @Test - public void hasExternalSchemasField_withAnnotation() throws NoSuchFieldException { + void hasExternalSchemasField_withAnnotation() throws NoSuchFieldException { Field externalSchemasField = JsonSchemaMojo.class.getDeclaredField("externalSchemas"); assertThat(externalSchemasField.getType(), equalTo(List.class)); assertThat(fieldAnnotations.get(externalSchemasField), hasKey(toDescription(Parameter.class))); } @Test - public void hasRootClassNameField_withAnnotation() throws NoSuchFieldException { + void hasRootClassNameField_withAnnotation() throws NoSuchFieldException { Field rootClassField = JsonSchemaMojo.class.getDeclaredField("rootClass"); assertThat(rootClassField.getType(), equalTo(String.class)); assertThat( @@ -113,7 +113,7 @@ public void hasRootClassNameField_withAnnotation() throws NoSuchFieldException { } @Test - public void hasIncludeAdditionalPropertiesField_withAnnotation() throws NoSuchFieldException { + void hasIncludeAdditionalPropertiesField_withAnnotation() throws NoSuchFieldException { Field includeAdditionalPropertiesField = JsonSchemaMojo.class.getDeclaredField("includeAdditionalProperties"); assertThat(includeAdditionalPropertiesField.getType(), equalTo(boolean.class)); @@ -123,7 +123,7 @@ public void hasIncludeAdditionalPropertiesField_withAnnotation() throws NoSuchFi } @Test - public void hasSupportObjectReferencesField_withAnnotation() throws Exception { + void hasSupportObjectReferencesField_withAnnotation() throws Exception { Field supportObjectReferencesField = JsonSchemaMojo.class.getDeclaredField("supportObjectReferences"); assertThat(supportObjectReferencesField.getType(), equalTo(boolean.class)); @@ -133,7 +133,7 @@ public void hasSupportObjectReferencesField_withAnnotation() throws Exception { } @Test - public void hasKubernetesVersionField_withAnnotation() throws Exception { + void hasKubernetesVersionField_withAnnotation() throws Exception { Field supportObjectReferencesField = JsonSchemaMojo.class.getDeclaredField("kubernetesVersion"); assertThat(supportObjectReferencesField.getType(), equalTo(String.class)); assertThat( @@ -142,7 +142,7 @@ public void hasKubernetesVersionField_withAnnotation() throws Exception { } @Test - public void hasGenerateMarkdownField_withAnnotation() throws Exception { + void hasGenerateMarkdownField_withAnnotation() throws Exception { Field supportObjectReferencesField = JsonSchemaMojo.class.getDeclaredField("generateMarkdown"); assertThat(supportObjectReferencesField.getType(), equalTo(boolean.class)); assertThat( @@ -151,7 +151,7 @@ public void hasGenerateMarkdownField_withAnnotation() throws Exception { } @Test - public void hasOutputFileField_withAnnotation() throws Exception { + void hasOutputFileField_withAnnotation() throws Exception { Field field = JsonSchemaMojo.class.getDeclaredField("outputFile"); assertThat(field.getType(), equalTo(String.class)); assertThat(fieldAnnotations.get(field), hasKey(toDescription(Parameter.class))); @@ -159,7 +159,7 @@ public void hasOutputFileField_withAnnotation() throws Exception { } @Test - public void whenKubernetesVersionSpecified_passToGenerator() throws Exception { + void whenKubernetesVersionSpecified_passToGenerator() throws Exception { setMojoParameter("kubernetesVersion", "1.9.0"); executeMojo(); @@ -168,7 +168,7 @@ public void whenKubernetesVersionSpecified_passToGenerator() throws Exception { } @Test - public void whenKubernetesVersionNotSpecified_passToGenerator() throws Exception { + void whenKubernetesVersionNotSpecified_passToGenerator() throws Exception { setMojoParameter("kubernetesVersion", null); executeMojo(); @@ -177,7 +177,7 @@ public void whenKubernetesVersionNotSpecified_passToGenerator() throws Exception } @Test - public void whenExternalSchemaSpecified_passToGenerator() throws Exception { + void whenExternalSchemaSpecified_passToGenerator() throws Exception { setMojoParameter( "externalSchemas", singletonList(new ExternalSchema("http://schema.json", "src/cache/schema.json"))); @@ -190,7 +190,7 @@ public void whenExternalSchemaSpecified_passToGenerator() throws Exception { } @Test - public void whenUnableToUseDefineSchema_haltTheBuild() throws Exception { + void whenUnableToUseDefineSchema_haltTheBuild() throws Exception { setMojoParameter( "externalSchemas", singletonList(new ExternalSchema("abcd://schema.json", "src/cache/schema.json"))); @@ -199,28 +199,28 @@ public void whenUnableToUseDefineSchema_haltTheBuild() throws Exception { } @Test - public void whenNoClassSpecified_haltTheBuild() throws Exception { + void whenNoClassSpecified_haltTheBuild() throws Exception { setMojoParameter("rootClass", null); assertThrows(MojoExecutionException.class, this::executeMojo); } @Test - public void whenLookingForClassFile_specifyRelativeFilePath() throws Exception { + void whenLookingForClassFile_specifyRelativeFilePath() throws Exception { executeMojo(); assertThat(main.getResourceName(), equalTo(classNameToPath(TEST_ROOT_CLASS) + ".class")); } @Test - public void whenRootClassNotFound_haltTheBuild() { + void whenRootClassNotFound_haltTheBuild() { main.setClasspathResource(null); assertThrows(MojoExecutionException.class, this::executeMojo); } @Test - public void useSpecifiedClasspath() throws Exception { + void useSpecifiedClasspath() throws Exception { String[] classpathElements = new String[] {"a", "b", "c"}; setMojoParameter("compileClasspathElements", Arrays.asList(classpathElements)); URL[] classPathUrls = new URL[] {new URL("file:abc"), new URL("file:bcd"), new URL("file:cde")}; @@ -234,21 +234,21 @@ public void useSpecifiedClasspath() throws Exception { } @Test - public void generateToExpectedLocation() throws Exception { + void generateToExpectedLocation() throws Exception { executeMojo(); assertThat(main.getSchemaFile(), equalTo(SCHEMA_FILE)); } @Test - public void whenGenerateMarkdownNotSpecified_dontGenerateMarkdown() throws Exception { + void whenGenerateMarkdownNotSpecified_dontGenerateMarkdown() throws Exception { executeMojo(); assertThat(main.getMarkdownFile(), nullValue()); } @Test - public void whenGenerateMarkdownSpecified_generateMarkdown() throws Exception { + void whenGenerateMarkdownSpecified_generateMarkdown() throws Exception { setMojoParameter("generateMarkdown", true); executeMojo(); @@ -257,7 +257,7 @@ public void whenGenerateMarkdownSpecified_generateMarkdown() throws Exception { } @Test - public void whenGenerateMarkdownSpecified_useGeneratedSchemaForMarkdown() throws Exception { + void whenGenerateMarkdownSpecified_useGeneratedSchemaForMarkdown() throws Exception { Map generatedSchema = Map.of(); main.setGeneratedSchema(generatedSchema); setMojoParameter("generateMarkdown", true); @@ -268,7 +268,7 @@ public void whenGenerateMarkdownSpecified_useGeneratedSchemaForMarkdown() throws } @Test - public void whenSchemaMoreRecentThanClassFile_dontGenerateNewSchema() throws Exception { + void whenSchemaMoreRecentThanClassFile_dontGenerateNewSchema() throws Exception { fileSystem.defineFileContents(CLASS_FILE, ""); fileSystem.defineFileContents(SCHEMA_FILE, ""); fileSystem.touch(SCHEMA_FILE); @@ -279,7 +279,7 @@ public void whenSchemaMoreRecentThanClassFile_dontGenerateNewSchema() throws Exc } @Test - public void whenClassFileMoreRecentThanSchema_generateNewSchema() throws Exception { + void whenClassFileMoreRecentThanSchema_generateNewSchema() throws Exception { fileSystem.defineFileContents(CLASS_FILE, ""); fileSystem.defineFileContents(SCHEMA_FILE, ""); fileSystem.touch(CLASS_FILE); @@ -290,7 +290,7 @@ public void whenClassFileMoreRecentThanSchema_generateNewSchema() throws Excepti } @Test - public void whenOutputFileSpecified_generateToIt() throws Exception { + void whenOutputFileSpecified_generateToIt() throws Exception { setMojoParameter("outputFile", SPECIFIED_FILE_NAME); executeMojo(); @@ -298,7 +298,7 @@ public void whenOutputFileSpecified_generateToIt() throws Exception { } @Test - public void whenIncludeAdditionalPropertiesSet_setOnMain() throws Exception { + void whenIncludeAdditionalPropertiesSet_setOnMain() throws Exception { setMojoParameter("includeAdditionalProperties", true); executeMojo(); @@ -307,7 +307,7 @@ public void whenIncludeAdditionalPropertiesSet_setOnMain() throws Exception { } @Test - public void whenSupportObjectReferencesSet_setOnMain() throws Exception { + void whenSupportObjectReferencesSet_setOnMain() throws Exception { setMojoParameter("supportObjectReferences", true); executeMojo(); diff --git a/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojo/shunit2/AnsiUtilsTest.java b/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojo/shunit2/AnsiUtilsTest.java index c3b75e2e3d7..b0737540f86 100644 --- a/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojo/shunit2/AnsiUtilsTest.java +++ b/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojo/shunit2/AnsiUtilsTest.java @@ -12,11 +12,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -public class AnsiUtilsTest { - +class AnsiUtilsTest { @Test - public void removeAnsiEscapeCharacters() { + void removeAnsiEscapeCharacters() { assertThat(AnsiUtils.withoutAnsiEscapeChars("\u001B[1;31mASSERT:\u001B[0mIt didn't work"), equalTo("ASSERT:It didn't work")); assertThat(AnsiUtils.withoutAnsiEscapeChars("Ran \u001B[1;36m2\u001B[0m tests."), @@ -26,30 +25,30 @@ public void removeAnsiEscapeCharacters() { } @Test - public void formatBoldTexts() { + void formatBoldTexts() { assertThat(AnsiUtils.createFormatter(BOLD).format("sample"), equalTo("\u001B[1msample\u001B[0m")); } @Test - public void formatBoldText() { + void formatBoldText() { assertThat(AnsiUtils.createFormatter(BOLD).format("sample"), equalTo("\u001B[1msample\u001B[0m")); } @Test - public void formatBoldRedText() { + void formatBoldRedText() { assertThat(AnsiUtils.createFormatter(BOLD, RED_FG).format("sample"), equalTo("\u001B[1;31msample\u001B[0m")); } @Test - public void formatBlueText() { + void formatBlueText() { assertThat(AnsiUtils.createFormatter(BLUE_FG).format("sample"), equalTo("\u001B[34msample\u001B[0m")); } @Test - public void formatGreenText() { + void formatGreenText() { assertThat(AnsiUtils.createFormatter(GREEN_FG).format("sample"), equalTo("\u001B[32msample\u001B[0m")); } diff --git a/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojo/shunit2/ShUnit2MojoTest.java b/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojo/shunit2/ShUnit2MojoTest.java index 4204269dbc9..0c79359d51c 100644 --- a/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojo/shunit2/ShUnit2MojoTest.java +++ b/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojo/shunit2/ShUnit2MojoTest.java @@ -47,7 +47,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.fail; -public class ShUnit2MojoTest extends MojoTestBase { +class ShUnit2MojoTest extends MojoTestBase { private static final String TEST_SCRIPT = "shunit2"; private static final String OS_NAME_PROPERTY = "os.name"; @@ -102,17 +102,17 @@ BashProcessBuilder createProcessBuilder(String command) { } @Test - public void mojoAnnotatedWithName() { + void mojoAnnotatedWithName() { assertThat(getClassAnnotation(Mojo.class).getField("name"), equalTo("shunit2")); } @Test - public void mojoAnnotatedWithDefaultPhase() { + void mojoAnnotatedWithDefaultPhase() { assertThat(getClassAnnotation(Mojo.class).getField("defaultPhase"), equalTo(TEST)); } @Test - public void hasOutputDirectoryField_withAnnotation() throws NoSuchFieldException { + void hasOutputDirectoryField_withAnnotation() throws NoSuchFieldException { Field classPathField = ShUnit2Mojo.class.getDeclaredField("outputDirectory"); assertThat(classPathField.getType(), equalTo(File.class)); assertThat( @@ -121,7 +121,7 @@ public void hasOutputDirectoryField_withAnnotation() throws NoSuchFieldException } @Test - public void hasTestSourceDirectoryField_withAnnotation() throws NoSuchFieldException { + void hasTestSourceDirectoryField_withAnnotation() throws NoSuchFieldException { Field classPathField = ShUnit2Mojo.class.getDeclaredField("testSourceDirectory"); assertThat(classPathField.getType(), equalTo(File.class)); assertThat( @@ -130,7 +130,7 @@ public void hasTestSourceDirectoryField_withAnnotation() throws NoSuchFieldExcep } @Test - public void hasSourceDirectoryField_withAnnotation() throws NoSuchFieldException { + void hasSourceDirectoryField_withAnnotation() throws NoSuchFieldException { Field classPathField = ShUnit2Mojo.class.getDeclaredField("sourceDirectory"); assertThat(classPathField.getType(), equalTo(File.class)); assertThat( @@ -139,14 +139,14 @@ public void hasSourceDirectoryField_withAnnotation() throws NoSuchFieldException } @Test - public void useCopiedShUnit2Directory() throws MojoExecutionException { + void useCopiedShUnit2Directory() throws MojoExecutionException { fileSystem.defineFileContents(new File(LATEST_SHUNIT2_DIRECTORY, TEST_SCRIPT), ""); assertThat(mojo.getEffectiveShUnit2Directory(), equalTo(LATEST_SHUNIT2_DIRECTORY)); } @Test - public void whenMultipleShUnit2VersionsInstalled_selectLatest() throws MojoExecutionException { + void whenMultipleShUnit2VersionsInstalled_selectLatest() throws MojoExecutionException { fileSystem.defineFileContents(new File(EARLIER_SHUNIT2_DIRECTORY, TEST_SCRIPT), ""); fileSystem.defineFileContents(new File(LATEST_SHUNIT2_DIRECTORY, TEST_SCRIPT), ""); @@ -154,7 +154,7 @@ public void whenMultipleShUnit2VersionsInstalled_selectLatest() throws MojoExecu } @Test - public void whenLatestShUnit2VersionsMissing_selectPrior() throws MojoExecutionException { + void whenLatestShUnit2VersionsMissing_selectPrior() throws MojoExecutionException { fileSystem.clear(); fileSystem.defineFileContents(new File(EARLIER_SHUNIT2_DIRECTORY, TEST_SCRIPT), ""); fileSystem.defineFileContents(LATEST_SHUNIT2_DIRECTORY, ""); @@ -163,7 +163,7 @@ public void whenLatestShUnit2VersionsMissing_selectPrior() throws MojoExecutionE } @Test - public void whenShUnit2NotInstalled_reportFailure() { + void whenShUnit2NotInstalled_reportFailure() { fileSystem.clear(); fileSystem.defineFileContents(TEST_CLASSES_DIRECTORY, ""); @@ -171,7 +171,7 @@ public void whenShUnit2NotInstalled_reportFailure() { } @Test - public void ifSkipUnitTestSet_skipTesting() throws MojoFailureException, MojoExecutionException { + void ifSkipUnitTestSet_skipTesting() throws MojoFailureException, MojoExecutionException { System.setProperty(SKIP_UNIT_TESTS_PROPERTY, "true"); executeMojo(); @@ -180,7 +180,7 @@ public void ifSkipUnitTestSet_skipTesting() throws MojoFailureException, MojoExe } @Test - public void onMacOS_warnIfBashIsOld() throws MojoFailureException, MojoExecutionException { + void onMacOS_warnIfBashIsOld() throws MojoFailureException, MojoExecutionException { System.setProperty(OS_NAME_PROPERTY, "Mac OS X"); defineExecution().withOutputs(INSTALLED_OSX_BASH_VERSION); @@ -192,7 +192,7 @@ public void onMacOS_warnIfBashIsOld() throws MojoFailureException, MojoExecution } @Test - public void onMacOS_dontRunTestsIfBashIsOld() throws MojoFailureException, MojoExecutionException { + void onMacOS_dontRunTestsIfBashIsOld() throws MojoFailureException, MojoExecutionException { System.setProperty(OS_NAME_PROPERTY, "Mac OS X"); defineExecution().withOutputs(INSTALLED_OSX_BASH_VERSION); defineExecution().withOutputs("This is an example", "and here is another", "Ran 2 tests."); @@ -203,7 +203,7 @@ public void onMacOS_dontRunTestsIfBashIsOld() throws MojoFailureException, MojoE } @Test - public void onMacOS_dontWarnIfBashVersionIsSupported() throws MojoFailureException, MojoExecutionException { + void onMacOS_dontWarnIfBashVersionIsSupported() throws MojoFailureException, MojoExecutionException { System.setProperty(OS_NAME_PROPERTY, "Mac OS X"); defineExecution().withOutputs(HOMEBREW_BASH_VERSION); @@ -213,7 +213,7 @@ public void onMacOS_dontWarnIfBashVersionIsSupported() throws MojoFailureExcepti } @Test - public void onMacOS_runTestsIfBashVersionIsSupported() throws MojoFailureException, MojoExecutionException { + void onMacOS_runTestsIfBashVersionIsSupported() throws MojoFailureException, MojoExecutionException { System.setProperty(OS_NAME_PROPERTY, "Mac OS X"); defineExecution().withOutputs(HOMEBREW_BASH_VERSION); defineExecution().withOutputs("This is an example", "and here is another", "Ran 2 tests."); @@ -225,21 +225,21 @@ public void onMacOS_runTestsIfBashVersionIsSupported() throws MojoFailureExcepti } @Test - public void onExecution_specifyTheSelectedShUnit2ScriptPath() throws MojoFailureException, MojoExecutionException { + void onExecution_specifyTheSelectedShUnit2ScriptPath() throws MojoFailureException, MojoExecutionException { executeMojo(); assertThat(delegate.getShUnit2ScriptPath(), equalTo(LATEST_SHUNIT2_DIRECTORY + "/shunit2")); } @Test - public void onExecution_specifyPathToSourceScripts() throws MojoFailureException, MojoExecutionException { + void onExecution_specifyPathToSourceScripts() throws MojoFailureException, MojoExecutionException { executeMojo(); assertThat(delegate.getSourceScriptDir(), equalTo(SOURCE_DIRECTORY.getAbsolutePath())); } @Test - public void onExecution_specifyTestScripts() throws MojoFailureException, MojoExecutionException { + void onExecution_specifyTestScripts() throws MojoFailureException, MojoExecutionException { fileSystem.defineFileContents(new File(TEST_SOURCE_DIRECTORY, "test1.sh"), ""); fileSystem.defineFileContents(new File(TEST_SOURCE_DIRECTORY, "test3.sh"), ""); fileSystem.defineFileContents(new File(TEST_SOURCE_DIRECTORY, "nothing.sh"), ""); @@ -253,7 +253,7 @@ public void onExecution_specifyTestScripts() throws MojoFailureException, MojoEx } @Test - public void onExecution_logOutputs() throws MojoFailureException, MojoExecutionException { + void onExecution_logOutputs() throws MojoFailureException, MojoExecutionException { defineExecution().withOutputs("This is an example", "and here is another", "Ran 2 tests."); executeMojo(); @@ -274,7 +274,7 @@ private String createExpectedSuccessSummary(int numTestsRun, String testScript) } @Test - public void whenErrorDetected_reportInSummary() throws MojoExecutionException { + void whenErrorDetected_reportInSummary() throws MojoExecutionException { defineExecution().withErrors("This is an example", "and here is another").withOutputs("Ran 3 tests."); try { @@ -297,7 +297,7 @@ private String createExpectedErrorSummary(int numTestsRun, int numErrors, String } @Test - public void onExecution_logErrors() throws MojoExecutionException { + void onExecution_logErrors() throws MojoExecutionException { defineExecution().withErrors("This is an example", "and here is another"); try { @@ -309,7 +309,7 @@ public void onExecution_logErrors() throws MojoExecutionException { } @Test - public void onExecution_ignoreNonZeroReturnCodeErrors() throws MojoExecutionException { + void onExecution_ignoreNonZeroReturnCodeErrors() throws MojoExecutionException { defineExecution().withErrors("This is an example", "\u001B[1;31mERROR:\u001B[0m testPartyLikeItIs1999() returned non-zero return code."); @@ -322,7 +322,7 @@ public void onExecution_ignoreNonZeroReturnCodeErrors() throws MojoExecutionExce } @Test - public void onExecution_ignoreFailureMessage() throws MojoFailureException, MojoExecutionException { + void onExecution_ignoreFailureMessage() throws MojoFailureException, MojoExecutionException { defineExecution().withOutputs("This is an example", "FAILED (failures=2)"); executeMojo(); @@ -331,7 +331,7 @@ public void onExecution_ignoreFailureMessage() throws MojoFailureException, Mojo } @Test - public void onExecution_recordReportedNumberOfTests() throws MojoFailureException, MojoExecutionException { + void onExecution_recordReportedNumberOfTests() throws MojoFailureException, MojoExecutionException { fileSystem.defineFileContents(new File(TEST_SOURCE_DIRECTORY, "test1.sh"), ""); fileSystem.defineFileContents(new File(TEST_SOURCE_DIRECTORY, "test2.sh"), ""); final AnsiUtils.AnsiFormatter shUnit2RunCountFormat = AnsiUtils.createFormatter(BOLD, BLUE_FG); @@ -344,7 +344,7 @@ public void onExecution_recordReportedNumberOfTests() throws MojoFailureExceptio } @Test - public void onExecution_recordReportedNumberOfFailures() throws MojoExecutionException { + void onExecution_recordReportedNumberOfFailures() throws MojoExecutionException { fileSystem.defineFileContents(new File(TEST_SOURCE_DIRECTORY, "test1.sh"), ""); fileSystem.defineFileContents(new File(TEST_SOURCE_DIRECTORY, "test2.sh"), ""); defineExecution() @@ -371,7 +371,7 @@ private String createExpectedTestFailure(String explanation) { } @Test - public void whenAnyTestsFail_mojoThrowsException() { + void whenAnyTestsFail_mojoThrowsException() { fileSystem.defineFileContents(new File(TEST_SOURCE_DIRECTORY, "test1.sh"), ""); fileSystem.defineFileContents(new File(TEST_SOURCE_DIRECTORY, "test2.sh"), ""); defineExecution() diff --git a/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojosupport/MojoTestBase.java b/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojosupport/MojoTestBase.java index c780d0ccea5..67ef8da6be1 100644 --- a/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojosupport/MojoTestBase.java +++ b/operator-build-maven-plugin/src/test/java/oracle/kubernetes/mojosupport/MojoTestBase.java @@ -115,12 +115,12 @@ public void tearDown() { } @Test - public void mojoExtendsBaseClass() { + void mojoExtendsBaseClass() { assertThat(mojo, instanceOf(AbstractMojo.class)); } @Test - public void mojoHasGoalAnnotation() { + void mojoHasGoalAnnotation() { assertThat(getClassAnnotation(Mojo.class), notNullValue()); } diff --git a/operator/src/test/java/oracle/kubernetes/operator/ConfigMapWatcherTest.java b/operator/src/test/java/oracle/kubernetes/operator/ConfigMapWatcherTest.java index a9de166a3e8..c512741cf23 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/ConfigMapWatcherTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/ConfigMapWatcherTest.java @@ -18,7 +18,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; /** This test class verifies the behavior of the ConfigMapWatcher. */ -public class ConfigMapWatcherTest extends WatcherTestBase implements WatchListener { +class ConfigMapWatcherTest extends WatcherTestBase implements WatchListener { private static final BigInteger INITIAL_RESOURCE_VERSION = new BigInteger("456"); @@ -28,7 +28,7 @@ public void receivedResponse(Watch.Response response) { } @Test - public void initialRequest_specifiesStartingResourceVersionAndStandardLabelSelector() { + void initialRequest_specifiesStartingResourceVersionAndStandardLabelSelector() { sendInitialRequest(INITIAL_RESOURCE_VERSION); assertThat( diff --git a/operator/src/test/java/oracle/kubernetes/operator/DomainPresenceTest.java b/operator/src/test/java/oracle/kubernetes/operator/DomainPresenceTest.java index 52cb79f536b..2fd041b1826 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/DomainPresenceTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/DomainPresenceTest.java @@ -52,7 +52,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; @SuppressWarnings("SameParameterValue") -public class DomainPresenceTest extends ThreadFactoryTestBase { +class DomainPresenceTest extends ThreadFactoryTestBase { private static final String NS = "default"; private static final String UID1 = "UID1"; @@ -84,7 +84,7 @@ public void tearDown() throws Exception { } @Test - public void whenNoPreexistingDomains_createEmptyDomainPresenceInfoMap() { + void whenNoPreexistingDomains_createEmptyDomainPresenceInfoMap() { testSupport.addComponent("DP", DomainProcessor.class, dp); testSupport.runSteps(domainNamespaces.readExistingResources(NS, dp)); @@ -92,7 +92,7 @@ public void whenNoPreexistingDomains_createEmptyDomainPresenceInfoMap() { } @Test - public void whenPreexistingDomainExistsWithoutPodsOrServices_addToPresenceMap() { + void whenPreexistingDomainExistsWithoutPodsOrServices_addToPresenceMap() { Domain domain = createDomain(UID1, NS); testSupport.defineResources(domain); @@ -103,7 +103,7 @@ public void whenPreexistingDomainExistsWithoutPodsOrServices_addToPresenceMap() } @Test - public void whenDomainsDeletedButAlreadyInPresence_deleteFromPresenceMap() { + void whenDomainsDeletedButAlreadyInPresence_deleteFromPresenceMap() { Domain domain1 = createDomain(UID1, NS); Domain domain2 = createDomain(UID2, NS); Domain domain3 = createDomain(UID3, NS); @@ -179,7 +179,7 @@ private V1ObjectMeta createMetadata(String uid, String namespace, String name) { } @Test - public void whenK8sHasOneDomain_recordAdminServerService() { + void whenK8sHasOneDomain_recordAdminServerService() { addDomainResource(UID1, NS); V1Service service = createServerService(UID1, NS, "admin"); testSupport.defineResources(service); @@ -191,7 +191,7 @@ public void whenK8sHasOneDomain_recordAdminServerService() { } @Test - public void whenK8sHasOneDomainWithPod_recordPodPresence() { + void whenK8sHasOneDomainWithPod_recordPodPresence() { addDomainResource(UID1, NS); V1Pod pod = createPodResource(UID1, NS, "admin"); testSupport.defineResources(pod); @@ -211,7 +211,7 @@ private void addPodResource(String uid, String namespace, String serverName) { } @Test - public void whenK8sHasOneDomainWithOtherEvent_ignoreIt() { + void whenK8sHasOneDomainWithOtherEvent_ignoreIt() { addDomainResource(UID1, NS); addPodResource(UID1, NS, "admin"); addEventResource(UID1, "admin", "ignore this event"); @@ -234,7 +234,7 @@ private CoreV1Event createEventResource(String uid, String serverName, String me } @Test - public void whenStrandedResourcesExist_removeThem() { + void whenStrandedResourcesExist_removeThem() { V1Service service1 = createServerService(UID1, NS, "admin"); V1Service service2 = createServerService(UID1, NS, "ms1"); V1PersistentVolume volume = new V1PersistentVolume().metadata(createMetadata(UID1, "volume1")); @@ -248,7 +248,7 @@ public void whenStrandedResourcesExist_removeThem() { } @Test - public void dontRemoveNonStrandedResources() { + void dontRemoveNonStrandedResources() { createDomains(LAST_DOMAIN_NUM); V1Service service1 = createServerService("UID1", NS, "admin"); V1Service service2 = createServerService("UID" + LAST_DOMAIN_NUM, NS, "admin"); diff --git a/operator/src/test/java/oracle/kubernetes/operator/DomainProcessorTest.java b/operator/src/test/java/oracle/kubernetes/operator/DomainProcessorTest.java index e9c528c5a5e..51d665d88de 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/DomainProcessorTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/DomainProcessorTest.java @@ -109,7 +109,7 @@ import static org.hamcrest.Matchers.stringContainsInOrder; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class DomainProcessorTest { +class DomainProcessorTest { private static final String ADMIN_NAME = "admin"; private static final String CLUSTER = "cluster"; private static final int MAX_SERVERS = 60; @@ -192,7 +192,7 @@ public void tearDown() throws Exception { } @Test - public void whenDomainSpecNotChanged_dontRunUpdateThread() { + void whenDomainSpecNotChanged_dontRunUpdateThread() { DomainProcessorImpl.registerDomainPresenceInfo(new DomainPresenceInfo(newDomain)); makeRightOperation.execute(); @@ -207,7 +207,7 @@ private String getResourceVersion(Domain domain) { } @Test - public void whenDomainExplicitSet_runUpdateThread() { + void whenDomainExplicitSet_runUpdateThread() { DomainProcessorImpl.registerDomainPresenceInfo(new DomainPresenceInfo(domain)); processor.createMakeRightOperation(new DomainPresenceInfo(domain)).withExplicitRecheck().execute(); @@ -216,7 +216,7 @@ public void whenDomainExplicitSet_runUpdateThread() { } @Test - public void whenDomainConfiguredForMaxServers_establishMatchingPresence() { + void whenDomainConfiguredForMaxServers_establishMatchingPresence() { domainConfigurator.configureCluster(CLUSTER).withReplicas(MAX_SERVERS); DomainPresenceInfo info = new DomainPresenceInfo(domain); @@ -232,7 +232,7 @@ public void whenDomainConfiguredForMaxServers_establishMatchingPresence() { } @Test - public void whenMakeRightRun_updateDomainStatus() { + void whenMakeRightRun_updateDomainStatus() { domainConfigurator.configureCluster(CLUSTER).withReplicas(MIN_REPLICAS); processor.createMakeRightOperation(new DomainPresenceInfo(domain)).execute(); @@ -248,7 +248,7 @@ public void whenMakeRightRun_updateDomainStatus() { } @Test - public void whenDomainScaledDown_removeExcessPodsAndServices() { + void whenDomainScaledDown_removeExcessPodsAndServices() { defineServerResources(ADMIN_NAME); Arrays.stream(MANAGED_SERVER_NAMES).forEach(this::defineServerResources); @@ -265,7 +265,7 @@ private List getEventsAfterTimestamp(OffsetDateTime timestamp) { } @Test - public void whenDomainScaledDown_withPreCreateServerService_doesNotRemoveServices() { + void whenDomainScaledDown_withPreCreateServerService_doesNotRemoveServices() { defineServerResources(ADMIN_NAME); Arrays.stream(MANAGED_SERVER_NAMES).forEach(this::defineServerResources); @@ -278,7 +278,7 @@ public void whenDomainScaledDown_withPreCreateServerService_doesNotRemoveService } @Test - public void whenStrandedResourcesExist_removeThem() { + void whenStrandedResourcesExist_removeThem() { V1Service service1 = createServerService("admin"); V1Service service2 = createServerService("ms1"); testSupport.defineResources(service1, service2); @@ -289,7 +289,7 @@ public void whenStrandedResourcesExist_removeThem() { } @Test - public void whenDomainShutDown_removeAllPodsServicesAndPodDisruptionBudgets() { + void whenDomainShutDown_removeAllPodsServicesAndPodDisruptionBudgets() { defineServerResources(ADMIN_NAME); Arrays.stream(MANAGED_SERVER_NAMES).forEach(this::defineServerResources); @@ -302,7 +302,7 @@ public void whenDomainShutDown_removeAllPodsServicesAndPodDisruptionBudgets() { } @Test - public void whenDomainShutDown_ignoreNonOperatorServices() { + void whenDomainShutDown_ignoreNonOperatorServices() { defineServerResources(ADMIN_NAME); Arrays.stream(MANAGED_SERVER_NAMES).forEach(this::defineServerResources); testSupport.defineResources(createNonOperatorService()); @@ -316,7 +316,7 @@ public void whenDomainShutDown_ignoreNonOperatorServices() { } @Test - public void whenDomainScaledUp_podDisruptionBudgetMinAvailableUpdated() + void whenDomainScaledUp_podDisruptionBudgetMinAvailableUpdated() throws JsonProcessingException { establishPreviousIntrospection(null, Arrays.asList(1, 2)); @@ -333,7 +333,7 @@ public void whenDomainScaledUp_podDisruptionBudgetMinAvailableUpdated() } @Test - public void whenDomainScaledDown_podDisruptionBudgetMinAvailableUpdated() throws JsonProcessingException { + void whenDomainScaledDown_podDisruptionBudgetMinAvailableUpdated() throws JsonProcessingException { establishPreviousIntrospection(null, Arrays.asList(1, 2, 3)); domainConfigurator.configureCluster(CLUSTER).withReplicas(3); @@ -354,7 +354,7 @@ private Boolean minAvailableMatches(List runningPDBs } @Test - public void whenDomainShutDown_ignoreNonOperatorPodDisruptionBudgets() { + void whenDomainShutDown_ignoreNonOperatorPodDisruptionBudgets() { defineServerResources(ADMIN_NAME); Arrays.stream(MANAGED_SERVER_NAMES).forEach(this::defineServerResources); testSupport.defineResources(createNonOperatorPodDisruptionBudget()); @@ -368,7 +368,7 @@ public void whenDomainShutDown_ignoreNonOperatorPodDisruptionBudgets() { } @Test - public void whenClusterReplicas2_server3WithAlwaysPolicy_establishMatchingPresence() { + void whenClusterReplicas2_server3WithAlwaysPolicy_establishMatchingPresence() { domainConfigurator.configureCluster(CLUSTER).withReplicas(2); domainConfigurator.configureServer(MS_PREFIX + 3).withServerStartPolicy(START_ALWAYS); @@ -390,7 +390,7 @@ public void whenClusterReplicas2_server3WithAlwaysPolicy_establishMatchingPresen } @Test - public void whenClusterScaleUpToReplicas3_fromReplicas2_server3WithAlwaysPolicy_establishMatchingPresence() + void whenClusterScaleUpToReplicas3_fromReplicas2_server3WithAlwaysPolicy_establishMatchingPresence() throws JsonProcessingException { establishPreviousIntrospection(null, Arrays.asList(1, 3)); @@ -413,7 +413,7 @@ public void whenClusterScaleUpToReplicas3_fromReplicas2_server3WithAlwaysPolicy_ } @Test - public void whenClusterScaleDownToReplicas1_fromReplicas2_server3WithAlwaysPolicy_establishMatchingPresence() + void whenClusterScaleDownToReplicas1_fromReplicas2_server3WithAlwaysPolicy_establishMatchingPresence() throws JsonProcessingException { establishPreviousIntrospection(null, Arrays.asList(1,3)); @@ -440,7 +440,7 @@ public void whenClusterScaleDownToReplicas1_fromReplicas2_server3WithAlwaysPolic } @Test - public void whenClusterReplicas3_server3And4WithAlwaysPolicy_establishMatchingPresence() { + void whenClusterReplicas3_server3And4WithAlwaysPolicy_establishMatchingPresence() { domainConfigurator.configureCluster(CLUSTER).withReplicas(3); for (Integer i : Arrays.asList(3,4)) { @@ -464,7 +464,7 @@ public void whenClusterReplicas3_server3And4WithAlwaysPolicy_establishMatchingPr } @Test - public void whenMakeRightOperationHasNoDomainUpdates_domainProcessingEventsNotGenerated() + void whenMakeRightOperationHasNoDomainUpdates_domainProcessingEventsNotGenerated() throws JsonProcessingException { establishPreviousIntrospection(null, Arrays.asList(1, 2, 3, 4)); for (Integer i : Arrays.asList(1,2,3,4)) { @@ -485,7 +485,7 @@ public void whenMakeRightOperationHasNoDomainUpdates_domainProcessingEventsNotGe } @Test - public void whenMakeRightOperationHasNoDomainUpdatesAndServiceOnlyServers_domainProcessingEventsNotGenerated() + void whenMakeRightOperationHasNoDomainUpdatesAndServiceOnlyServers_domainProcessingEventsNotGenerated() throws JsonProcessingException { establishPreviousIntrospection(null, Arrays.asList(1, 2, 3, 4)); for (Integer i : Arrays.asList(1,2,3,4)) { @@ -512,7 +512,7 @@ private static boolean doesNotContainEvent(List events, String reas } @Test - public void whenScalingUpDomain_domainProcessingCompletedEventsGenerated() + void whenScalingUpDomain_domainProcessingCompletedEventsGenerated() throws JsonProcessingException { establishPreviousIntrospection(null, Arrays.asList(1, 2)); @@ -537,7 +537,7 @@ private static boolean containsEvent(List events, String reason) { } @Test - public void whenClusterScaleUpToReplicas4_fromReplicas2_server3And4WithAlwaysPolicy_establishMatchingPresence() + void whenClusterScaleUpToReplicas4_fromReplicas2_server3And4WithAlwaysPolicy_establishMatchingPresence() throws JsonProcessingException { establishPreviousIntrospection(null, Arrays.asList(1, 3, 4)); @@ -564,7 +564,7 @@ public void whenClusterScaleUpToReplicas4_fromReplicas2_server3And4WithAlwaysPol } @Test - public void whenClusterReplicas2_server1And2And3WithAlwaysPolicy_establishMatchingPresence() { + void whenClusterReplicas2_server1And2And3WithAlwaysPolicy_establishMatchingPresence() { domainConfigurator.configureCluster(CLUSTER).withReplicas(2); for (Integer i : Arrays.asList(1,2,3)) { @@ -587,7 +587,7 @@ public void whenClusterReplicas2_server1And2And3WithAlwaysPolicy_establishMatchi } @Test - public void whenClusterScaleDownToReplicas1_fromReplicas2_server1And2And3WithAlwaysPolicy_establishMatchingPresence() + void whenClusterScaleDownToReplicas1_fromReplicas2_server1And2And3WithAlwaysPolicy_establishMatchingPresence() throws JsonProcessingException { establishPreviousIntrospection(null, Arrays.asList(1, 2, 3)); @@ -614,7 +614,7 @@ public void whenClusterScaleDownToReplicas1_fromReplicas2_server1And2And3WithAlw } @Test - public void whenClusterReplicas2_server2NeverPolicy_establishMatchingPresence() { + void whenClusterReplicas2_server2NeverPolicy_establishMatchingPresence() { domainConfigurator.configureCluster(CLUSTER).withReplicas(2); domainConfigurator.configureServer(MS_PREFIX + 2).withServerStartPolicy(START_NEVER); DomainPresenceInfo info = new DomainPresenceInfo(newDomain); @@ -633,7 +633,7 @@ public void whenClusterReplicas2_server2NeverPolicy_establishMatchingPresence() } @Test - public void whenClusterReplicas2_allServersExcept5NeverPolicy_establishMatchingPresence() { + void whenClusterReplicas2_allServersExcept5NeverPolicy_establishMatchingPresence() { domainConfigurator.configureCluster(CLUSTER).withReplicas(3); int[] servers = IntStream.rangeClosed(1, MAX_SERVERS).toArray(); for (int i : servers) { @@ -693,7 +693,7 @@ private V1beta1PodDisruptionBudget createNonOperatorPodDisruptionBudget() { } @Test - public void onUpgradeFromV20_updateExternalService() { + void onUpgradeFromV20_updateExternalService() { domainConfigurator.configureAdminServer().configureAdminService().withChannel("name", 30701); testSupport.defineResources(createV20ExternalService()); domainConfigurator.configureCluster(CLUSTER).withReplicas(MAX_SERVERS); @@ -705,7 +705,7 @@ public void onUpgradeFromV20_updateExternalService() { } @Test - public void whenNoExternalServiceNameSuffixConfigured_externalServiceNameContainsDefaultSuffix() { + void whenNoExternalServiceNameSuffixConfigured_externalServiceNameContainsDefaultSuffix() { domainConfigurator.configureAdminServer().configureAdminService().withChannel("name", 30701); DomainPresenceInfo info = new DomainPresenceInfo(domain); configureDomain(domain) @@ -719,7 +719,7 @@ public void whenNoExternalServiceNameSuffixConfigured_externalServiceNameContain } @Test - public void whenExternalServiceNameSuffixConfigured_externalServiceNameContainsSuffix() { + void whenExternalServiceNameSuffixConfigured_externalServiceNameContainsSuffix() { domainConfigurator.configureAdminServer().configureAdminService().withChannel("name", 30701); TuningParameters.getInstance().put(LegalNames.EXTERNAL_SERVICE_NAME_SUFFIX_PARAM, "-my-external-service"); DomainPresenceInfo info = new DomainPresenceInfo(domain); @@ -738,7 +738,7 @@ public void whenExternalServiceNameSuffixConfigured_externalServiceNameContainsS private static final String INTROSPECTOR_MAP_NAME = UID + INTROSPECTOR_CONFIG_MAP_NAME_SUFFIX; @Test - public void whenDomainHasRunningServersAndExistingTopology_dontRunIntrospectionJob() throws JsonProcessingException { + void whenDomainHasRunningServersAndExistingTopology_dontRunIntrospectionJob() throws JsonProcessingException { establishPreviousIntrospection(null); domainConfigurator.withIntrospectVersion(OLD_INTROSPECTION_STATE); @@ -748,7 +748,7 @@ public void whenDomainHasRunningServersAndExistingTopology_dontRunIntrospectionJ } @Test - public void whenDomainHasIntrospectVersionDifferentFromOldDomain_runIntrospectionJob() throws Exception { + void whenDomainHasIntrospectVersionDifferentFromOldDomain_runIntrospectionJob() throws Exception { establishPreviousIntrospection(null); domainConfigurator.withIntrospectVersion(NEW_INTROSPECTION_STATE); @@ -758,7 +758,7 @@ public void whenDomainHasIntrospectVersionDifferentFromOldDomain_runIntrospectio } @Test - public void whenIntrospectionJobRun_recordIt() throws Exception { + void whenIntrospectionJobRun_recordIt() throws Exception { establishPreviousIntrospection(null); domainConfigurator.withIntrospectVersion(NEW_INTROSPECTION_STATE); @@ -770,7 +770,7 @@ public void whenIntrospectionJobRun_recordIt() throws Exception { } @Test - public void whenIntrospectionJobNotComplete_waitForIt() throws Exception { + void whenIntrospectionJobNotComplete_waitForIt() throws Exception { establishPreviousIntrospection(null); jobStatus = createNotCompletedStatus(); @@ -829,7 +829,7 @@ private String defineTopology() throws JsonProcessingException { } @Test - public void afterIntrospection_introspectorConfigMapHasUpToDateLabel() throws Exception { + void afterIntrospection_introspectorConfigMapHasUpToDateLabel() throws Exception { establishPreviousIntrospection(null); domainConfigurator.withIntrospectVersion(NEW_INTROSPECTION_STATE); @@ -853,7 +853,7 @@ private Stream getConfigMaps() { } @Test - public void afterInitialIntrospection_serverPodsHaveInitialIntrospectVersionLabel() { + void afterInitialIntrospection_serverPodsHaveInitialIntrospectVersionLabel() { domainConfigurator.withIntrospectVersion(OLD_INTROSPECTION_STATE); testSupport.doOnCreate(POD, p -> recordPodCreation((V1Pod) p)); domainConfigurator.configureCluster(CLUSTER).withReplicas(MIN_REPLICAS); @@ -871,7 +871,7 @@ public void afterInitialIntrospection_serverPodsHaveInitialIntrospectVersionLabe } @Test - public void afterIntrospection_serverPodsHaveUpToDateIntrospectVersionLabel() throws Exception { + void afterIntrospection_serverPodsHaveUpToDateIntrospectVersionLabel() throws Exception { establishPreviousIntrospection(null); domainConfigurator.withIntrospectVersion(NEW_INTROSPECTION_STATE); @@ -889,7 +889,7 @@ public void afterIntrospection_serverPodsHaveUpToDateIntrospectVersionLabel() th } @Test - public void afterScaleupClusterIntrospection_serverPodsHaveUpToDateIntrospectVersionLabel() throws Exception { + void afterScaleupClusterIntrospection_serverPodsHaveUpToDateIntrospectVersionLabel() throws Exception { establishPreviousIntrospection(null); domainConfigurator.configureCluster(CLUSTER).withReplicas(3); @@ -908,7 +908,7 @@ public void afterScaleupClusterIntrospection_serverPodsHaveUpToDateIntrospectVer } @Test - public void afterScaledownClusterIntrospection_serverPodsHaveUpToDateIntrospectVersionLabel() throws Exception { + void afterScaledownClusterIntrospection_serverPodsHaveUpToDateIntrospectVersionLabel() throws Exception { establishPreviousIntrospection(null); domainConfigurator.configureCluster(CLUSTER).withReplicas(1); @@ -939,7 +939,7 @@ private boolean isIntrospectorMeta(@Nullable V1ObjectMeta meta) { } @Test - public void whenDomainTypeIsDomainInPV_dontRerunIntrospectionJob() throws Exception { + void whenDomainTypeIsDomainInPV_dontRerunIntrospectionJob() throws Exception { establishPreviousIntrospection(this::configureForDomainInPV); makeRightOperation.execute(); @@ -958,7 +958,7 @@ private void recordJob(V1Job job) { } @Test - public void whenDomainTypeIsDomainInImage_dontRerunIntrospectionJob() throws Exception { + void whenDomainTypeIsDomainInImage_dontRerunIntrospectionJob() throws Exception { establishPreviousIntrospection(d -> configureDomain(d).withDomainHomeSourceType(Image)); makeRightOperation.execute(); @@ -967,7 +967,7 @@ public void whenDomainTypeIsDomainInImage_dontRerunIntrospectionJob() throws Exc } @Test - public void whenDomainTypeIsFromModelDomainAndNoChanges_dontRerunIntrospectionJob() throws Exception { + void whenDomainTypeIsFromModelDomainAndNoChanges_dontRerunIntrospectionJob() throws Exception { establishPreviousIntrospection(this::configureForModelInImage); testSupport.defineResources(new V1Secret().metadata(new V1ObjectMeta().name("wdt-cm-secret").namespace(NS))); @@ -990,7 +990,7 @@ private DomainConfigurator configureDomain(Domain domain) { } @Test - public void whenDomainTypeIsFromModelDomainAndImageHashChanged_runIntrospectionJob() throws Exception { + void whenDomainTypeIsFromModelDomainAndImageHashChanged_runIntrospectionJob() throws Exception { establishPreviousIntrospection(this::configureForModelInImage); testSupport.defineResources(new V1Secret().metadata(new V1ObjectMeta().name("wdt-cm-secret").namespace(NS))); cacheChangedDomainInputsHash(); @@ -1013,7 +1013,7 @@ private boolean isIntrospectorConfigMap(V1ConfigMap map) { } @Test - public void whenDomainTypeIsFromModelDomainAndManagedServerModified_runIntrospectionJobThenRoll() throws Exception { + void whenDomainTypeIsFromModelDomainAndManagedServerModified_runIntrospectionJobThenRoll() throws Exception { establishPreviousIntrospection(this::configureForModelInImage); testSupport.defineResources(new V1Secret().metadata(new V1ObjectMeta().name("wdt-cm-secret").namespace(NS))); testSupport.doOnCreate(POD, p -> recordPodCreation((V1Pod) p)); @@ -1027,7 +1027,7 @@ public void whenDomainTypeIsFromModelDomainAndManagedServerModified_runIntrospec } @Test - public void whenDomainTypeIsFromModelOnlineUpdateSuccessUpdateRestartRequired() throws Exception { + void whenDomainTypeIsFromModelOnlineUpdateSuccessUpdateRestartRequired() throws Exception { getMIIOnlineUpdateIntrospectResult(DomainConditionType.ConfigChangesPendingRestart, ProcessingConstants.MII_DYNAMIC_UPDATE_RESTART_REQUIRED); } @@ -1118,7 +1118,7 @@ private void recordPodCreation(V1Pod pod) { private final Map introspectionRunBeforeUpdates = new HashMap<>(); @Test - public void whenDomainTypeIsFromModelDomainAndNewServerCreated_dontRunIntrospectionJobFirst() throws Exception { + void whenDomainTypeIsFromModelDomainAndNewServerCreated_dontRunIntrospectionJobFirst() throws Exception { establishPreviousIntrospection(this::configureForModelInImage); testSupport.defineResources(new V1Secret().metadata(new V1ObjectMeta().name("wdt-cm-secret").namespace(NS))); testSupport.doOnCreate(POD, p -> recordPodCreation((V1Pod) p)); @@ -1129,7 +1129,7 @@ public void whenDomainTypeIsFromModelDomainAndNewServerCreated_dontRunIntrospect } @Test - public void whenDomainTypeIsFromModelDomainAndAdminServerModified_runIntrospectionJobFirst() throws Exception { + void whenDomainTypeIsFromModelDomainAndAdminServerModified_runIntrospectionJobFirst() throws Exception { establishPreviousIntrospection(this::configureForModelInImage); testSupport.defineResources(new V1Secret().metadata(new V1ObjectMeta().name("wdt-cm-secret").namespace(NS))); testSupport.doOnCreate(POD, p -> recordPodCreation((V1Pod) p)); @@ -1141,7 +1141,7 @@ public void whenDomainTypeIsFromModelDomainAndAdminServerModified_runIntrospecti } @Test - public void afterChangeTriggersIntrospection_doesNotRunIntrospectionOnNextExplicitMakeRight() throws Exception { + void afterChangeTriggersIntrospection_doesNotRunIntrospectionOnNextExplicitMakeRight() throws Exception { establishPreviousIntrospection(this::configureForModelInImage); testSupport.defineResources(new V1Secret().metadata(new V1ObjectMeta().name("wdt-cm-secret").namespace(NS))); testSupport.doOnCreate(POD, p -> recordPodCreation((V1Pod) p)); @@ -1155,7 +1155,7 @@ public void afterChangeTriggersIntrospection_doesNotRunIntrospectionOnNextExplic } @Test - public void whenDomainTypeIsFromModelDomainAndAdminServerModified_runIntrospectionJobFirst2() throws Exception { + void whenDomainTypeIsFromModelDomainAndAdminServerModified_runIntrospectionJobFirst2() throws Exception { establishPreviousIntrospection(this::configureForModelInImage); testSupport.defineResources(new V1Secret().metadata(new V1ObjectMeta().name("wdt-cm-secret").namespace(NS))); testSupport.doOnCreate(POD, p -> recordPodCreation((V1Pod) p)); @@ -1271,7 +1271,7 @@ private boolean isServerInactive(DomainPresenceInfo info, String serverName) { } @Test - public void whenDomainIsNotValid_dontBringUpServers() { + void whenDomainIsNotValid_dontBringUpServers() { defineDuplicateServerNames(); DomainPresenceInfo info = new DomainPresenceInfo(domain); @@ -1289,7 +1289,7 @@ private void assertServerPodAndServiceNotPresent(DomainPresenceInfo info, String } @Test - public void whenDomainIsNotValid_updateStatus() { + void whenDomainIsNotValid_updateStatus() { defineDuplicateServerNames(); processor.createMakeRightOperation(new DomainPresenceInfo(domain)).withExplicitRecheck().execute(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/DomainStatusUpdaterTest.java b/operator/src/test/java/oracle/kubernetes/operator/DomainStatusUpdaterTest.java index f086b41332d..7f2f2d59f66 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/DomainStatusUpdaterTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/DomainStatusUpdaterTest.java @@ -62,7 +62,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class DomainStatusUpdaterTest { +class DomainStatusUpdaterTest { private static final String NAME = UID; private final TerminalStep endStep = new TerminalStep(); private final WlsDomainConfigSupport configSupport = new WlsDomainConfigSupport("mydomain"); @@ -107,7 +107,7 @@ public void tearDown() throws Exception { } @Test - public void statusStep_copiesServerStatesFromMaps() { + void statusStep_copiesServerStatesFromMaps() { testSupport.addToPacket( SERVER_STATE_MAP, ImmutableMap.of("server1", RUNNING_STATE, "server2", SHUTDOWN_STATE)); testSupport.addToPacket( @@ -146,7 +146,7 @@ public void statusStep_copiesServerStatesFromMaps() { } @Test - public void statusStep_copiesServerStatesFromMaps_standalone() { + void statusStep_copiesServerStatesFromMaps_standalone() { testSupport.addToPacket( SERVER_STATE_MAP, ImmutableMap.of("server1", RUNNING_STATE, "server2", SHUTDOWN_STATE)); testSupport.addToPacket( @@ -208,7 +208,7 @@ private V1Pod getPod(String serverName) { } @Test - public void statusStep_usesServerFromWlsConfig() { + void statusStep_usesServerFromWlsConfig() { configureServer("server4").withDesiredState(ADMIN_STATE); testSupport.addToPacket(SERVER_STATE_MAP, ImmutableMap.of("server3", RUNNING_STATE)); testSupport.addToPacket( @@ -243,7 +243,7 @@ public void statusStep_usesServerFromWlsConfig() { } @Test - public void statusStep_copiesClusterFromWlsConfigAndNodeNameFromPod() { + void statusStep_copiesClusterFromWlsConfigAndNodeNameFromPod() { testSupport.addToPacket(SERVER_STATE_MAP, ImmutableMap.of("server2", STANDBY_STATE)); testSupport.addToPacket( SERVER_HEALTH_MAP, ImmutableMap.of("server2", overallHealth("health2"))); @@ -267,7 +267,7 @@ public void statusStep_copiesClusterFromWlsConfigAndNodeNameFromPod() { } @Test - public void statusStep_updatesDomainWhenHadNoStatus() { + void statusStep_updatesDomainWhenHadNoStatus() { testSupport.addToPacket(SERVER_STATE_MAP, ImmutableMap.of("server1", RUNNING_STATE)); testSupport.addToPacket( SERVER_HEALTH_MAP, ImmutableMap.of("server1", overallHealth("health1"))); @@ -293,7 +293,7 @@ public void statusStep_updatesDomainWhenHadNoStatus() { } @Test - public void statusStep_shutdownDesiredState_ifServerHasNoStartupInfos() { + void statusStep_shutdownDesiredState_ifServerHasNoStartupInfos() { testSupport.addToPacket(SERVER_STATE_MAP, ImmutableMap.of("server1", RUNNING_STATE)); testSupport.addToPacket( SERVER_HEALTH_MAP, ImmutableMap.of("server1", overallHealth("health1"))); @@ -319,7 +319,7 @@ public void statusStep_shutdownDesiredState_ifServerHasNoStartupInfos() { } @Test - public void statusStep_shutdownDesiredState_ifStandAloneServerHasNoStartupInfos() { + void statusStep_shutdownDesiredState_ifStandAloneServerHasNoStartupInfos() { testSupport.addToPacket(SERVER_STATE_MAP, ImmutableMap.of("server1", RUNNING_STATE)); testSupport.addToPacket( SERVER_HEALTH_MAP, ImmutableMap.of("server1", overallHealth("health1"))); @@ -343,7 +343,7 @@ public void statusStep_shutdownDesiredState_ifStandAloneServerHasNoStartupInfos( } @Test - public void statusStep_shutdownDesiredState_ifServerIsServiceOnly() { + void statusStep_shutdownDesiredState_ifServerIsServiceOnly() { testSupport.addToPacket(SERVER_STATE_MAP, ImmutableMap.of("server1", RUNNING_STATE)); testSupport.addToPacket( SERVER_HEALTH_MAP, ImmutableMap.of("server1", overallHealth("health1"))); @@ -370,7 +370,7 @@ public void statusStep_shutdownDesiredState_ifServerIsServiceOnly() { } @Test - public void statusStep_shutdownDesiredState_ifStandAloneServerIsServiceOnly() { + void statusStep_shutdownDesiredState_ifStandAloneServerIsServiceOnly() { testSupport.addToPacket(SERVER_STATE_MAP, ImmutableMap.of("server1", RUNNING_STATE)); testSupport.addToPacket( SERVER_HEALTH_MAP, ImmutableMap.of("server1", overallHealth("health1"))); @@ -395,7 +395,7 @@ public void statusStep_shutdownDesiredState_ifStandAloneServerIsServiceOnly() { } @Test - public void statusStep_containsValidationWarnings() { + void statusStep_containsValidationWarnings() { info.addValidationWarning(validationWarning); testSupport.addToPacket(DOMAIN_TOPOLOGY, configSupport.createDomainConfig()); @@ -405,7 +405,7 @@ public void statusStep_containsValidationWarnings() { } @Test - public void progressingStep_containsValidationWarnings() { + void progressingStep_containsValidationWarnings() { info.addValidationWarning(validationWarning); testSupport.addToPacket(DOMAIN_TOPOLOGY, configSupport.createDomainConfig()); @@ -415,7 +415,7 @@ public void progressingStep_containsValidationWarnings() { } @Test - public void failedStepWithFailureMessage_doesNotContainValidationWarnings() { + void failedStepWithFailureMessage_doesNotContainValidationWarnings() { info.addValidationWarning(validationWarning); testSupport.addToPacket(DOMAIN_TOPOLOGY, configSupport.createDomainConfig()); @@ -425,7 +425,7 @@ public void failedStepWithFailureMessage_doesNotContainValidationWarnings() { } @Test - public void whenStatusUnchanged_statusStepDoesNotUpdateDomain() { + void whenStatusUnchanged_statusStepDoesNotUpdateDomain() { info = new DomainPresenceInfo(domain); testSupport.addDomainPresenceInfo(info); defineServerPod("server1"); @@ -455,14 +455,14 @@ public void whenStatusUnchanged_statusStepDoesNotUpdateDomain() { } @Test - public void whenDomainHasNoClusters_statusLacksReplicaCount() { + void whenDomainHasNoClusters_statusLacksReplicaCount() { testSupport.runSteps(DomainStatusUpdater.createStatusUpdateStep(endStep)); assertThat(getRecordedDomain().getStatus().getReplicas(), nullValue()); } @Test - public void whenDomainHasOneCluster_statusReplicaCountShowsServersInThatCluster() { + void whenDomainHasOneCluster_statusReplicaCountShowsServersInThatCluster() { defineCluster("cluster1", "server1", "server2", "server3"); WlsDomainConfigSupport configSupport = new WlsDomainConfigSupport("mydomain"); @@ -478,7 +478,7 @@ public void whenDomainHasOneCluster_statusReplicaCountShowsServersInThatCluster( } @Test - public void whenDomainHasMultipleClusters_statusLacksReplicaCount() { + void whenDomainHasMultipleClusters_statusLacksReplicaCount() { defineCluster("cluster1", "server1", "server2", "server3"); defineCluster("cluster2", "server4", "server5", "server6", "server7"); defineCluster("cluster3", "server8", "server9"); @@ -504,7 +504,7 @@ public void whenDomainHasMultipleClusters_statusLacksReplicaCount() { } @Test - public void whenAllDesiredServersRunning_establishAvailableCondition() { + void whenAllDesiredServersRunning_establishAvailableCondition() { setAllDesiredServersRunning(); testSupport.runSteps(DomainStatusUpdater.createStatusUpdateStep(endStep)); @@ -526,7 +526,7 @@ private void setAllDesiredServersRunning() { } @Test - public void whenAllDesiredServersRunningAndMatchingAvailableConditionFound_ignoreIt() { + void whenAllDesiredServersRunningAndMatchingAvailableConditionFound_ignoreIt() { domain .getStatus() .addCondition( @@ -548,7 +548,7 @@ public void whenAllDesiredServersRunningAndMatchingAvailableConditionFound_ignor } @Test - public void whenAllDesiredServersRunningAndMismatchedAvailableConditionReasonFound_changeIt() { + void whenAllDesiredServersRunningAndMismatchedAvailableConditionReasonFound_changeIt() { domain.getStatus().addCondition(new DomainCondition(Available).withStatus("True")); setAllDesiredServersRunning(); @@ -560,7 +560,7 @@ public void whenAllDesiredServersRunningAndMismatchedAvailableConditionReasonFou } @Test - public void whenAllDesiredServersRunningAndMismatchedAvailableConditionStatusFound_changeIt() { + void whenAllDesiredServersRunningAndMismatchedAvailableConditionStatusFound_changeIt() { domain .getStatus() .addCondition(new DomainCondition(Available).withReason(SERVERS_READY_REASON)); @@ -574,7 +574,7 @@ public void whenAllDesiredServersRunningAndMismatchedAvailableConditionStatusFou } @Test - public void whenAllDesiredServersRunningAndProgressingConditionFound_removeIt() { + void whenAllDesiredServersRunningAndProgressingConditionFound_removeIt() { domain.getStatus().addCondition(new DomainCondition(Progressing)); setAllDesiredServersRunning(); @@ -584,7 +584,7 @@ public void whenAllDesiredServersRunningAndProgressingConditionFound_removeIt() } @Test - public void whenNotAllDesiredServersRunning_dontEstablishAvailableCondition() { + void whenNotAllDesiredServersRunning_dontEstablishAvailableCondition() { setDesiredServerNotRunning(); testSupport.runSteps(DomainStatusUpdater.createStatusUpdateStep(endStep)); @@ -601,7 +601,7 @@ private void setDesiredServerNotRunning() { } @Test - public void whenNotAllDesiredServersRunningAndProgressingConditionFound_ignoreIt() { + void whenNotAllDesiredServersRunningAndProgressingConditionFound_ignoreIt() { domain.getStatus().addCondition(new DomainCondition(Progressing)); setDesiredServerNotRunning(); @@ -617,7 +617,7 @@ public void whenNotAllDesiredServersRunningAndProgressingConditionFound_ignoreIt } @Test - public void whenNotAllDesiredServersRunningAndProgressingConditionNotFound_addOne() { + void whenNotAllDesiredServersRunningAndProgressingConditionNotFound_addOne() { setDesiredServerNotRunning(); WlsDomainConfigSupport configSupport = new WlsDomainConfigSupport("mydomain"); @@ -632,7 +632,7 @@ public void whenNotAllDesiredServersRunningAndProgressingConditionNotFound_addOn } @Test - public void whenPodFailedAndProgressingConditionFound_removeIt() { + void whenPodFailedAndProgressingConditionFound_removeIt() { domain.getStatus().addCondition(new DomainCondition(Progressing)); setDesiredServerNotRunning(); failPod("server1"); @@ -643,14 +643,14 @@ public void whenPodFailedAndProgressingConditionFound_removeIt() { } @Test - public void whenNoPodsFailed_dontEstablishFailedCondition() { + void whenNoPodsFailed_dontEstablishFailedCondition() { testSupport.runSteps(DomainStatusUpdater.createStatusUpdateStep(endStep)); assertThat(getRecordedDomain(), not(hasCondition(Failed))); } @Test - public void whenNoPodsFailedAndFailedConditionFound_removeIt() { + void whenNoPodsFailedAndFailedConditionFound_removeIt() { domain.getStatus().addCondition(new DomainCondition(Failed)); testSupport.runSteps(DomainStatusUpdater.createStatusUpdateStep(endStep)); @@ -659,7 +659,7 @@ public void whenNoPodsFailedAndFailedConditionFound_removeIt() { } @Test - public void whenAtLeastOnePodFailed_establishFailedCondition() { + void whenAtLeastOnePodFailed_establishFailedCondition() { failPod("server1"); testSupport.runSteps(DomainStatusUpdater.createStatusUpdateStep(endStep)); @@ -668,7 +668,7 @@ public void whenAtLeastOnePodFailed_establishFailedCondition() { } @Test - public void whenAtLeastOnePodAndFailedConditionTrueFound_leaveIt() { + void whenAtLeastOnePodAndFailedConditionTrueFound_leaveIt() { domain.getStatus().addCondition(new DomainCondition(Failed).withStatus("True")); failPod("server2"); @@ -678,7 +678,7 @@ public void whenAtLeastOnePodAndFailedConditionTrueFound_leaveIt() { } @Test - public void whenAtLeastOnePodFailedAndFailedConditionFalseFound_changeIt() { + void whenAtLeastOnePodFailedAndFailedConditionFalseFound_changeIt() { domain.getStatus().addCondition(new DomainCondition(Failed).withStatus("False ")); failPod("server2"); @@ -688,7 +688,7 @@ public void whenAtLeastOnePodFailedAndFailedConditionFalseFound_changeIt() { } @Test - public void whenAtLeastOnePodFailed_doneCreateAvailableCondition() { + void whenAtLeastOnePodFailed_doneCreateAvailableCondition() { domain.getStatus().addCondition(new DomainCondition(Failed).withStatus("False ")); failPod("server2"); @@ -698,7 +698,7 @@ public void whenAtLeastOnePodFailed_doneCreateAvailableCondition() { } @Test - public void whenAtLeastOnePodFailedAndAvailableConditionFound_removeIt() { + void whenAtLeastOnePodFailedAndAvailableConditionFound_removeIt() { domain.getStatus().addCondition(new DomainCondition(Available)); failPod("server2"); @@ -708,7 +708,7 @@ public void whenAtLeastOnePodFailedAndAvailableConditionFound_removeIt() { } @Test - public void whenTwoConditionUpdatesScheduled_useResultOfFirstToComputeSecond() { + void whenTwoConditionUpdatesScheduled_useResultOfFirstToComputeSecond() { domain.getStatus().addCondition(new DomainCondition(Available).withStatus("False")); domain.getStatus().addCondition(new DomainCondition(Progressing).withStatus("True").withReason("Initial")); @@ -791,7 +791,7 @@ private V1Pod createPod(String serverName) { } @Test - public void whenDomainHasNoStatus_progressingStepUpdatesItWithProgressingTrueAndReason() { + void whenDomainHasNoStatus_progressingStepUpdatesItWithProgressingTrueAndReason() { domain.setStatus(null); testSupport.runSteps(DomainStatusUpdater.createProgressingStep(reason, false, endStep)); @@ -800,7 +800,7 @@ public void whenDomainHasNoStatus_progressingStepUpdatesItWithProgressingTrueAnd } @Test - public void + void whenDomainHasNoProgressingCondition_progressingStepUpdatesItWithProgressingTrueAndReason() { testSupport.runSteps(DomainStatusUpdater.createProgressingStep(reason, false, endStep)); @@ -808,7 +808,7 @@ public void whenDomainHasNoStatus_progressingStepUpdatesItWithProgressingTrueAnd } @Test - public void + void whenDomainHasProgressingNonTrueCondition_progressingStepUpdatesItWithProgressingTrueAndReason() { domain.getStatus().addCondition(new DomainCondition(Progressing).withStatus("?")); @@ -819,7 +819,7 @@ public void whenDomainHasNoStatus_progressingStepUpdatesItWithProgressingTrueAnd } @Test - public void whenDomainHasProgressingTrueConditionWithDifferentReason_progressingStepUpdatesReason() { + void whenDomainHasProgressingTrueConditionWithDifferentReason_progressingStepUpdatesReason() { domain .getStatus() .addCondition( @@ -835,7 +835,7 @@ public void whenDomainHasProgressingTrueConditionWithDifferentReason_progressing } @Test - public void whenDomainHasProgressingTrueConditionWithSameReason_progressingStepIgnoresIt() { + void whenDomainHasProgressingTrueConditionWithSameReason_progressingStepIgnoresIt() { domain .getStatus() .addCondition(new DomainCondition(Progressing).withStatus("True").withReason(reason)); @@ -846,7 +846,7 @@ public void whenDomainHasProgressingTrueConditionWithSameReason_progressingStepI } @Test - public void whenDomainHasFailedCondition_progressingStepShouldNotRemovesIt() { + void whenDomainHasFailedCondition_progressingStepShouldNotRemovesIt() { domain.getStatus().addCondition(new DomainCondition(Failed)); testSupport.runSteps(DomainStatusUpdater.createProgressingStep(reason, false, endStep)); @@ -855,7 +855,7 @@ public void whenDomainHasFailedCondition_progressingStepShouldNotRemovesIt() { } @Test - public void whenDomainHasAvailableCondition_progressingStepRemovesIt() { + void whenDomainHasAvailableCondition_progressingStepRemovesIt() { domain.getStatus().addCondition(new DomainCondition(Available)); testSupport.runSteps(DomainStatusUpdater.createProgressingStep(reason, false, endStep)); @@ -864,7 +864,7 @@ public void whenDomainHasAvailableCondition_progressingStepRemovesIt() { } @Test - public void whenDomainHasAvailableCondition_progressingStepWithPreserveAvailableIgnoresIt() { + void whenDomainHasAvailableCondition_progressingStepWithPreserveAvailableIgnoresIt() { domain.getStatus().addCondition(new DomainCondition(Available)); testSupport.runSteps(DomainStatusUpdater.createProgressingStep(reason, true, endStep)); @@ -873,14 +873,14 @@ public void whenDomainHasAvailableCondition_progressingStepWithPreserveAvailable } @Test - public void whenDomainHasNoConditions_endProgressingStepDoesNothing() { + void whenDomainHasNoConditions_endProgressingStepDoesNothing() { testSupport.runSteps(DomainStatusUpdater.createEndProgressingStep(endStep)); assertThat(testSupport.getNumCalls(), equalTo(0)); } @Test - public void whenDomainHasProgressingTrueCondition_endProgressingStepRemovesIt() { + void whenDomainHasProgressingTrueCondition_endProgressingStepRemovesIt() { domain.getStatus().addCondition(new DomainCondition(Progressing).withStatus("True")); testSupport.runSteps(DomainStatusUpdater.createEndProgressingStep(endStep)); @@ -889,7 +889,7 @@ public void whenDomainHasProgressingTrueCondition_endProgressingStepRemovesIt() } @Test - public void whenDomainHasProgressingNotTrueCondition_endProgressingStepIgnoresIt() { + void whenDomainHasProgressingNotTrueCondition_endProgressingStepIgnoresIt() { domain.getStatus().addCondition(new DomainCondition(Progressing).withStatus("?")); testSupport.runSteps(DomainStatusUpdater.createEndProgressingStep(endStep)); @@ -898,7 +898,7 @@ public void whenDomainHasProgressingNotTrueCondition_endProgressingStepIgnoresIt } @Test - public void whenDomainHasAvailableCondition_endProgressingStepIgnoresIt() { + void whenDomainHasAvailableCondition_endProgressingStepIgnoresIt() { domain.getStatus().addCondition(new DomainCondition(Available)); testSupport.runSteps(DomainStatusUpdater.createEndProgressingStep(endStep)); @@ -907,7 +907,7 @@ public void whenDomainHasAvailableCondition_endProgressingStepIgnoresIt() { } @Test - public void whenDomainHasFailedCondition_endProgressingStepIgnoresIt() { + void whenDomainHasFailedCondition_endProgressingStepIgnoresIt() { domain.getStatus().addCondition(new DomainCondition(Failed)); testSupport.runSteps(DomainStatusUpdater.createEndProgressingStep(endStep)); @@ -916,7 +916,7 @@ public void whenDomainHasFailedCondition_endProgressingStepIgnoresIt() { } @Test - public void whenDomainLacksStatus_availableStepUpdatesDomainWithAvailableTrueAndReason() { + void whenDomainLacksStatus_availableStepUpdatesDomainWithAvailableTrueAndReason() { domain.setStatus(null); testSupport.runSteps(DomainStatusUpdater.createAvailableStep(reason, endStep)); @@ -925,7 +925,7 @@ public void whenDomainLacksStatus_availableStepUpdatesDomainWithAvailableTrueAnd } @Test - public void + void whenDomainLacksAvailableCondition_availableStepUpdatesDomainWithAvailableTrueAndReason() { testSupport.runSteps(DomainStatusUpdater.createAvailableStep(reason, endStep)); @@ -933,7 +933,7 @@ public void whenDomainLacksStatus_availableStepUpdatesDomainWithAvailableTrueAnd } @Test - public void whenDomainHasAvailableFalseCondition_availableStepUpdatesItWithTrueAndReason() { + void whenDomainHasAvailableFalseCondition_availableStepUpdatesItWithTrueAndReason() { domain.getStatus().addCondition(new DomainCondition(Available).withStatus("False")); testSupport.runSteps(DomainStatusUpdater.createAvailableStep(reason, endStep)); @@ -943,7 +943,7 @@ public void whenDomainHasAvailableFalseCondition_availableStepUpdatesItWithTrueA } @Test - public void whenDomainHasProgressingCondition_availableStepRemovesIt() { + void whenDomainHasProgressingCondition_availableStepRemovesIt() { domain.getStatus().addCondition(new DomainCondition(Progressing)); testSupport.runSteps(DomainStatusUpdater.createAvailableStep(reason, endStep)); @@ -953,7 +953,7 @@ public void whenDomainHasProgressingCondition_availableStepRemovesIt() { } @Test - public void whenDomainHasFailedCondition_availableStepRemovesIt() { + void whenDomainHasFailedCondition_availableStepRemovesIt() { domain.getStatus().addCondition(new DomainCondition(Failed)); testSupport.runSteps(DomainStatusUpdater.createAvailableStep(reason, endStep)); @@ -962,7 +962,7 @@ public void whenDomainHasFailedCondition_availableStepRemovesIt() { } @Test - public void whenDomainLacksStatus_failedStepUpdatesDomainWithFailedTrueAndException() { + void whenDomainLacksStatus_failedStepUpdatesDomainWithFailedTrueAndException() { domain.setStatus(null); testSupport.runSteps(DomainStatusUpdater.createFailureRelatedSteps(failure, endStep)); @@ -975,7 +975,7 @@ public void whenDomainLacksStatus_failedStepUpdatesDomainWithFailedTrueAndExcept // --- @Test - public void whenDomainLacksFailedCondition_failedStepUpdatesDomainWithFailedTrueAndException() { + void whenDomainLacksFailedCondition_failedStepUpdatesDomainWithFailedTrueAndException() { testSupport.runSteps(DomainStatusUpdater.createFailureRelatedSteps(failure, endStep)); assertThat( @@ -984,7 +984,7 @@ public void whenDomainLacksFailedCondition_failedStepUpdatesDomainWithFailedTrue } @Test - public void whenDomainHasFailedFalseCondition_failedStepUpdatesItWithTrueAndException() { + void whenDomainHasFailedFalseCondition_failedStepUpdatesItWithTrueAndException() { domain.getStatus().addCondition(new DomainCondition(Failed).withStatus("False")); testSupport.runSteps(DomainStatusUpdater.createFailureRelatedSteps(failure, endStep)); @@ -996,7 +996,7 @@ public void whenDomainHasFailedFalseCondition_failedStepUpdatesItWithTrueAndExce } @Test - public void whenDomainHasProgressingTrueCondition_failedStepRemovesIt() { + void whenDomainHasProgressingTrueCondition_failedStepRemovesIt() { domain.getStatus().addCondition(new DomainCondition(Progressing).withStatus("True")); testSupport.runSteps(DomainStatusUpdater.createFailureRelatedSteps(failure, endStep)); @@ -1005,7 +1005,7 @@ public void whenDomainHasProgressingTrueCondition_failedStepRemovesIt() { } @Test - public void whenPacketNotPopulatedBeforeUpdateServerStatus_resourceVersionUpdated() { + void whenPacketNotPopulatedBeforeUpdateServerStatus_resourceVersionUpdated() { setupInitialServerStatus(); String cachedResourceVersion = getRecordedDomain().getMetadata().getResourceVersion(); @@ -1018,7 +1018,7 @@ public void whenPacketNotPopulatedBeforeUpdateServerStatus_resourceVersionUpdate } @Test - public void whenPacketPopulatedBeforeUpdateServerStatus_resourceVersionNotUpdated() { + void whenPacketPopulatedBeforeUpdateServerStatus_resourceVersionNotUpdated() { setupInitialServerStatus(); String cachedResourceVersion = getRecordedDomain().getMetadata().getResourceVersion(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/DomainUpPlanTest.java b/operator/src/test/java/oracle/kubernetes/operator/DomainUpPlanTest.java index a9ce308a012..903c6a5b3b0 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/DomainUpPlanTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/DomainUpPlanTest.java @@ -44,7 +44,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; -public class DomainUpPlanTest { +class DomainUpPlanTest { private final TerminalStep adminStep = new TerminalStep(); private final TerminalStep managedServersStep = new TerminalStep(); @@ -81,7 +81,7 @@ public void tearDown() throws Exception { } @Test - public void whenStartPolicyNull_runAdminStepOnly() { + void whenStartPolicyNull_runAdminStepOnly() { testSupport.runSteps(getDomainPresenceStep()); assertThat(adminStep.wasRun(), is(true)); @@ -89,7 +89,7 @@ public void whenStartPolicyNull_runAdminStepOnly() { } @Test - public void whenNotShuttingDown_runAdminStepOnly() { + void whenNotShuttingDown_runAdminStepOnly() { configurator.setShuttingDown(false); testSupport.runSteps(getDomainPresenceStep()); @@ -99,7 +99,7 @@ public void whenNotShuttingDown_runAdminStepOnly() { } @Test - public void whenShuttingDown_runManagedServersStepOnly() { + void whenShuttingDown_runManagedServersStepOnly() { configurator.setShuttingDown(true); testSupport.runSteps(getDomainPresenceStep()); @@ -109,7 +109,7 @@ public void whenShuttingDown_runManagedServersStepOnly() { } @Test - public void whenNotShuttingDown_selectAdminServerStep() { + void whenNotShuttingDown_selectAdminServerStep() { configurator.setShuttingDown(false); Step plan = processor.createDomainUpPlan(new DomainPresenceInfo(domain)); @@ -118,7 +118,7 @@ public void whenNotShuttingDown_selectAdminServerStep() { } @Test - public void whenShuttingDown_selectManagedServerStepOnly() { + void whenShuttingDown_selectManagedServerStepOnly() { configurator.setShuttingDown(true); Step plan = processor.createDomainUpPlan(new DomainPresenceInfo(domain)); @@ -130,7 +130,7 @@ public void whenShuttingDown_selectManagedServerStepOnly() { } @Test - public void useSequenceBeforeAdminServerStep() { + void useSequenceBeforeAdminServerStep() { Step plan = processor.createDomainUpPlan(new DomainPresenceInfo(domain)); assertThat( @@ -147,7 +147,7 @@ public void useSequenceBeforeAdminServerStep() { } @Test - public void whenAdminPodCreated_hasListenPort() throws NoSuchFieldException { + void whenAdminPodCreated_hasListenPort() throws NoSuchFieldException { mementos.add(UnitTestHash.install()); WlsDomainConfigSupport configSupport = new WlsDomainConfigSupport("domain"); diff --git a/operator/src/test/java/oracle/kubernetes/operator/DomainWatcherTest.java b/operator/src/test/java/oracle/kubernetes/operator/DomainWatcherTest.java index 1b2adf9aa3b..30cab0c6b22 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/DomainWatcherTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/DomainWatcherTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.is; /** This test class verifies the behavior of the DomainWatcher. */ -public class DomainWatcherTest extends WatcherTestBase implements WatchListener { +class DomainWatcherTest extends WatcherTestBase implements WatchListener { private static final BigInteger INITIAL_RESOURCE_VERSION = new BigInteger("456"); private static final String BOOKMARK_RESOURCE_VERSION = "987"; @@ -37,7 +37,7 @@ public void receivedResponse(Watch.Response response) { } @Test - public void initialRequest_specifiesStartingResourceVersion() { + void initialRequest_specifiesStartingResourceVersion() { sendInitialRequest(INITIAL_RESOURCE_VERSION); assertThat( @@ -46,14 +46,14 @@ public void initialRequest_specifiesStartingResourceVersion() { } @Test - public void whenWatcherReceivesBookmarkEvent_updateResourceVersion() { + void whenWatcherReceivesBookmarkEvent_updateResourceVersion() { Watcher watcher = sendBookmarkRequest(INITIAL_RESOURCE_VERSION, BOOKMARK_RESOURCE_VERSION); assertThat(watcher.getResourceVersion(), is(BOOKMARK_RESOURCE_VERSION)); } @Test - public void whenDomainAdded_createPersistentVolumeClaim() { + void whenDomainAdded_createPersistentVolumeClaim() { scheduleAddResponse(domain); } diff --git a/operator/src/test/java/oracle/kubernetes/operator/EventProcessingTest.java b/operator/src/test/java/oracle/kubernetes/operator/EventProcessingTest.java index c0fcc5d3839..aeef30ef9b1 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/EventProcessingTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/EventProcessingTest.java @@ -29,7 +29,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class EventProcessingTest { +class EventProcessingTest { private static final String NS = "namespace"; private static final String UID = "uid"; private static final String ADMIN_NAME = "admin"; @@ -61,7 +61,7 @@ public void tearDown() { } @Test - public void onNewEventWithNoInvolvedObject_doNothing() { + void onNewEventWithNoInvolvedObject_doNothing() { event.setInvolvedObject(null); dispatchEventWatch(); @@ -70,7 +70,7 @@ public void onNewEventWithNoInvolvedObject_doNothing() { } @Test - public void onNewEventWithNoMessage_doNothing() { + void onNewEventWithNoMessage_doNothing() { event.setMessage(null); dispatchEventWatch(); @@ -79,7 +79,7 @@ public void onNewEventWithNoMessage_doNothing() { } @Test - public void onNewEventWithNonReadinessProbeMessage_doNothing() { + void onNewEventWithNonReadinessProbeMessage_doNothing() { event.setMessage("ignore this"); dispatchEventWatch(); @@ -88,7 +88,7 @@ public void onNewEventWithNonReadinessProbeMessage_doNothing() { } @Test - public void onNewEventWithReadinessProbeMessageButNoMatchingNamespace_doNothing() { + void onNewEventWithReadinessProbeMessageButNoMatchingNamespace_doNothing() { presenceInfoMap.remove(NS); dispatchEventWatch(); @@ -97,7 +97,7 @@ public void onNewEventWithReadinessProbeMessageButNoMatchingNamespace_doNothing( } @Test - public void onNewEventWithNoMatchingDomain_doNothing() { + void onNewEventWithNoMatchingDomain_doNothing() { presenceInfoMap.put(NS, Collections.emptyMap()); dispatchEventWatch(); @@ -106,7 +106,7 @@ public void onNewEventWithNoMatchingDomain_doNothing() { } @Test - public void onNewEventThatDoesNotMatchDomain_doNothing() { + void onNewEventThatDoesNotMatchDomain_doNothing() { serverReference.setName(LegalNames.toEventName("uid2", ADMIN_NAME)); dispatchEventWatch(); @@ -115,7 +115,7 @@ public void onNewEventThatDoesNotMatchDomain_doNothing() { } @Test - public void onNewEventThatMatches_updateLastKnownStatus() { + void onNewEventThatMatches_updateLastKnownStatus() { info.setServerPod(ADMIN_NAME, new V1Pod()); dispatchEventWatch(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/JobWatcherTest.java b/operator/src/test/java/oracle/kubernetes/operator/JobWatcherTest.java index 902e66d4fee..9117dfc0cab 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/JobWatcherTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/JobWatcherTest.java @@ -37,7 +37,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; /** This test class verifies the behavior of the JobWatcher. */ -public class JobWatcherTest extends WatcherTestBase implements WatchListener { +class JobWatcherTest extends WatcherTestBase implements WatchListener { private static final BigInteger INITIAL_RESOURCE_VERSION = new BigInteger("234"); private OffsetDateTime clock = SystemClock.now(); @@ -75,7 +75,7 @@ public void receivedResponse(Watch.Response response) { } @Test - public void initialRequest_specifiesStartingResourceVersionAndStandardLabelSelector() { + void initialRequest_specifiesStartingResourceVersionAndStandardLabelSelector() { sendInitialRequest(INITIAL_RESOURCE_VERSION); assertThat( @@ -104,26 +104,26 @@ private JobWatcher createWatcher(AtomicBoolean stopping) { } @Test - public void whenJobHasNoStatus_reportNotComplete() { + void whenJobHasNoStatus_reportNotComplete() { assertThat(JobWatcher.isComplete(cachedJob), is(false)); } @Test - public void whenJobHasNoCondition_reportNotComplete() { + void whenJobHasNoCondition_reportNotComplete() { cachedJob.status(new V1JobStatus()); assertThat(JobWatcher.isComplete(cachedJob), is(false)); } @Test - public void whenJobConditionTypeFailed_reportNotComplete() { + void whenJobConditionTypeFailed_reportNotComplete() { cachedJob.status(new V1JobStatus().addConditionsItem(new V1JobCondition().type("Failed"))); assertThat(JobWatcher.isComplete(cachedJob), is(false)); } @Test - public void whenJobConditionStatusFalse_reportNotComplete() { + void whenJobConditionStatusFalse_reportNotComplete() { cachedJob.status( new V1JobStatus().addConditionsItem(new V1JobCondition().type("Complete").status("False"))); @@ -131,21 +131,21 @@ public void whenJobConditionStatusFalse_reportNotComplete() { } @Test - public void whenJobConditionTypeFailedWithTrueStatus_reportFailed() { + void whenJobConditionTypeFailedWithTrueStatus_reportFailed() { markJobConditionFailed(cachedJob); assertThat(JobWatcher.isFailed(cachedJob), is(true)); } @Test - public void whenJobConditionTypeFailedWithNoStatus_reportNotFailed() { + void whenJobConditionTypeFailedWithNoStatus_reportNotFailed() { cachedJob.status(new V1JobStatus().addConditionsItem(new V1JobCondition().type("Failed").status(""))); assertThat(JobWatcher.isFailed(cachedJob), is(false)); } @Test - public void whenJobHasStatusWithNoConditionsAndNotFailed_reportNotFailed() { + void whenJobHasStatusWithNoConditionsAndNotFailed_reportNotFailed() { cachedJob.status(new V1JobStatus().conditions(Collections.emptyList())); assertThat(JobWatcher.isFailed(cachedJob), is(false)); @@ -153,7 +153,7 @@ public void whenJobHasStatusWithNoConditionsAndNotFailed_reportNotFailed() { @Test - public void whenJobRunningAndReadyConditionIsTrue_reportComplete() { + void whenJobRunningAndReadyConditionIsTrue_reportComplete() { markJobCompleted(cachedJob); assertThat(JobWatcher.isComplete(cachedJob), is(true)); @@ -198,68 +198,68 @@ private V1Job setFailedConditionWithReason(V1Job job, String reason) { } @Test - public void whenJobHasNoStatus_reportNotFailed() { + void whenJobHasNoStatus_reportNotFailed() { assertThat(JobWatcher.isFailed(cachedJob), is(false)); } @Test - public void whenJobHasFailedCount_reportFailed() { + void whenJobHasFailedCount_reportFailed() { cachedJob.status(new V1JobStatus().failed(1)); assertThat(JobWatcher.isFailed(cachedJob), is(true)); } @Test - public void whenJobHasFailedReason_getFailedReasonReturnsIt() { + void whenJobHasFailedReason_getFailedReasonReturnsIt() { setFailedWithReason(cachedJob, "AReason"); assertThat(JobWatcher.getFailedReason(cachedJob), is("AReason")); } @Test - public void whenJobHasNoFailedReason_getFailedReasonReturnsNull() { + void whenJobHasNoFailedReason_getFailedReasonReturnsNull() { setFailedWithReason(cachedJob, null); assertThat(JobWatcher.getFailedReason(cachedJob), nullValue()); } @Test - public void whenJobHasNoFailedCondition_getFailedReasonReturnsNull() { + void whenJobHasNoFailedCondition_getFailedReasonReturnsNull() { cachedJob.status(new V1JobStatus().addConditionsItem(createCondition("Complete"))); assertThat(JobWatcher.getFailedReason(cachedJob), nullValue()); } @Test - public void whenJobHasNoJobCondition_getFailedReasonReturnsNull() { + void whenJobHasNoJobCondition_getFailedReasonReturnsNull() { cachedJob.status(new V1JobStatus().conditions(Collections.emptyList())); assertThat(JobWatcher.getFailedReason(cachedJob), nullValue()); } @Test - public void waitForReady_returnsAStep() { + void waitForReady_returnsAStep() { JobWatcher watcher = createWatcher(new AtomicBoolean(true)); assertThat(watcher.waitForReady(cachedJob, null), instanceOf(Step.class)); } @Test - public void whenWaitForReadyAppliedToReadyJob_performNextStep() { + void whenWaitForReadyAppliedToReadyJob_performNextStep() { startWaitForReady(this::markJobCompleted); assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenWaitForReadyAppliedToIncompleteJob_dontPerformNextStep() { + void whenWaitForReadyAppliedToIncompleteJob_dontPerformNextStep() { startWaitForReady(this::dontChangeJob); assertThat(terminalStep.wasRun(), is(false)); } @Test - public void whenWaitForReadyAppliedToTimedOutJobWithDeadlineExceeded_terminateWithException() { + void whenWaitForReadyAppliedToTimedOutJobWithDeadlineExceeded_terminateWithException() { startWaitForReady(job -> markJobTimedOut(job, "DeadlineExceeded")); assertThat(terminalStep.wasRun(), is(false)); @@ -267,14 +267,14 @@ public void whenWaitForReadyAppliedToTimedOutJobWithDeadlineExceeded_terminateWi } @Test - public void whenWaitForReadyAppliedToFailedJob_performNextStep() { + void whenWaitForReadyAppliedToFailedJob_performNextStep() { startWaitForReady(this::markJobFailed); assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenWaitForReadyAppliedToJobWithFailedCondition_performNextStep() { + void whenWaitForReadyAppliedToJobWithFailedCondition_performNextStep() { startWaitForReady(this::markJobConditionFailed); assertThat(terminalStep.wasRun(), is(true)); @@ -295,21 +295,21 @@ private void startWaitForReady(Function jobFunction) { } @Test - public void whenJobCompletedOnFirstRead_performNextStep() { + void whenJobCompletedOnFirstRead_performNextStep() { startWaitForReadyThenReadJob(this::markJobCompleted); assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenJobInProcessOnFirstRead_dontPerformNextStep() { + void whenJobInProcessOnFirstRead_dontPerformNextStep() { startWaitForReadyThenReadJob(this::dontChangeJob); assertThat(terminalStep.wasRun(), is(false)); } @Test - public void whenJobTimedOutOnFirstRead_terminateWithException() { + void whenJobTimedOutOnFirstRead_terminateWithException() { startWaitForReadyThenReadJob(this::markJobTimedOut); assertThat(terminalStep.wasRun(), is(false)); @@ -317,7 +317,7 @@ public void whenJobTimedOutOnFirstRead_terminateWithException() { } @Test - public void whenJobFailedOnFirstRead_performNextStep() { + void whenJobFailedOnFirstRead_performNextStep() { startWaitForReadyThenReadJob(this::markJobFailed); assertThat(terminalStep.wasRun(), is(true)); @@ -339,7 +339,7 @@ private void startWaitForReadyThenReadJob(Function jobFunction) { } @Test - public void whenReceivedDeadlineExceededResponse_terminateWithException() { + void whenReceivedDeadlineExceededResponse_terminateWithException() { sendJobModifiedWatchAfterWaitForReady(this::markJobTimedOut); assertThat(terminalStep.wasRun(), is(false)); @@ -347,28 +347,28 @@ public void whenReceivedDeadlineExceededResponse_terminateWithException() { } @Test - public void whenReceivedFailedWithNoReasonResponse_performNextStep() { + void whenReceivedFailedWithNoReasonResponse_performNextStep() { sendJobModifiedWatchAfterWaitForReady(this::markJobFailed); assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenReceivedCompleteResponse_performNextStep() { + void whenReceivedCompleteResponse_performNextStep() { sendJobModifiedWatchAfterWaitForReady(this::markJobCompleted); assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenReceivedCallbackForDifferentCompletedJob_ignoreIt() { + void whenReceivedCallbackForDifferentCompletedJob_ignoreIt() { sendJobModifiedWatchAfterWaitForReady(this::createCompletedJobWithDifferentTimestamp); assertThat(terminalStep.wasRun(), is(false)); } @Test - public void whenReceivedCallbackForIncompleteJob_ignoreIt() { + void whenReceivedCallbackForIncompleteJob_ignoreIt() { sendJobModifiedWatchAfterWaitForReady(this::dontChangeJob); assertThat(terminalStep.wasRun(), is(false)); diff --git a/operator/src/test/java/oracle/kubernetes/operator/MainTest.java b/operator/src/test/java/oracle/kubernetes/operator/MainTest.java index 104c7d9ba9b..3eefd7d6923 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/MainTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/MainTest.java @@ -99,7 +99,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -public class MainTest extends ThreadFactoryTestBase { +class MainTest extends ThreadFactoryTestBase { public static final VersionInfo TEST_VERSION_INFO = new VersionInfo().major("1").minor("18").gitVersion("0"); public static final KubernetesVersion TEST_VERSION = new KubernetesVersion(TEST_VERSION_INFO); @@ -203,7 +203,7 @@ public void tearDown() throws Exception { } @Test - public void whenOperatorCreated_logStartupMessage() { + void whenOperatorCreated_logStartupMessage() { loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, OPERATOR_STARTED); Main.createMain(buildProperties); @@ -212,7 +212,7 @@ public void whenOperatorCreated_logStartupMessage() { } @Test - public void whenOperatorCreated_logOperatorNamespace() { + void whenOperatorCreated_logOperatorNamespace() { loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, OP_CONFIG_NAMESPACE); Main.createMain(buildProperties); @@ -221,7 +221,7 @@ public void whenOperatorCreated_logOperatorNamespace() { } @Test - public void whenOperatorCreated_logServiceAccountName() { + void whenOperatorCreated_logServiceAccountName() { loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, OP_CONFIG_SERVICE_ACCOUNT); Main.createMain(buildProperties); @@ -230,7 +230,7 @@ public void whenOperatorCreated_logServiceAccountName() { } @Test - public void whenOperatorCreatedWithListNamespaceStrategy_logConfiguredNamespaces() { + void whenOperatorCreatedWithListNamespaceStrategy_logConfiguredNamespaces() { loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, OP_CONFIG_DOMAIN_NAMESPACES); defineSelectionStrategy(SelectionStrategy.List); HelmAccessStub.defineVariable(HelmAccess.OPERATOR_DOMAIN_NAMESPACES, @@ -243,7 +243,7 @@ public void whenOperatorCreatedWithListNamespaceStrategy_logConfiguredNamespaces } @Test - public void whenOperatorCreatedWithDedicatedNamespaceStrategy_logConfiguredNamespaces() { + void whenOperatorCreatedWithDedicatedNamespaceStrategy_logConfiguredNamespaces() { loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, OP_CONFIG_DOMAIN_NAMESPACES); defineSelectionStrategy(SelectionStrategy.Dedicated); @@ -253,7 +253,7 @@ public void whenOperatorCreatedWithDedicatedNamespaceStrategy_logConfiguredNames } @Test - public void whenOperatorCreatedWithRegExpNamespaceStrategy_dontLogConfiguredNamespaces() { + void whenOperatorCreatedWithRegExpNamespaceStrategy_dontLogConfiguredNamespaces() { loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, OP_CONFIG_DOMAIN_NAMESPACES); defineSelectionStrategy(SelectionStrategy.RegExp); @@ -263,7 +263,7 @@ public void whenOperatorCreatedWithRegExpNamespaceStrategy_dontLogConfiguredName } @Test - public void whenOperatorCreatedWithLabelSelectorNamespaceStrategy_dontLogConfiguredNamespaces() { + void whenOperatorCreatedWithLabelSelectorNamespaceStrategy_dontLogConfiguredNamespaces() { loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, OP_CONFIG_DOMAIN_NAMESPACES); defineSelectionStrategy(SelectionStrategy.LabelSelector); @@ -273,27 +273,27 @@ public void whenOperatorCreatedWithLabelSelectorNamespaceStrategy_dontLogConfigu } @Test - public void whenOperatorStarted_namespaceWatcherIsCreated() { + void whenOperatorStarted_namespaceWatcherIsCreated() { main.startOperator(null); assertThat(main.getNamespaceWatcher(), notNullValue()); } @Test - public void whenOperatorStarted_operatorNamespaceEventWatcherIsCreated() { + void whenOperatorStarted_operatorNamespaceEventWatcherIsCreated() { main.startOperator(null); assertThat(main.getOperatorNamespaceEventWatcher(), notNullValue()); } @Test - public void whenOperatorStarted_withoutExistingEvent_nsEventK8SObjectsEmpty() { + void whenOperatorStarted_withoutExistingEvent_nsEventK8SObjectsEmpty() { main.startOperator(null); assertThat(getNSEventMapSize(), equalTo(0)); } @Test - public void whenOperatorStarted_withExistingEvents_nsEventK8SObjectsPopulated() { + void whenOperatorStarted_withExistingEvents_nsEventK8SObjectsPopulated() { CoreV1Event event1 = createNSEvent("event1").reason(START_MANAGING_NAMESPACE_EVENT); CoreV1Event event2 = createNSEvent("event2").reason(STOP_MANAGING_NAMESPACE_EVENT); @@ -316,7 +316,7 @@ private CoreV1Event createNSEvent(String name) { } @Test - public void whenOperatorStartedInDedicatedMode_namespaceWatcherIsNotCreated() { + void whenOperatorStartedInDedicatedMode_namespaceWatcherIsNotCreated() { defineSelectionStrategy(SelectionStrategy.Dedicated); main.startOperator(null); @@ -325,7 +325,7 @@ public void whenOperatorStartedInDedicatedMode_namespaceWatcherIsNotCreated() { } @Test - public void whenOperatorStartedInDedicatedMode_operatorNamespaceEventWatcherIsNotCreated() { + void whenOperatorStartedInDedicatedMode_operatorNamespaceEventWatcherIsNotCreated() { defineSelectionStrategy(SelectionStrategy.Dedicated); main.startOperator(null); @@ -334,7 +334,7 @@ public void whenOperatorStartedInDedicatedMode_operatorNamespaceEventWatcherIsNo } @Test - public void whenUnableToCreateCRD_dontTryToStartWatchers() { + void whenUnableToCreateCRD_dontTryToStartWatchers() { simulateMissingCRD(); recheckDomains(); @@ -355,7 +355,7 @@ private void runCreateReadNamespacesStep() { } @Test - public void whenNoCRD_logReasonForFailure() { + void whenNoCRD_logReasonForFailure() { loggerControl.withLogLevel(Level.SEVERE).collectLogMessages(logRecords, CRD_NOT_INSTALLED); simulateMissingCRD(); @@ -365,7 +365,7 @@ public void whenNoCRD_logReasonForFailure() { } @Test - public void afterLoggedCRDMissing_dontDoItASecondTime() { + void afterLoggedCRDMissing_dontDoItASecondTime() { loggerControl.withLogLevel(Level.SEVERE).collectLogMessages(logRecords, CRD_NOT_INSTALLED); simulateMissingCRD(); recheckDomains(); @@ -377,7 +377,7 @@ public void afterLoggedCRDMissing_dontDoItASecondTime() { } @Test - public void afterMissingCRDdetected_correctionOfTheConditionAllowsProcessingToOccur() { + void afterMissingCRDdetected_correctionOfTheConditionAllowsProcessingToOccur() { defineSelectionStrategy(SelectionStrategy.Dedicated); simulateMissingCRD(); recheckDomains(); @@ -389,7 +389,7 @@ public void afterMissingCRDdetected_correctionOfTheConditionAllowsProcessingToOc } @Test - public void afterMissingCRDcorrected_subsequentFailureLogsReasonForFailure() { + void afterMissingCRDcorrected_subsequentFailureLogsReasonForFailure() { simulateMissingCRD(); recheckDomains(); testSupport.cancelFailures(); @@ -403,7 +403,7 @@ public void afterMissingCRDcorrected_subsequentFailureLogsReasonForFailure() { } @Test - public void withNamespaceList_onCreateReadNamespaces_startsNamespaces() { + void withNamespaceList_onCreateReadNamespaces_startsNamespaces() { defineSelectionStrategy(SelectionStrategy.List); HelmAccessStub.defineVariable(HelmAccess.OPERATOR_DOMAIN_NAMESPACES, String.join(",", NS_WEBLOGIC1, NS_WEBLOGIC2, NS_WEBLOGIC3)); @@ -452,7 +452,7 @@ public void describeTo(Description description) { } @Test - public void withRegExp_onCreateReadNamespaces_startsNamespaces() { + void withRegExp_onCreateReadNamespaces_startsNamespaces() { defineSelectionStrategy(SelectionStrategy.RegExp); testSupport.defineResources(NAMESPACE_WEBLOGIC1, NAMESPACE_WEBLOGIC2, NAMESPACE_WEBLOGIC3, NAMESPACE_WEBLOGIC4, NAMESPACE_WEBLOGIC5); @@ -464,7 +464,7 @@ public void withRegExp_onCreateReadNamespaces_startsNamespaces() { } @Test - public void withLabelSelector_onCreateReadNamespaces_startsNamespaces() { + void withLabelSelector_onCreateReadNamespaces_startsNamespaces() { defineSelectionStrategy(SelectionStrategy.LabelSelector); testSupport.defineResources(NAMESPACE_WEBLOGIC1, NAMESPACE_WEBLOGIC2, NAMESPACE_WEBLOGIC3, NAMESPACE_WEBLOGIC4, NAMESPACE_WEBLOGIC5); @@ -484,7 +484,7 @@ private V1ObjectMeta createMetadata(OffsetDateTime creationTimestamp) { } @Test - public void whenConfiguredDomainNamespaceMissing_logWarning() { + void whenConfiguredDomainNamespaceMissing_logWarning() { loggerControl.withLogLevel(Level.WARNING).collectLogMessages(logRecords, MessageKeys.NAMESPACE_IS_MISSING); defineSelectionStrategy(SelectionStrategy.List); @@ -498,7 +498,7 @@ public void whenConfiguredDomainNamespaceMissing_logWarning() { } @Test - public void whenNamespacesListedInOneChunk_dontDeclarePresentNamespacesAsMissing() { + void whenNamespacesListedInOneChunk_dontDeclarePresentNamespacesAsMissing() { loggerControl.withLogLevel(Level.WARNING).collectLogMessages(logRecords, MessageKeys.NAMESPACE_IS_MISSING); defineSelectionStrategy(SelectionStrategy.List); @@ -514,7 +514,7 @@ private void defineSelectionStrategy(SelectionStrategy selectionStrategy) { } @Test - public void whenNamespacesListedInMultipleChunks_allNamespacesStarted() { + void whenNamespacesListedInMultipleChunks_allNamespacesStarted() { loggerControl.withLogLevel(Level.WARNING).collectLogMessages(logRecords, MessageKeys.NAMESPACE_IS_MISSING); defineSelectionStrategy(SelectionStrategy.List); @@ -529,7 +529,7 @@ public void whenNamespacesListedInMultipleChunks_allNamespacesStarted() { } @Test - public void whenNamespacesListedInMoreThanTwoChunks_allNamespacesStarted() { + void whenNamespacesListedInMoreThanTwoChunks_allNamespacesStarted() { loggerControl.withLogLevel(Level.WARNING).collectLogMessages(logRecords, MessageKeys.NAMESPACE_IS_MISSING); int lastNSNumber = DEFAULT_CALL_LIMIT * 3 + 1; defineSelectionStrategy(SelectionStrategy.List); @@ -543,7 +543,7 @@ public void whenNamespacesListedInMoreThanTwoChunks_allNamespacesStarted() { } @Test - public void whenNamespacesListedInMultipleChunks_dontDeclarePresentNamespacesAsMissing() { + void whenNamespacesListedInMultipleChunks_dontDeclarePresentNamespacesAsMissing() { loggerControl.withLogLevel(Level.WARNING).collectLogMessages(logRecords, MessageKeys.NAMESPACE_IS_MISSING); defineSelectionStrategy(SelectionStrategy.List); @@ -567,7 +567,7 @@ private V1Namespace createNamespace(String ns) { } @Test - public void deleteDomainPresenceWithTimeCheck_delete_with_same_DateTime() { + void deleteDomainPresenceWithTimeCheck_delete_with_same_DateTime() { OffsetDateTime creationDatetime = SystemClock.now(); V1ObjectMeta domainMeta = createMetadata(creationDatetime); @@ -577,7 +577,7 @@ public void deleteDomainPresenceWithTimeCheck_delete_with_same_DateTime() { } @Test - public void deleteDomainPresenceWithTimeCheck_delete_with_newer_DateTime() { + void deleteDomainPresenceWithTimeCheck_delete_with_newer_DateTime() { OffsetDateTime creationDatetime = SystemClock.now(); V1ObjectMeta domainMeta = createMetadata(creationDatetime); @@ -588,7 +588,7 @@ public void deleteDomainPresenceWithTimeCheck_delete_with_newer_DateTime() { } @Test - public void deleteDomainPresenceWithTimeCheck_doNotDelete_with_older_DateTime() { + void deleteDomainPresenceWithTimeCheck_doNotDelete_with_older_DateTime() { OffsetDateTime creationDatetime = SystemClock.now(); V1ObjectMeta domainMeta = createMetadata(creationDatetime); @@ -599,7 +599,7 @@ public void deleteDomainPresenceWithTimeCheck_doNotDelete_with_older_DateTime() } @Test - public void afterReadingExistingResourcesForNamespace_WatchersAreDefined() { + void afterReadingExistingResourcesForNamespace_WatchersAreDefined() { testSupport.runSteps(domainNamespaces.readExistingResources(NS, createStrictStub(DomainProcessor.class))); assertThat(domainNamespaces.getConfigMapWatcher(NS), notNullValue()); @@ -612,20 +612,20 @@ public void afterReadingExistingResourcesForNamespace_WatchersAreDefined() { } @Test - public void afterReadingExistingResourcesForNamespace_ScriptConfigMapIsDefined() { + void afterReadingExistingResourcesForNamespace_ScriptConfigMapIsDefined() { testSupport.runSteps(domainNamespaces.readExistingResources(NS, createStrictStub(DomainProcessor.class))); assertThat(getScriptMap(NS), notNullValue()); } @Test - public void afterReadingExistingResourcesForNamespace_withoutExistingEvent_domainEventK8SObjectsEmpty() { + void afterReadingExistingResourcesForNamespace_withoutExistingEvent_domainEventK8SObjectsEmpty() { testSupport.runSteps(domainNamespaces.readExistingResources(NS, createStrictStub(DomainProcessor.class))); assertThat(getDomainEventMapSize(), equalTo(0)); } @Test - public void afterReadingExistingResourcesForNamespace_withExistingEvents_domainEventK8SObjectsPopulated() { + void afterReadingExistingResourcesForNamespace_withExistingEvents_domainEventK8SObjectsPopulated() { CoreV1Event event1 = createDomainEvent("event1").reason(DOMAIN_CREATED_EVENT); CoreV1Event event2 = createDomainEvent("event2").reason(DOMAIN_CHANGED_EVENT); @@ -674,7 +674,7 @@ private boolean isScriptConfigMapMetadata(V1ObjectMeta meta, String ns) { } @Test - public void beforeNamespaceAdded_watchersAreNotDefined() { + void beforeNamespaceAdded_watchersAreNotDefined() { HelmAccessStub.defineVariable(HelmAccess.OPERATOR_DOMAIN_NAMESPACES, ns); verifyWatchersNotDefined(main.getDomainNamespaces(), ns); @@ -691,14 +691,14 @@ private void verifyWatchersNotDefined(DomainNamespaces domainNamespaces, String } @Test - public void afterNullNamespaceAdded_WatchersAreNotDefined() { + void afterNullNamespaceAdded_WatchersAreNotDefined() { main.dispatchNamespaceWatch(WatchEvent.createAddedEvent((V1Namespace) null).toWatchResponse()); verifyWatchersNotDefined(main.getDomainNamespaces(), ns); } @Test - public void afterNonDomainNamespaceAdded_WatchersAreNotDefined() { + void afterNonDomainNamespaceAdded_WatchersAreNotDefined() { HelmAccessStub.defineVariable(HelmAccess.OPERATOR_DOMAIN_NAMESPACES, NS_WEBLOGIC1); V1Namespace namespace = new V1Namespace().metadata(new V1ObjectMeta().name(ns)); main.dispatchNamespaceWatch(WatchEvent.createAddedEvent(namespace).toWatchResponse()); @@ -707,7 +707,7 @@ public void afterNonDomainNamespaceAdded_WatchersAreNotDefined() { } @Test - public void afterNamespaceAdded_WatchersAreDefined() { + void afterNamespaceAdded_WatchersAreDefined() { HelmAccessStub.defineVariable(HelmAccess.OPERATOR_DOMAIN_NAMESPACES, ns); V1Namespace namespace = new V1Namespace().metadata(new V1ObjectMeta().name(ns)); @@ -727,7 +727,7 @@ private void verifyWatchersDefined(DomainNamespaces domainNamespaces, String ns) } @Test - public void afterNamespaceAdded_scriptConfigMapIsDefined() { + void afterNamespaceAdded_scriptConfigMapIsDefined() { HelmAccessStub.defineVariable(HelmAccess.OPERATOR_DOMAIN_NAMESPACES, ns); V1Namespace namespace = new V1Namespace().metadata(new V1ObjectMeta().name(ns)); main.dispatchNamespaceWatch(WatchEvent.createAddedEvent(namespace).toWatchResponse()); @@ -736,7 +736,7 @@ public void afterNamespaceAdded_scriptConfigMapIsDefined() { } @Test - public void withNamespaceList_onCreateStartNamespacesStep_nsWatchStartedEventCreatedWithExpectedMessage() { + void withNamespaceList_onCreateStartNamespacesStep_nsWatchStartedEventCreatedWithExpectedMessage() { defineSelectionStrategy(SelectionStrategy.List); HelmAccessStub.defineVariable(HelmAccess.OPERATOR_DOMAIN_NAMESPACES, String.join(",", NS_WEBLOGIC1, NS_WEBLOGIC2, NS_WEBLOGIC3)); @@ -753,7 +753,7 @@ public void withNamespaceList_onCreateStartNamespacesStep_nsWatchStartedEventCre } @Test - public void withNamespaceList_onCreateStartNamespacesStep_startManagingNSEventCreatedWithExpectedMessage() { + void withNamespaceList_onCreateStartNamespacesStep_startManagingNSEventCreatedWithExpectedMessage() { defineSelectionStrategy(SelectionStrategy.List); HelmAccessStub.defineVariable(HelmAccess.OPERATOR_DOMAIN_NAMESPACES, NS_WEBLOGIC1); @@ -771,7 +771,7 @@ public void withNamespaceList_onCreateStartNamespacesStep_startManagingNSEventCr } @Test - public void withNamespaceList_onCreateStartNamespacesStep_foundExpectedLogMessage() { + void withNamespaceList_onCreateStartNamespacesStep_foundExpectedLogMessage() { logRecords.clear(); loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, MessageKeys.BEGIN_MANAGING_NAMESPACE); defineSelectionStrategy(SelectionStrategy.List); @@ -790,7 +790,7 @@ public void withNamespaceList_onCreateStartNamespacesStep_foundExpectedLogMessag } @Test - public void withNamespaceList_onCreateReadNamespaces_whenConfiguredDomainNamespaceMissing_noEventCreated() { + void withNamespaceList_onCreateReadNamespaces_whenConfiguredDomainNamespaceMissing_noEventCreated() { defineSelectionStrategy(SelectionStrategy.List); String namespaceString = "NS" + LAST_NAMESPACE_NUM + ",NS" + DEFAULT_CALL_LIMIT; HelmAccessStub.defineVariable(HelmAccess.OPERATOR_DOMAIN_NAMESPACES, namespaceString); @@ -803,7 +803,7 @@ public void withNamespaceList_onCreateReadNamespaces_whenConfiguredDomainNamespa } @Test - public void withNamespaceList_onCreateReadNamespaces_whenDomainNamespaceRemoved_nsWatchStoppedEventCreated() { + void withNamespaceList_onCreateReadNamespaces_whenDomainNamespaceRemoved_nsWatchStoppedEventCreated() { domainNamespaces.isStopping("NS3"); defineSelectionStrategy(SelectionStrategy.List); String namespaceString = "NS1,NS2"; @@ -817,7 +817,7 @@ public void withNamespaceList_onCreateReadNamespaces_whenDomainNamespaceRemoved_ } @Test - public void withNamespaceList_onCreateReadNamespaces_whenDomainNamespaceRemoved_stopManagingNSEventCreated() { + void withNamespaceList_onCreateReadNamespaces_whenDomainNamespaceRemoved_stopManagingNSEventCreated() { domainNamespaces.isStopping("NS3"); defineSelectionStrategy(SelectionStrategy.List); String namespaceString = "NS1,NS2"; @@ -832,7 +832,7 @@ public void withNamespaceList_onCreateReadNamespaces_whenDomainNamespaceRemoved_ } @Test - public void withNamespaceList_onCreateReadNamespaces_whenDomainNamespaceRemoved_foundExpectedLogMessage() { + void withNamespaceList_onCreateReadNamespaces_whenDomainNamespaceRemoved_foundExpectedLogMessage() { logRecords.clear(); loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, MessageKeys.END_MANAGING_NAMESPACE); domainNamespaces.isStopping("NS3"); @@ -846,7 +846,7 @@ public void withNamespaceList_onCreateReadNamespaces_whenDomainNamespaceRemoved_ } @Test - public void withNamespaceList_changeToDedicated_onCreateReadNamespaces_nsWatchStoppedEventCreated() { + void withNamespaceList_changeToDedicated_onCreateReadNamespaces_nsWatchStoppedEventCreated() { defineNamespaceListStrategy("NS1"); runCreateReadNamespacesStep(); @@ -859,7 +859,7 @@ public void withNamespaceList_changeToDedicated_onCreateReadNamespaces_nsWatchSt } @Test - public void withNamespaceList_changeToDedicated_onCreateReadNamespaces_nsWatchStartedEventCreatedInOpNS() { + void withNamespaceList_changeToDedicated_onCreateReadNamespaces_nsWatchStartedEventCreatedInOpNS() { defineNamespaceListStrategy("NS1"); runCreateReadNamespacesStep(); @@ -878,7 +878,7 @@ private void defineNamespaceListStrategy(String namespaceString) { } @Test - public void withNamespaceList_changeToDedicated_onCreateReadNamespaces_StartManagingEventCreatedInOpNS() { + void withNamespaceList_changeToDedicated_onCreateReadNamespaces_StartManagingEventCreatedInOpNS() { defineNamespaceListStrategy("NS1"); runCreateReadNamespacesStep(); @@ -891,7 +891,7 @@ public void withNamespaceList_changeToDedicated_onCreateReadNamespaces_StartMana } @Test - public void withNamespaceList_changeToDedicated_onCreateReadNamespaces_nsEventMapIsEmpty() { + void withNamespaceList_changeToDedicated_onCreateReadNamespaces_nsEventMapIsEmpty() { defineNamespaceListStrategy("NS1"); runCreateReadNamespacesStep(); @@ -905,7 +905,7 @@ public void withNamespaceList_changeToDedicated_onCreateReadNamespaces_nsEventMa } @Test - public void withNamespaceLabelSelector_onCreateStartNamespacesStep_nsWatchStartedEventCreatedWithExpectedMessage() { + void withNamespaceLabelSelector_onCreateStartNamespacesStep_nsWatchStartedEventCreatedWithExpectedMessage() { defineSelectionStrategy(SelectionStrategy.LabelSelector); testSupport.defineResources(NAMESPACE_WEBLOGIC1, NAMESPACE_WEBLOGIC2, NAMESPACE_WEBLOGIC3, NAMESPACE_WEBLOGIC4, NAMESPACE_WEBLOGIC5); @@ -922,7 +922,7 @@ public void withNamespaceLabelSelector_onCreateStartNamespacesStep_nsWatchStarte } @Test - public void withNamespaceLabelSelector_onCreateStartNamespacesStep_startManagingNSEventCreatedWithExpectedMessage() { + void withNamespaceLabelSelector_onCreateStartNamespacesStep_startManagingNSEventCreatedWithExpectedMessage() { defineSelectionStrategy(SelectionStrategy.LabelSelector); testSupport.defineResources(NAMESPACE_WEBLOGIC1, NAMESPACE_WEBLOGIC2, NAMESPACE_WEBLOGIC3, NAMESPACE_WEBLOGIC4, NAMESPACE_WEBLOGIC5); @@ -940,7 +940,7 @@ public void withNamespaceLabelSelector_onCreateStartNamespacesStep_startManaging @Test - public void withNamespaceLabelSelector_onCreateReadNamespaces_whenLabelRemoved_nsWatchStoppedEventCreated() { + void withNamespaceLabelSelector_onCreateReadNamespaces_whenLabelRemoved_nsWatchStoppedEventCreated() { domainNamespaces.isStopping("NS3"); testSupport.defineResources(NAMESPACE_WEBLOGIC1, NAMESPACE_WEBLOGIC2, NAMESPACE_WEBLOGIC3, NAMESPACE_WEBLOGIC4, NAMESPACE_WEBLOGIC5); @@ -956,7 +956,7 @@ public void withNamespaceLabelSelector_onCreateReadNamespaces_whenLabelRemoved_n } @Test - public void withNamespaceLabelSelector_onCreateReadNamespaces_whenLabelRemoved_stopManagingNSEventCreated() { + void withNamespaceLabelSelector_onCreateReadNamespaces_whenLabelRemoved_stopManagingNSEventCreated() { domainNamespaces.isStopping("NS3"); testSupport.defineResources(NAMESPACE_WEBLOGIC1, NAMESPACE_WEBLOGIC2, NAMESPACE_WEBLOGIC3, NAMESPACE_WEBLOGIC4, NAMESPACE_WEBLOGIC5); @@ -971,7 +971,7 @@ public void withNamespaceLabelSelector_onCreateReadNamespaces_whenLabelRemoved_s } @Test - public void withNamespaceLabelSelector_onCreateReadNamespaces_whenNamespaceLabelRemoved_foundExpectedLogMessage() { + void withNamespaceLabelSelector_onCreateReadNamespaces_whenNamespaceLabelRemoved_foundExpectedLogMessage() { logRecords.clear(); loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, MessageKeys.END_MANAGING_NAMESPACE); domainNamespaces.isStopping("NS3"); @@ -986,7 +986,7 @@ public void withNamespaceLabelSelector_onCreateReadNamespaces_whenNamespaceLabel } @Test - public void withNamespaceRegExp_onCreateStartNamespacesStep_nsWatchStartedEventCreatedWithExpectedMessage() { + void withNamespaceRegExp_onCreateStartNamespacesStep_nsWatchStartedEventCreatedWithExpectedMessage() { defineSelectionStrategy(SelectionStrategy.RegExp); testSupport.defineResources(NAMESPACE_WEBLOGIC1, NAMESPACE_WEBLOGIC2, NAMESPACE_WEBLOGIC3, NAMESPACE_WEBLOGIC4, NAMESPACE_WEBLOGIC5); @@ -1002,7 +1002,7 @@ public void withNamespaceRegExp_onCreateStartNamespacesStep_nsWatchStartedEventC } @Test - public void withNamespaceRegExp_onCreateStartNamespacesStep_startManagingNSEventCreatedWithExpectedMessage() { + void withNamespaceRegExp_onCreateStartNamespacesStep_startManagingNSEventCreatedWithExpectedMessage() { defineSelectionStrategy(SelectionStrategy.RegExp); testSupport.defineResources(NAMESPACE_WEBLOGIC1, NAMESPACE_WEBLOGIC2, NAMESPACE_WEBLOGIC3, NAMESPACE_WEBLOGIC4, NAMESPACE_WEBLOGIC5); @@ -1019,7 +1019,7 @@ public void withNamespaceRegExp_onCreateStartNamespacesStep_startManagingNSEvent } @Test - public void withNamespaceRegExp_onCreateReadNamespaces_whenNamespaceLabelRemoved_nsWatchStoppedEventCreated() { + void withNamespaceRegExp_onCreateReadNamespaces_whenNamespaceLabelRemoved_nsWatchStoppedEventCreated() { domainNamespaces.isStopping("NS3"); testSupport.defineResources(NAMESPACE_WEBLOGIC1, NAMESPACE_WEBLOGIC2, NAMESPACE_WEBLOGIC3, NAMESPACE_WEBLOGIC4, NAMESPACE_WEBLOGIC5); @@ -1034,7 +1034,7 @@ public void withNamespaceRegExp_onCreateReadNamespaces_whenNamespaceLabelRemoved } @Test - public void withNamespaceRegExp_onRCreateReadNamespaces_whenNamespaceLabelRemoved_stopManagingNSEventCreated() { + void withNamespaceRegExp_onRCreateReadNamespaces_whenNamespaceLabelRemoved_stopManagingNSEventCreated() { domainNamespaces.isStopping("NS3"); testSupport.defineResources(NAMESPACE_WEBLOGIC1, NAMESPACE_WEBLOGIC2, NAMESPACE_WEBLOGIC3, NAMESPACE_WEBLOGIC4, NAMESPACE_WEBLOGIC5); @@ -1049,7 +1049,7 @@ public void withNamespaceRegExp_onRCreateReadNamespaces_whenNamespaceLabelRemove } @Test - public void withNamespaceRegExp_onCreateReadNamespaces_whenNamespaceLabelRemoved_foundExpectedLogMessage() { + void withNamespaceRegExp_onCreateReadNamespaces_whenNamespaceLabelRemoved_foundExpectedLogMessage() { logRecords.clear(); loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, MessageKeys.END_MANAGING_NAMESPACE); domainNamespaces.isStopping("NS3"); @@ -1064,7 +1064,7 @@ public void withNamespaceRegExp_onCreateReadNamespaces_whenNamespaceLabelRemoved } @Test - public void withNamespaceDedicated_onCreateReadNamespaces_nsWatchStartedEventCreatedWithExpectedMessage() { + void withNamespaceDedicated_onCreateReadNamespaces_nsWatchStartedEventCreatedWithExpectedMessage() { defineSelectionStrategy(SelectionStrategy.Dedicated); runCreateReadNamespacesStep(); @@ -1077,7 +1077,7 @@ public void withNamespaceDedicated_onCreateReadNamespaces_nsWatchStartedEventCre } @Test - public void withNamespaceDedicated_onCreateReadNamespaces_startManagingNSEventCreatedWithExpectedMessage() { + void withNamespaceDedicated_onCreateReadNamespaces_startManagingNSEventCreatedWithExpectedMessage() { defineSelectionStrategy(SelectionStrategy.Dedicated); runCreateReadNamespacesStep(); @@ -1087,7 +1087,7 @@ public void withNamespaceDedicated_onCreateReadNamespaces_startManagingNSEventCr } @Test - public void withNamespaceDedicated_changeToList_onCreateReadNamespaces_nsWatchStoppedEventCreatedInOpNS() { + void withNamespaceDedicated_changeToList_onCreateReadNamespaces_nsWatchStoppedEventCreatedInOpNS() { defineSelectionStrategy(SelectionStrategy.Dedicated); runCreateReadNamespacesStep(); @@ -1100,7 +1100,7 @@ public void withNamespaceDedicated_changeToList_onCreateReadNamespaces_nsWatchSt } @Test - public void withNamespaceDedicated_changeToList_onCreateReadNamespaces_opNSEventMapIsEmpty() { + void withNamespaceDedicated_changeToList_onCreateReadNamespaces_opNSEventMapIsEmpty() { defineSelectionStrategy(SelectionStrategy.Dedicated); runCreateReadNamespacesStep(); @@ -1127,7 +1127,7 @@ private boolean isDomainEventMapEmpty(String ns) { } @Test - public void withNamespaceDedicated_changeToList_onCreateReadNamespaces_nsWatchStartedEventCreated() { + void withNamespaceDedicated_changeToList_onCreateReadNamespaces_nsWatchStartedEventCreated() { defineSelectionStrategy(SelectionStrategy.Dedicated); runCreateReadNamespacesStep(); @@ -1140,7 +1140,7 @@ public void withNamespaceDedicated_changeToList_onCreateReadNamespaces_nsWatchSt } @Test - public void withNamespaceDedicated_changeToList_onCreateReadNamespaces_StartManagingNSEventCreated() { + void withNamespaceDedicated_changeToList_onCreateReadNamespaces_StartManagingNSEventCreated() { defineSelectionStrategy(SelectionStrategy.Dedicated); runCreateReadNamespacesStep(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/NamespaceTest.java b/operator/src/test/java/oracle/kubernetes/operator/NamespaceTest.java index 8a3ad0c6dbc..737728fd1a0 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/NamespaceTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/NamespaceTest.java @@ -51,7 +51,7 @@ import static org.hamcrest.Matchers.sameInstance; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class NamespaceTest { +class NamespaceTest { public static final VersionInfo TEST_VERSION_INFO = new VersionInfo().major("1").minor("18").gitVersion("0"); public static final KubernetesVersion TEST_VERSION = new KubernetesVersion(TEST_VERSION_INFO); @@ -84,7 +84,7 @@ public void tearDown() { } @Test - public void givenJobWatcherForNamespace_afterNamespaceDeletedAndRecreatedHaveDifferentWatcher() { + void givenJobWatcherForNamespace_afterNamespaceDeletedAndRecreatedHaveDifferentWatcher() { initializeNamespaces(); JobWatcher oldWatcher = domainNamespaces.getJobWatcher(NS); @@ -97,7 +97,7 @@ public void givenJobWatcherForNamespace_afterNamespaceDeletedAndRecreatedHaveDif } @Test - public void whenDomainNamespaceRemovedFromDomainNamespaces_stopDomainWatchers() { + void whenDomainNamespaceRemovedFromDomainNamespaces_stopDomainWatchers() { initializeNamespaces(); AtomicBoolean stopping = domainNamespaces.isStopping(NS); @@ -144,7 +144,7 @@ private void processNamespaces() { } @Test - public void whenDomainNamespaceRemovedFromDomainNamespaces_isNoLongerInManagedNamespaces() { + void whenDomainNamespaceRemovedFromDomainNamespaces_isNoLongerInManagedNamespaces() { initializeNamespaces(); unspecifyDomainNamespace(NS); @@ -154,7 +154,7 @@ public void whenDomainNamespaceRemovedFromDomainNamespaces_isNoLongerInManagedNa } @Test - public void whenDomainNamespaceRemovedFromDomainNamespaces_doNotShutdownDomain() { + void whenDomainNamespaceRemovedFromDomainNamespaces_doNotShutdownDomain() { initializeNamespaces(); unspecifyDomainNamespace(NS); @@ -172,7 +172,7 @@ private Domain getDomainsInNamespace(String namespace) { } @Test - public void whenDomainNamespaceDeleted_stopDomainWatchers() { + void whenDomainNamespaceDeleted_stopDomainWatchers() { initializeNamespaces(); AtomicBoolean stopping = domainNamespaces.isStopping(NS); @@ -183,7 +183,7 @@ public void whenDomainNamespaceDeleted_stopDomainWatchers() { } @Test - public void whenDomainNamespaceDeleted_isNoLongerInManagedNamespaces() { + void whenDomainNamespaceDeleted_isNoLongerInManagedNamespaces() { initializeNamespaces(); deleteNamespace(NS); @@ -193,7 +193,7 @@ public void whenDomainNamespaceDeleted_isNoLongerInManagedNamespaces() { } @Test - public void whenStartNamespaceBeforeStepRunHit403OnEventCreation_namespaceStartingFlagCleared() { + void whenStartNamespaceBeforeStepRunHit403OnEventCreation_namespaceStartingFlagCleared() { String namespace = "TEST_NAMESPACE_1"; defineNamespaces(namespace); specifyDomainNamespaces(namespace); @@ -208,7 +208,7 @@ public void whenStartNamespaceBeforeStepRunHit403OnEventCreation_namespaceStarti } @Test - public void whenStartNamespaceBeforeStepRunSucceeds_namespaceStartingFlagIsNotCleared() { + void whenStartNamespaceBeforeStepRunSucceeds_namespaceStartingFlagIsNotCleared() { String namespace = "TEST_NAMESPACE_2"; defineNamespaces(namespace); specifyDomainNamespaces(namespace); @@ -220,7 +220,7 @@ public void whenStartNamespaceBeforeStepRunSucceeds_namespaceStartingFlagIsNotCl } @Test - public void whenStartNamespaceBeforeStepRun403OnEventCreation_thenSucceed_namespaceStartingFlagSet() { + void whenStartNamespaceBeforeStepRun403OnEventCreation_thenSucceed_namespaceStartingFlagSet() { String namespace = "TEST_NAMESPACE_3"; testSupport.addRetryStrategy(retryStrategy); defineNamespaces(namespace); diff --git a/operator/src/test/java/oracle/kubernetes/operator/NamespaceWatcherTest.java b/operator/src/test/java/oracle/kubernetes/operator/NamespaceWatcherTest.java index 77e142556dd..3d5d8e8c41a 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/NamespaceWatcherTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/NamespaceWatcherTest.java @@ -17,7 +17,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; /** This test class verifies the behavior of the NamespaceWatcher. */ -public class NamespaceWatcherTest extends WatcherTestBase +class NamespaceWatcherTest extends WatcherTestBase implements WatchListener { private static final BigInteger INITIAL_RESOURCE_VERSION = new BigInteger("456"); @@ -28,7 +28,7 @@ public void receivedResponse(Watch.Response response) { } @Test - public void initialRequest_specifiesStartingResourceVersionAndStandardLabelSelector() { + void initialRequest_specifiesStartingResourceVersionAndStandardLabelSelector() { sendInitialRequest(INITIAL_RESOURCE_VERSION); assertThat( diff --git a/operator/src/test/java/oracle/kubernetes/operator/OperatorEventProcessingTest.java b/operator/src/test/java/oracle/kubernetes/operator/OperatorEventProcessingTest.java index 1033eaa166e..739798919e7 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/OperatorEventProcessingTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/OperatorEventProcessingTest.java @@ -43,7 +43,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class OperatorEventProcessingTest { +class OperatorEventProcessingTest { private static final String OPERATOR_POD_NAME = "my-weblogic-operator-1234"; private static final String OP_NS = "operator-namespace"; private static final String OPERATOR_UID = "1234-5678-101112"; @@ -92,21 +92,21 @@ public void tearDown() { } @Test - public void onNewDomainCreatedEventWithNoInvolvedObject_doNothing() { + void onNewDomainCreatedEventWithNoInvolvedObject_doNothing() { CoreV1Event event = createDomainEvent(".acbd1", DOMAIN_CREATED, "", null); dispatchAddedEventWatch(event); assertThat("Found NO DOMAIN_CREATED event in the map", getMatchingEvent(event), nullValue()); } @Test - public void onNewDomainCreatedEvent_updateKubernetesEventObjectsMap() { + void onNewDomainCreatedEvent_updateKubernetesEventObjectsMap() { CoreV1Event event = createDomainEvent(".acbd2", DOMAIN_CREATED, "", domainReference); dispatchAddedEventWatch(event); assertThat("Found DOMAIN_CREATED event in the map", getMatchingEvent(event), notNullValue()); } @Test - public void afterOnAddDomainCreatedEvent_onDeleteDomainCreatedEventWithNoInvolvedObject_doNothing() { + void afterOnAddDomainCreatedEvent_onDeleteDomainCreatedEventWithNoInvolvedObject_doNothing() { CoreV1Event event1 = createDomainEvent(".acbd3", DOMAIN_CREATED, "", domainReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createDomainEvent(".acbd3", DOMAIN_CREATED, "", null); @@ -115,7 +115,7 @@ public void afterOnAddDomainCreatedEvent_onDeleteDomainCreatedEventWithNoInvolve } @Test - public void afterOnAddDomainCreatedEvent_onDeleteDomainCreatedEvent_updateKubernetesEventObjectsMap() { + void afterOnAddDomainCreatedEvent_onDeleteDomainCreatedEvent_updateKubernetesEventObjectsMap() { CoreV1Event event = createDomainEvent(".acbd4", DOMAIN_CREATED, "", domainReference); dispatchAddedEventWatch(event); dispatchDeletedEventWatch(event); @@ -123,7 +123,7 @@ public void afterOnAddDomainCreatedEvent_onDeleteDomainCreatedEvent_updateKubern } @Test - public void afterOnAddDomainCreatedEvent_onModifyDomainCreatedEventWithNoInvolvedObject_doNothing() { + void afterOnAddDomainCreatedEvent_onModifyDomainCreatedEventWithNoInvolvedObject_doNothing() { CoreV1Event event1 = createDomainEvent(".acbd5", DOMAIN_CREATED, "", domainReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createDomainEvent(".acbd5", DOMAIN_CREATED, "", null); @@ -132,7 +132,7 @@ public void afterOnAddDomainCreatedEvent_onModifyDomainCreatedEventWithNoInvolve } @Test - public void afterOnAddDomainCreatedEvent_onModifyDomainDeletedEvent_updateKubernetesEventObjectsMap() { + void afterOnAddDomainCreatedEvent_onModifyDomainDeletedEvent_updateKubernetesEventObjectsMap() { CoreV1Event event = createDomainEvent(".acbd6", DOMAIN_CREATED, "", domainReference); dispatchAddedEventWatch(event); event = createDomainEvent(".acbd6", DOMAIN_CREATED, "", domainReference, 2); @@ -141,21 +141,21 @@ public void afterOnAddDomainCreatedEvent_onModifyDomainDeletedEvent_updateKubern } @Test - public void onNewDomainProcessingFailedEventWithNoInvolvedObject_doNothing() { + void onNewDomainProcessingFailedEventWithNoInvolvedObject_doNothing() { CoreV1Event event = createDomainEvent(".acbd7", DOMAIN_PROCESSING_FAILED, "failure", null); dispatchAddedEventWatch(event); assertThat(getMatchingEvent(event), nullValue()); } @Test - public void onNewProcessingFailedEvent_updateKubernetesEventObjectsMap() { + void onNewProcessingFailedEvent_updateKubernetesEventObjectsMap() { CoreV1Event event = createDomainEvent(".acbd8", DOMAIN_PROCESSING_FAILED, "failure2", domainReference); dispatchAddedEventWatch(event); assertThat(getMatchingEvent(event), notNullValue()); } @Test - public void afterAddProcessingFailedEvent_onDeleteDomainProcessingFailedEventWithNoInvolvedObject_doNothing() { + void afterAddProcessingFailedEvent_onDeleteDomainProcessingFailedEventWithNoInvolvedObject_doNothing() { CoreV1Event event1 = createDomainEvent(".acbd9", DOMAIN_PROCESSING_FAILED, "failureOnDelete1", domainReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createDomainEvent(".acbd9", DOMAIN_PROCESSING_FAILED, "failureOnDelete1", null); @@ -164,7 +164,7 @@ public void afterAddProcessingFailedEvent_onDeleteDomainProcessingFailedEventWit } @Test - public void afterAddProcessingFailedEvent_onDeleteDomainProcessingFailedEvent_updateKubernetesEventObjectsMap() { + void afterAddProcessingFailedEvent_onDeleteDomainProcessingFailedEvent_updateKubernetesEventObjectsMap() { CoreV1Event event = createDomainEvent(".acbd10", DOMAIN_PROCESSING_FAILED, "failureOnDelete2", domainReference); dispatchAddedEventWatch(event); dispatchDeletedEventWatch(event); @@ -172,7 +172,7 @@ public void afterAddProcessingFailedEvent_onDeleteDomainProcessingFailedEvent_up } @Test - public void afterAddProcessingFailedEvent_onModifyDomainProcessingFailedEventWithNoInvolvedObject_doNothing() { + void afterAddProcessingFailedEvent_onModifyDomainProcessingFailedEventWithNoInvolvedObject_doNothing() { CoreV1Event event1 = createDomainEvent(".acbd11", DOMAIN_PROCESSING_FAILED, "failureOnModify1", domainReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createDomainEvent(".acbd11", DOMAIN_PROCESSING_FAILED, "failureOnModify1", null); @@ -181,7 +181,7 @@ public void afterAddProcessingFailedEvent_onModifyDomainProcessingFailedEventWit } @Test - public void afterAddProcessingFailedEvent_onModifyDomainProcessingFailedEvent_updateKubernetesEventObjectsMap() { + void afterAddProcessingFailedEvent_onModifyDomainProcessingFailedEvent_updateKubernetesEventObjectsMap() { CoreV1Event event1 = createDomainEvent(".acbd12", DOMAIN_PROCESSING_FAILED, "failureOnModify2", domainReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createDomainEvent(".acbd12", DOMAIN_PROCESSING_FAILED, "failureOnModify2", domainReference, 2); @@ -190,21 +190,21 @@ public void afterAddProcessingFailedEvent_onModifyDomainProcessingFailedEvent_up } @Test - public void afterAddDProcessingFailedEvent_onNewNamespaceWatchingStoppedEventWithNoInvolvedObject_doNothing() { + void afterAddDProcessingFailedEvent_onNewNamespaceWatchingStoppedEventWithNoInvolvedObject_doNothing() { CoreV1Event event = createDomainEvent(".1234a", NAMESPACE_WATCHING_STOPPED, "", null); dispatchAddedEventWatch(event); assertThat(getMatchingEvent(event), nullValue()); } @Test - public void onNewNamespaceWatchingStoppedEvent_updateKubernetesEventObjectsMap() { + void onNewNamespaceWatchingStoppedEvent_updateKubernetesEventObjectsMap() { CoreV1Event event = createNamespaceEvent(".1234b", NAMESPACE_WATCHING_STOPPED, nsReference); dispatchAddedEventWatch(event); assertThat(getMatchingEvent(event), notNullValue()); } @Test - public void afterAddNSWatchingStoppedEvent_onDeleteNamespaceWatchingStoppedEventWithNoInvolvedObject_doNothing() { + void afterAddNSWatchingStoppedEvent_onDeleteNamespaceWatchingStoppedEventWithNoInvolvedObject_doNothing() { CoreV1Event event1 = createNamespaceEvent(".1234c", NAMESPACE_WATCHING_STOPPED, nsReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createNamespaceEvent(".1234c", NAMESPACE_WATCHING_STOPPED,null); @@ -213,7 +213,7 @@ public void afterAddNSWatchingStoppedEvent_onDeleteNamespaceWatchingStoppedEvent } @Test - public void afterAddNSWatchingStoppedEvent_onDeleteNamespaceWatchingStoppedEvent_updateKubernetesEventObjectsMap() { + void afterAddNSWatchingStoppedEvent_onDeleteNamespaceWatchingStoppedEvent_updateKubernetesEventObjectsMap() { CoreV1Event event1 = createNamespaceEvent(".1234d", NAMESPACE_WATCHING_STOPPED, nsReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createNamespaceEvent(".1234d", NAMESPACE_WATCHING_STOPPED, nsReference); @@ -222,7 +222,7 @@ public void afterAddNSWatchingStoppedEvent_onDeleteNamespaceWatchingStoppedEvent } @Test - public void afterAddNSWatchingStoppedEvent_onModifyNamespaceWatchingStoppedEventWithNoInvolvedObject_doNothing() { + void afterAddNSWatchingStoppedEvent_onModifyNamespaceWatchingStoppedEventWithNoInvolvedObject_doNothing() { CoreV1Event event1 = createNamespaceEvent(".1234e", NAMESPACE_WATCHING_STOPPED, nsReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createNamespaceEvent(".1234e", NAMESPACE_WATCHING_STOPPED,null); @@ -231,7 +231,7 @@ public void afterAddNSWatchingStoppedEvent_onModifyNamespaceWatchingStoppedEvent } @Test - public void afterAddNSWatchingStoppedEvent_onModifyNamespaceWatchingStoppedEvent_updateKubernetesEventObjectsMap() { + void afterAddNSWatchingStoppedEvent_onModifyNamespaceWatchingStoppedEvent_updateKubernetesEventObjectsMap() { CoreV1Event event1 = createNamespaceEvent(".1234f", NAMESPACE_WATCHING_STOPPED, nsReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createNamespaceEvent(".1234f", NAMESPACE_WATCHING_STOPPED, nsReference, 2); @@ -240,14 +240,14 @@ public void afterAddNSWatchingStoppedEvent_onModifyNamespaceWatchingStoppedEvent } @Test - public void onCreateStartManagingNSEvent_updateKubernetesEventObjectsMap() { + void onCreateStartManagingNSEvent_updateKubernetesEventObjectsMap() { CoreV1Event event = createNamespaceEvent(".aaaa1", START_MANAGING_NAMESPACE, opReference); dispatchAddedEventWatch(event); assertThat(getMatchingEventCount(event), equalTo(1)); } @Test - public void afterAddStopManagingNSEvent_onModifyStopManagingNamespace_updateKubernetesEventObjectsMap() { + void afterAddStopManagingNSEvent_onModifyStopManagingNamespace_updateKubernetesEventObjectsMap() { CoreV1Event event1 = createNamespaceEvent(".aaaa2", STOP_MANAGING_NAMESPACE, opReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createNamespaceEvent(".aaaa2", STOP_MANAGING_NAMESPACE, opReference, 2); @@ -256,7 +256,7 @@ public void afterAddStopManagingNSEvent_onModifyStopManagingNamespace_updateKube } @Test - public void afterAddStartManagingNSEvent_onDeleteTheEventWithNoInvolvedObject_doNothing() { + void afterAddStartManagingNSEvent_onDeleteTheEventWithNoInvolvedObject_doNothing() { CoreV1Event event1 = createNamespaceEvent(".aaaa3", START_MANAGING_NAMESPACE, opReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createNamespaceEvent(".aaaa3", START_MANAGING_NAMESPACE, null); @@ -265,7 +265,7 @@ public void afterAddStartManagingNSEvent_onDeleteTheEventWithNoInvolvedObject_do } @Test - public void afterAddStopManaingNSEvent_onDeleteEvent_updateKubernetesEventObjectsMap() { + void afterAddStopManaingNSEvent_onDeleteEvent_updateKubernetesEventObjectsMap() { CoreV1Event event1 = createNamespaceEvent(".1234d", STOP_MANAGING_NAMESPACE, opReference); dispatchAddedEventWatch(event1); CoreV1Event event2 = createNamespaceEvent(".1234d", STOP_MANAGING_NAMESPACE, opReference); diff --git a/operator/src/test/java/oracle/kubernetes/operator/PodWatcherTest.java b/operator/src/test/java/oracle/kubernetes/operator/PodWatcherTest.java index fb5aeb53d7c..36cc5b33dcb 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/PodWatcherTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/PodWatcherTest.java @@ -44,7 +44,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; /** This test class verifies the behavior of the PodWatcher. */ -public class PodWatcherTest extends WatcherTestBase implements WatchListener { +class PodWatcherTest extends WatcherTestBase implements WatchListener { private static final BigInteger INITIAL_RESOURCE_VERSION = new BigInteger("234"); private static final String NS = "ns"; @@ -90,7 +90,7 @@ public void receivedResponse(Watch.Response response) { } @Test - public void initialRequest_specifiesStartingResourceVersionAndStandardLabelSelector() { + void initialRequest_specifiesStartingResourceVersionAndStandardLabelSelector() { sendInitialRequest(INITIAL_RESOURCE_VERSION); assertThat( @@ -119,7 +119,7 @@ private PodWatcher createWatcher(AtomicBoolean stopping) { } @Test - public void waitForReady_returnsAStep() { + void waitForReady_returnsAStep() { AtomicBoolean stopping = new AtomicBoolean(true); PodWatcher watcher = createWatcher(stopping); @@ -135,7 +135,7 @@ private V1Pod createIntrospectorPod() { } @Test - public void whenPodInitiallyReady_waitForReadyProceedsImmediately() { + void whenPodInitiallyReady_waitForReadyProceedsImmediately() { AtomicBoolean stopping = new AtomicBoolean(false); PodWatcher watcher = createWatcher(stopping); @@ -183,14 +183,14 @@ private V1PodCondition createCondition(String type) { } @Test - public void whenPodReadyWhenWaitCreated_performNextStep() { + void whenPodReadyWhenWaitCreated_performNextStep() { startWaitForReady(this::markPodReady); assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenPodNotReadyWhenWaitCreated_dontPerformNextStep() { + void whenPodNotReadyWhenWaitCreated_dontPerformNextStep() { startWaitForReady(this::dontChangePod); assertThat(terminalStep.wasRun(), is(false)); @@ -211,14 +211,14 @@ private void startWaitForReady(Function modifier) { } @Test - public void whenPodReadyOnFirstRead_runNextStep() { + void whenPodReadyOnFirstRead_runNextStep() { startWaitForReadyThenReadPod(this::markPodReady); assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenPodNotReadyOnFirstRead_dontRunNextStep() { + void whenPodNotReadyOnFirstRead_dontRunNextStep() { startWaitForReadyThenReadPod(this::dontChangePod); assertThat(terminalStep.wasRun(), is(false)); @@ -239,21 +239,21 @@ private void startWaitForReadyThenReadPod(Function modifier) { } @Test - public void whenPodReadyLater_runNextStep() { + void whenPodReadyLater_runNextStep() { sendPodModifiedWatchAfterWaitForReady(this::markPodReady); assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenPodCreatedAndReadyLater_runNextStep() { + void whenPodCreatedAndReadyLater_runNextStep() { sendPodModifiedWatchAfterResourceCreatedAndWaitForReady(this::markPodReady); assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenPodCreatedAndNotReadyAfterTimeout_executeMakeRightDomain() { + void whenPodCreatedAndNotReadyAfterTimeout_executeMakeRightDomain() { executeWaitForReady(); testSupport.setTime(10, TimeUnit.SECONDS); @@ -263,21 +263,21 @@ public void whenPodCreatedAndNotReadyAfterTimeout_executeMakeRightDomain() { } @Test - public void whenPodNotReadyLater_dontRunNextStep() { + void whenPodNotReadyLater_dontRunNextStep() { sendPodModifiedWatchAfterWaitForReady(this::dontChangePod); assertThat(terminalStep.wasRun(), is(false)); } @Test - public void whenPodNotReadyLaterAndThenReady_runNextStep() { + void whenPodNotReadyLaterAndThenReady_runNextStep() { sendPodModifiedWatchAfterWaitForReady(this::dontChangePod, this::markPodReady); assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenPodNotReadyLaterAndThenReadyButNoWatchEvent_runNextStep() { + void whenPodNotReadyLaterAndThenReadyButNoWatchEvent_runNextStep() { makeModifiedPodReadyWithNoWatchEvent(this::markPodReady); testSupport.setTime(RECHECK_SECONDS, TimeUnit.SECONDS); @@ -286,7 +286,7 @@ public void whenPodNotReadyLaterAndThenReadyButNoWatchEvent_runNextStep() { } @Test - public void whenIntrospectPodNotReadyWithTerminatedReason_logPodStatus() { + void whenIntrospectPodNotReadyWithTerminatedReason_logPodStatus() { sendIntrospectorPodModifiedWatchAfterWaitForReady(this::addContainerStateTerminatedReason); assertThat(terminalStep.wasRun(), is(false)); @@ -294,7 +294,7 @@ public void whenIntrospectPodNotReadyWithTerminatedReason_logPodStatus() { } @Test - public void whenIntrospectPodNotReadyWithWaitingMessage_logPodStatus() { + void whenIntrospectPodNotReadyWithWaitingMessage_logPodStatus() { sendIntrospectorPodModifiedWatchAfterWaitForReady(this::addContainerStateWaitingMessage); assertThat(terminalStep.wasRun(), is(false)); @@ -384,7 +384,7 @@ private void sendIntrospectorPodModifiedWatchAfterWaitForReady(Function getServerStates(Packet packet) { } @Test - public void whenPodNotReadyAndHasLastKnownState_recordInStateMap() { + void whenPodNotReadyAndHasLastKnownState_recordInStateMap() { info.setServerPod("server1", createPod("server1")); info.updateLastKnownServerStatus("server1", "not ready yet"); @@ -161,7 +161,7 @@ private void setReadyStatus(V1Pod pod) { } @Test - public void whenPodIsReady_startHealthStepForIt() { + void whenPodIsReady_startHealthStepForIt() { info.setServerPod("server1", createPod("server1")); setReadyStatus(info.getServerPod("server1")); diff --git a/operator/src/test/java/oracle/kubernetes/operator/ServiceWatcherTest.java b/operator/src/test/java/oracle/kubernetes/operator/ServiceWatcherTest.java index 2ea7aafbfeb..0b401ae4eb4 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/ServiceWatcherTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/ServiceWatcherTest.java @@ -20,7 +20,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; /** This test class verifies the behavior of the ServiceWatcher. */ -public class ServiceWatcherTest extends WatcherTestBase implements WatchListener { +class ServiceWatcherTest extends WatcherTestBase implements WatchListener { private static final BigInteger INITIAL_RESOURCE_VERSION = new BigInteger("987"); @@ -30,7 +30,7 @@ public void receivedResponse(Watch.Response response) { } @Test - public void initialRequest_specifiesStartingResourceVersionAndLabelSelector() { + void initialRequest_specifiesStartingResourceVersionAndLabelSelector() { sendInitialRequest(INITIAL_RESOURCE_VERSION); assertThat( diff --git a/operator/src/test/java/oracle/kubernetes/operator/StuckPodTest.java b/operator/src/test/java/oracle/kubernetes/operator/StuckPodTest.java index ef3c6af7613..ab517784143 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/StuckPodTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/StuckPodTest.java @@ -41,7 +41,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class StuckPodTest { +class StuckPodTest { private static final long DELETION_GRACE_PERIOD_SECONDS = 5L; private static final String SERVER_POD_1 = "name1"; @@ -77,7 +77,7 @@ public void tearDown() throws Exception { } @Test - public void whenServerPodNotDeleted_ignoreIt() { + void whenServerPodNotDeleted_ignoreIt() { SystemClockTestSupport.increment(DELETION_GRACE_PERIOD_SECONDS); processing.checkStuckPods(NS); @@ -86,7 +86,7 @@ public void whenServerPodNotDeleted_ignoreIt() { } @Test - public void whenServerPodNotStuck_ignoreIt() { + void whenServerPodNotStuck_ignoreIt() { markAsDelete(getSelectedPod(SERVER_POD_1)); SystemClockTestSupport.increment(DELETION_GRACE_PERIOD_SECONDS - 1); @@ -96,7 +96,7 @@ public void whenServerPodNotStuck_ignoreIt() { } @Test - public void whenServerPodStuck_deleteIt() { + void whenServerPodStuck_deleteIt() { markAsDelete(getSelectedPod(SERVER_POD_1)); SystemClockTestSupport.increment(DELETION_GRACE_PERIOD_SECONDS + 1); @@ -106,7 +106,7 @@ public void whenServerPodStuck_deleteIt() { } @Test - public void whenStuckServerPodDeleted_logMessage() { + void whenStuckServerPodDeleted_logMessage() { final List logMessages = new ArrayList<>(); consoleMemento.collectLogMessages(logMessages, POD_FORCE_DELETED).withLogLevel(Level.INFO); markAsDelete(getSelectedPod(SERVER_POD_1)); @@ -118,7 +118,7 @@ public void whenStuckServerPodDeleted_logMessage() { } @Test - public void whenServerPodDeleted_specifyZeroGracePeriod() { + void whenServerPodDeleted_specifyZeroGracePeriod() { markAsDelete(getSelectedPod(SERVER_POD_1)); SystemClockTestSupport.increment(DELETION_GRACE_PERIOD_SECONDS + 1); testSupport.doOnDelete(POD, this::recordGracePeriodSeconds); @@ -133,7 +133,7 @@ private void recordGracePeriodSeconds(Integer gracePeriodSeconds) { } @Test - public void whenServerPodStuck_initiateMakeRightProcessing() { + void whenServerPodStuck_initiateMakeRightProcessing() { markAsDelete(getSelectedPod(SERVER_POD_2)); SystemClockTestSupport.increment(DELETION_GRACE_PERIOD_SECONDS + 1); @@ -143,7 +143,7 @@ public void whenServerPodStuck_initiateMakeRightProcessing() { } @Test - public void whenForeignPodStuck_ignoreIt() { + void whenForeignPodStuck_ignoreIt() { markAsDelete(getSelectedPod(FOREIGN_POD)); SystemClockTestSupport.increment(DELETION_GRACE_PERIOD_SECONDS + 1); diff --git a/operator/src/test/java/oracle/kubernetes/operator/WatcherTestBase.java b/operator/src/test/java/oracle/kubernetes/operator/WatcherTestBase.java index a19ea254be4..fe46a4eafee 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/WatcherTestBase.java +++ b/operator/src/test/java/oracle/kubernetes/operator/WatcherTestBase.java @@ -119,7 +119,7 @@ private Object createObjectWithMetaData(String resourceVersion) { protected abstract T createObjectWithMetaData(V1ObjectMeta metaData); @Test - public void afterInitialRequest_watchIsClosed() { + void afterInitialRequest_watchIsClosed() { sendInitialRequest(INITIAL_RESOURCE_VERSION); assertThat(StubWatchFactory.getNumCloseCalls(), equalTo(1)); @@ -154,7 +154,7 @@ private Watch.Response createErrorWithoutStatusResponse() { } @Test - public void receivedEvents_areSentToListeners() { + void receivedEvents_areSentToListeners() { Object object1 = createObjectWithMetaData(); Object object2 = createObjectWithMetaData(); StubWatchFactory.addCallResponses(createAddResponse(object1), createModifyResponse(object2)); @@ -166,7 +166,7 @@ public void receivedEvents_areSentToListeners() { @SuppressWarnings({"rawtypes"}) @Test - public void afterFirstSetOfEvents_nextRequestSendsLastResourceVersion() { + void afterFirstSetOfEvents_nextRequestSendsLastResourceVersion() { Object object1 = createObjectWithMetaData(); Object object2 = createObjectWithMetaData(); Watch.Response[] firstSet = {createAddResponse(object1), createModifyResponse(object2)}; @@ -181,7 +181,7 @@ public void afterFirstSetOfEvents_nextRequestSendsLastResourceVersion() { } @Test - public void afterHttpGoneError_nextRequestSendsIncludedResourceVersion() { + void afterHttpGoneError_nextRequestSendsIncludedResourceVersion() { StubWatchFactory.addCallResponses(createHttpGoneErrorResponse(NEXT_RESOURCE_VERSION)); scheduleDeleteResponse(createObjectWithMetaData()); @@ -193,7 +193,7 @@ public void afterHttpGoneError_nextRequestSendsIncludedResourceVersion() { } @Test - public void afterHttpGoneErrorWithoutResourceVersion_nextRequestSendsResourceVersionZero() { + void afterHttpGoneErrorWithoutResourceVersion_nextRequestSendsResourceVersionZero() { StubWatchFactory.addCallResponses(createHttpGoneErrorWithoutResourceVersionResponse()); scheduleDeleteResponse(createObjectWithMetaData()); @@ -203,7 +203,7 @@ public void afterHttpGoneErrorWithoutResourceVersion_nextRequestSendsResourceVer } @Test - public void afterErrorWithoutStatus_nextRequestSendsResourceVersionZero() { + void afterErrorWithoutStatus_nextRequestSendsResourceVersionZero() { StubWatchFactory.addCallResponses(createErrorWithoutStatusResponse()); scheduleDeleteResponse(createObjectWithMetaData()); @@ -213,7 +213,7 @@ public void afterErrorWithoutStatus_nextRequestSendsResourceVersionZero() { } @Test - public void afterDelete_nextRequestSendsIncrementedResourceVersion() { + void afterDelete_nextRequestSendsIncrementedResourceVersion() { scheduleDeleteResponse(createObjectWithMetaData()); scheduleAddResponse(createObjectWithMetaData()); @@ -225,7 +225,7 @@ public void afterDelete_nextRequestSendsIncrementedResourceVersion() { } @Test - public void afterExceptionDuringNext_closeWatchAndTryAgain() { + void afterExceptionDuringNext_closeWatchAndTryAgain() { StubWatchFactory.throwExceptionOnNext(hasNextException); scheduleAddResponse(createObjectWithMetaData()); diff --git a/operator/src/test/java/oracle/kubernetes/operator/builders/WatchBuilderTest.java b/operator/src/test/java/oracle/kubernetes/operator/builders/WatchBuilderTest.java index 0ca394d9160..479fe5f574a 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/builders/WatchBuilderTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/builders/WatchBuilderTest.java @@ -49,7 +49,7 @@ * Tests watches created by the WatchBuilder, verifying that they are created with the correct query * URLs and handle responses correctly. */ -public class WatchBuilderTest { +class WatchBuilderTest { private static final String API_VERSION = "weblogic.oracle/" + KubernetesConstants.DOMAIN_VERSION; private static final String NAMESPACE = "testspace"; @@ -73,7 +73,7 @@ public void tearDown() { } @Test - public void whenDomainWatchReceivesAddResponse_returnItFromIterator() throws Exception { + void whenDomainWatchReceivesAddResponse_returnItFromIterator() throws Exception { Domain domain = new Domain() .withApiVersion(API_VERSION) @@ -87,7 +87,7 @@ public void whenDomainWatchReceivesAddResponse_returnItFromIterator() throws Exc } @Test - public void whenDomainWatchReceivesBookmarkResponse_updateResourceVersion() throws Exception { + void whenDomainWatchReceivesBookmarkResponse_updateResourceVersion() throws Exception { Domain domain = new Domain() .withApiVersion(API_VERSION) @@ -122,7 +122,7 @@ private Watch.Response createErrorResponse(int statusCode) { } @Test - public void afterWatchClosed_returnClientToPool() throws Exception { + void afterWatchClosed_returnClientToPool() throws Exception { Domain domain = new Domain() .withApiVersion(API_VERSION) @@ -138,7 +138,7 @@ public void afterWatchClosed_returnClientToPool() throws Exception { } @Test - public void afterWatchError_closeDoesNotReturnClientToPool() { + void afterWatchError_closeDoesNotReturnClientToPool() { try (Watchable domainWatch = new WatchBuilder().createDomainWatch(NAMESPACE)) { domainWatch.next(); @@ -151,7 +151,7 @@ public void afterWatchError_closeDoesNotReturnClientToPool() { } @Test - public void whenDomainWatchReceivesModifyAndDeleteResponses_returnBothFromIterator() + void whenDomainWatchReceivesModifyAndDeleteResponses_returnBothFromIterator() throws Exception { Domain domain1 = new Domain() @@ -171,7 +171,7 @@ public void whenDomainWatchReceivesModifyAndDeleteResponses_returnBothFromIterat } @Test - public void whenDomainWatchReceivesErrorResponse_returnItFromIterator() throws Exception { + void whenDomainWatchReceivesErrorResponse_returnItFromIterator() throws Exception { StubWatchFactory.addCallResponses(createErrorResponse(HTTP_ENTITY_TOO_LARGE)); Watchable domainWatch = new WatchBuilder().createDomainWatch(NAMESPACE); @@ -180,7 +180,7 @@ public void whenDomainWatchReceivesErrorResponse_returnItFromIterator() throws E } @Test - public void whenServiceWatchSpecifiesParameters_verifyAndReturnResponse() throws Exception { + void whenServiceWatchSpecifiesParameters_verifyAndReturnResponse() throws Exception { String startResourceVersion = getNextResourceVersion(); V1Service service = new V1Service() @@ -204,7 +204,7 @@ public void whenServiceWatchSpecifiesParameters_verifyAndReturnResponse() throws } @Test - public void whenPodWatchSpecifiesParameters_verifyAndReturnResponse() throws Exception { + void whenPodWatchSpecifiesParameters_verifyAndReturnResponse() throws Exception { V1Pod pod = new V1Pod().apiVersion(API_VERSION).kind("Pod").metadata(createMetaData("pod4", NAMESPACE)); StubWatchFactory.addCallResponses(createAddResponse(pod)); @@ -221,7 +221,7 @@ public void whenPodWatchSpecifiesParameters_verifyAndReturnResponse() throws Exc } @Test - public void whenPodWatchFindsNoData_hasNextReturnsFalse() throws Exception { + void whenPodWatchFindsNoData_hasNextReturnsFalse() throws Exception { Watchable podWatch = new WatchBuilder().createPodWatch(NAMESPACE); diff --git a/operator/src/test/java/oracle/kubernetes/operator/calls/AsyncRequestStepTest.java b/operator/src/test/java/oracle/kubernetes/operator/calls/AsyncRequestStepTest.java index 55ed9652641..de874fdabd2 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/calls/AsyncRequestStepTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/calls/AsyncRequestStepTest.java @@ -38,7 +38,7 @@ import static org.hamcrest.Matchers.notNullValue; import static org.junit.Assert.assertTrue; -public class AsyncRequestStepTest { +class AsyncRequestStepTest { private static final int TIMEOUT_SECONDS = 10; private static final int MAX_RETRY_COUNT = 2; @@ -91,17 +91,17 @@ public void tearDown() { } @Test - public void afterFiberStarted_requestSent() { + void afterFiberStarted_requestSent() { assertTrue(callFactory.invokedWith(requestParams)); } @Test - public void afterFiberStarted_timeoutStepScheduled() { + void afterFiberStarted_timeoutStepScheduled() { assertTrue(testSupport.hasItemScheduledAt(TIMEOUT_SECONDS, TimeUnit.SECONDS)); } @Test - public void afterTimeout_newRequestSent() { + void afterTimeout_newRequestSent() { callFactory.clearRequest(); testSupport.setTime(TIMEOUT_SECONDS + 1, TimeUnit.SECONDS); @@ -110,14 +110,14 @@ public void afterTimeout_newRequestSent() { } @Test - public void afterSuccessfulCallback_nextStepAppliedWithValue() { + void afterSuccessfulCallback_nextStepAppliedWithValue() { callFactory.sendSuccessfulCallback(smallList); assertThat(nextStep.result, equalTo(smallList)); } @Test - public void afterSuccessfulCallbackLargeList_nextStepAppliedWithValue() { + void afterSuccessfulCallbackLargeList_nextStepAppliedWithValue() { callFactory.sendSuccessfulCallback(largeListPartOne); assertThat(nextStep.result, equalTo(largeListPartOne)); @@ -125,14 +125,14 @@ public void afterSuccessfulCallbackLargeList_nextStepAppliedWithValue() { } @Test - public void afterSuccessfulCallback_packetDoesNotContainsResponse() { + void afterSuccessfulCallback_packetDoesNotContainsResponse() { testSupport.schedule(() -> callFactory.sendSuccessfulCallback(smallList)); assertThat(testSupport.getPacketComponents(), not(hasKey(RESPONSE_COMPONENT_NAME))); } @Test - public void afterFailedCallback_packetContainsRetryStrategy() { + void afterFailedCallback_packetContainsRetryStrategy() { sendFailedCallback(HttpURLConnection.HTTP_UNAVAILABLE); assertThat( @@ -147,7 +147,7 @@ private void sendFailedCallback(int statusCode) { } @Test - public void afterFailedCallback_retrySentAfterDelay() { + void afterFailedCallback_retrySentAfterDelay() { sendFailedCallback(HttpURLConnection.HTTP_UNAVAILABLE); callFactory.clearRequest(); @@ -157,21 +157,21 @@ public void afterFailedCallback_retrySentAfterDelay() { } @Test - public void afterMultipleRetriesAndSuccessfulCallback_nextStepAppliedWithValue() { + void afterMultipleRetriesAndSuccessfulCallback_nextStepAppliedWithValue() { sendMultipleFailedCallbackWithSetTime(0, 2); testSupport.schedule(() -> callFactory.sendSuccessfulCallback(smallList)); assertThat(nextStep.result, equalTo(smallList)); } @Test - public void afterRetriesExhausted_fiberTerminatesWithException() { + void afterRetriesExhausted_fiberTerminatesWithException() { sendMultipleFailedCallbackWithSetTime(0, 3); testSupport.verifyCompletionThrowable(FailureStatusSourceException.class); } @Test - public void afterMultipleTimeoutsAndSuccessfulCallback_nextStepAppliedWithValue() { + void afterMultipleTimeoutsAndSuccessfulCallback_nextStepAppliedWithValue() { sendMultipleFailedCallbackWithSetTime(504, 2); testSupport.schedule(() -> callFactory.sendSuccessfulCallback(smallList)); assertThat(nextStep.result, equalTo(smallList)); @@ -187,7 +187,7 @@ private void sendMultipleFailedCallbackWithSetTime(int statusCode, int maxRetrie } @Test - public void afterMultipleTimeoutsAndRetriesExhausted_fiberTerminatesWithException() { + void afterMultipleTimeoutsAndRetriesExhausted_fiberTerminatesWithException() { sendMultipleFailedCallbackWithSetTime(504, 3); testSupport.verifyCompletionThrowable(FailureStatusSourceException.class); diff --git a/operator/src/test/java/oracle/kubernetes/operator/calls/unprocessable/UnprocessableEntityTest.java b/operator/src/test/java/oracle/kubernetes/operator/calls/unprocessable/UnprocessableEntityTest.java index 0f03eab3207..d730fa228e7 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/calls/unprocessable/UnprocessableEntityTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/calls/unprocessable/UnprocessableEntityTest.java @@ -15,7 +15,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class UnprocessableEntityTest { +class UnprocessableEntityTest { private static final String KIND = "Pod"; private static final String NAME = "sample-domain1-admin-server"; @@ -44,7 +44,7 @@ private static String quoted(String s) { } @Test - public void extractReasonFromException() { + void extractReasonFromException() { ApiException exception = new ApiException(422, Collections.emptyMap(), SAMPLE_MESSAGE_BODY); FailureStatusSource builder = UnrecoverableErrorBuilderImpl.fromFailedCall( @@ -54,7 +54,7 @@ public void extractReasonFromException() { } @Test - public void extractMessageFromException() { + void extractMessageFromException() { ApiException exception = new ApiException(422, Collections.emptyMap(), SAMPLE_MESSAGE_BODY); FailureStatusSource builder = UnrecoverableErrorBuilderImpl.fromFailedCall( @@ -64,7 +64,7 @@ public void extractMessageFromException() { } @Test - public void constructTestException() { + void constructTestException() { ApiException exception = new UnrecoverableErrorBuilderImpl() .withReason("SomethingWrong") .withMessage("This explanation") diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/AdminPodHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/AdminPodHelperTest.java index 98a0126b785..cb24044afcb 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/AdminPodHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/AdminPodHelperTest.java @@ -64,7 +64,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; @SuppressWarnings("SameParameterValue") -public class AdminPodHelperTest extends PodHelperTestBase { +class AdminPodHelperTest extends PodHelperTestBase { private static final String INTERNAL_OPERATOR_CERT_ENV_NAME = "INTERNAL_OPERATOR_CERT"; private static final String RAW_VALUE_1 = "value-$(SERVER_NAME)"; @@ -145,7 +145,7 @@ String getDomainValidationFailedKey() { } @Test // REG I don't understand why this is only true for the admin server - public void whenConfigurationAddsEnvironmentVariable_replacePod() { + void whenConfigurationAddsEnvironmentVariable_replacePod() { initializeExistingPod(); configureServer().withEnvironmentVariable("test", "???"); @@ -177,7 +177,7 @@ V1Pod createPod(Packet packet) { } @Test - public void whenDeleteReportsNotFound_replaceAdminPod() { + void whenDeleteReportsNotFound_replaceAdminPod() { initializeExistingPod(getIncompatiblePod()); testSupport.failOnDelete(KubernetesTestSupport.POD, getPodName(), NS, CallBuilder.NOT_FOUND); @@ -193,7 +193,7 @@ private V1Pod getIncompatiblePod() { } @Test - public void whenAdminPodDeletionFails_unrecoverableFailureOnUnauthorized() { + void whenAdminPodDeletionFails_unrecoverableFailureOnUnauthorized() { testSupport.addRetryStrategy(retryStrategy); initializeExistingPod(getIncompatiblePod()); testSupport.failOnDelete(KubernetesTestSupport.POD, getPodName(), NS, 401); @@ -206,7 +206,7 @@ public void whenAdminPodDeletionFails_unrecoverableFailureOnUnauthorized() { } @Test - public void whenAdminPodReplacementFails() { + void whenAdminPodReplacementFails() { testSupport.addRetryStrategy(retryStrategy); initializeExistingPod(getIncompatiblePod()); testSupport.failOnCreate(KubernetesTestSupport.POD, getPodName(), NS, 500); @@ -220,7 +220,7 @@ public void whenAdminPodReplacementFails() { } @Test - public void whenAdminPodCreated_specHasPodNameAsHostName() { + void whenAdminPodCreated_specHasPodNameAsHostName() { assertThat(getCreatedPodSpec().getHostname(), equalTo(getPodName())); } @@ -229,50 +229,50 @@ private V1PodSpec getCreatedPodSpec() { } @Test - public void whenAdminPodCreated_containerHasStartServerCommand() { + void whenAdminPodCreated_containerHasStartServerCommand() { assertThat( getCreatedPodSpecContainer().getCommand(), contains("/weblogic-operator/scripts/startServer.sh")); } @Test - public void whenAdminPodCreated_hasOperatorCertEnvVariable() { + void whenAdminPodCreated_hasOperatorCertEnvVariable() { assertThat( getCreatedPodSpecContainer().getEnv(), hasEnvVar(INTERNAL_OPERATOR_CERT_ENV_NAME, InMemoryCertificates.INTERNAL_CERT_DATA)); } @Test - public void whenAdminPodCreatedWithAdminPortEnabled_adminServerPortSecureEnvVarIsTrue() { + void whenAdminPodCreatedWithAdminPortEnabled_adminServerPortSecureEnvVarIsTrue() { getServerTopology().setAdminPort((Integer) 9002); assertThat(getCreatedPodSpecContainer().getEnv(), hasEnvVar("ADMIN_SERVER_PORT_SECURE", "true")); } @Test - public void whenAdminPodCreatedWithNullAdminPort_adminServerPortSecureEnvVarIsNotSet() { + void whenAdminPodCreatedWithNullAdminPort_adminServerPortSecureEnvVarIsNotSet() { getServerTopology().setAdminPort(null); assertThat(getCreatedPodSpecContainer().getEnv(), not(hasEnvVar("ADMIN_SERVER_PORT_SECURE", "true"))); } @Test - public void whenAdminPodCreatedWithAdminServerHasSslPortEnabled_adminServerPortSecureEnvVarIsTrue() { + void whenAdminPodCreatedWithAdminServerHasSslPortEnabled_adminServerPortSecureEnvVarIsTrue() { getServerTopology().setSslListenPort(9999); assertThat(getCreatedPodSpecContainer().getEnv(), hasEnvVar("ADMIN_SERVER_PORT_SECURE", "true")); } @Test - public void whenAdminPodCreatedWithAdminServerHasNullSslPort_adminServerPortSecureEnvVarIsNotSet() { + void whenAdminPodCreatedWithAdminServerHasNullSslPort_adminServerPortSecureEnvVarIsNotSet() { getServerTopology().setSslListenPort(null); assertThat(getCreatedPodSpecContainer().getEnv(), not(hasEnvVar("ADMIN_SERVER_PORT_SECURE", "true"))); } @Test - public void whenDomainPresenceHasNoEnvironmentItems_createAdminPodStartupWithDefaultItems() { + void whenDomainPresenceHasNoEnvironmentItems_createAdminPodStartupWithDefaultItems() { assertThat(getCreatedPodSpecContainer().getEnv(), not(empty())); } @Test - public void whenDomainHasEnvironmentItems_createAdminPodStartupWithThem() { + void whenDomainHasEnvironmentItems_createAdminPodStartupWithThem() { configureAdminServer() .withEnvironmentVariable("item1", "value1") .withEnvironmentVariable("item2", "value2"); @@ -287,7 +287,7 @@ private ServerConfigurator configureAdminServer() { } @Test - public void whenDomainHasEnvironmentItemsWithVariables_createAdminPodStartupWithThem() { + void whenDomainHasEnvironmentItemsWithVariables_createAdminPodStartupWithThem() { configureAdminServer() .withEnvironmentVariable("item1", "find uid1 at $(DOMAIN_HOME)") .withEnvironmentVariable("item2", "$(SERVER_NAME) is $(ADMIN_NAME):$(ADMIN_PORT)"); @@ -300,7 +300,7 @@ public void whenDomainHasEnvironmentItemsWithVariables_createAdminPodStartupWith } @Test - public void whenDomainHasEnvironmentItemsWithVariable_createPodShouldNotChangeItsValue() + void whenDomainHasEnvironmentItemsWithVariable_createPodShouldNotChangeItsValue() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { final String itemRawValue = "find uid1 at $(DOMAIN_HOME)"; configureAdminServer().withEnvironmentVariable("item1", itemRawValue); @@ -314,7 +314,7 @@ public void whenDomainHasEnvironmentItemsWithVariable_createPodShouldNotChangeIt } @Test - public void whenDomainHasValueFromEnvironmentItems_createAdminPodStartupWithThem() { + void whenDomainHasValueFromEnvironmentItems_createAdminPodStartupWithThem() { V1EnvVar configMapKeyRefEnvVar = createConfigMapKeyRefEnvVar("VARIABLE1", "my-env", "VAR1"); V1EnvVar secretKeyRefEnvVar = createSecretKeyRefEnvVar("VARIABLE2", "my-secret", "VAR2"); V1EnvVar fieldRefEnvVar = createFieldRefEnvVar("MY_NODE_IP", "status.hostIP"); @@ -330,7 +330,7 @@ public void whenDomainHasValueFromEnvironmentItems_createAdminPodStartupWithThem } @Test - public void whenDomainHasValueFromEnvironmentItemsWithVariables_createAdminPodStartupWithSubstitutions() { + void whenDomainHasValueFromEnvironmentItemsWithVariables_createAdminPodStartupWithSubstitutions() { V1EnvVar configMapKeyRefEnvVar = createConfigMapKeyRefEnvVar("VARIABLE1", "my-env", RAW_VALUE_1); V1EnvVar secretKeyRefEnvVar = createSecretKeyRefEnvVar("VARIABLE2", "my-secret", RAW_VALUE_1); V1EnvVar fieldRefEnvVar = createFieldRefEnvVar("MY_NODE_IP", RAW_VALUE_1); @@ -351,7 +351,7 @@ public void whenDomainHasValueFromEnvironmentItemsWithVariables_createAdminPodSt } @Test - public void whenDomainHasValueFromEnvironmentItemsWithVariables_createPodShouldNotChangeTheirValues() + void whenDomainHasValueFromEnvironmentItemsWithVariables_createPodShouldNotChangeTheirValues() throws Exception { V1EnvVar configMapKeyRefEnvVar = createConfigMapKeyRefEnvVar("VARIABLE1", "my-env", RAW_VALUE_1); V1EnvVar secretKeyRefEnvVar = createSecretKeyRefEnvVar("VARIABLE2", "my-secret", RAW_VALUE_1); @@ -373,7 +373,7 @@ public void whenDomainHasValueFromEnvironmentItemsWithVariables_createPodShouldN } @Test - public void whenAdminServerHasAdditionalVolumesWithReservedVariables_createAdminPodStartupWithSubstitutions() { + void whenAdminServerHasAdditionalVolumesWithReservedVariables_createAdminPodStartupWithSubstitutions() { configureAdminServer() .withAdditionalVolume("volume1", "/source-$(SERVER_NAME)") .withAdditionalVolume("volume2", "/source-$(DOMAIN_NAME)"); @@ -386,7 +386,7 @@ public void whenAdminServerHasAdditionalVolumesWithReservedVariables_createAdmin } @Test - public void whenAdminServerHasAdditionalVolumeMountsWithReservedVariables_createAdminPodStartupWithSubstitutions() { + void whenAdminServerHasAdditionalVolumeMountsWithReservedVariables_createAdminPodStartupWithSubstitutions() { configureAdminServer() .withAdditionalVolumeMount("volume1", RAW_MOUNT_PATH_1); @@ -394,7 +394,7 @@ public void whenAdminServerHasAdditionalVolumeMountsWithReservedVariables_create } @Test - public void whenDomainHasAdditionalVolumesWithCustomVariables_createAdminPodStartupWithSubstitutions() { + void whenDomainHasAdditionalVolumesWithCustomVariables_createAdminPodStartupWithSubstitutions() { resourceLookup.defineResource(OVERRIDES_CM_NAME_MODEL, KubernetesResourceType.ConfigMap, NS); resourceLookup.defineResource(OVERRIDES_CM_NAME_IMAGE, KubernetesResourceType.ConfigMap, NS); @@ -412,7 +412,7 @@ public void whenDomainHasAdditionalVolumesWithCustomVariables_createAdminPodStar } @Test - public void whenDomainHasAdditionalVolumesWithCustomVariablesContainInvalidValue_reportValidationError() { + void whenDomainHasAdditionalVolumesWithCustomVariablesContainInvalidValue_reportValidationError() { resourceLookup.defineResource(OVERRIDES_CM_NAME_MODEL, KubernetesResourceType.ConfigMap, NS); resourceLookup.defineResource(OVERRIDES_CM_NAME_IMAGE, KubernetesResourceType.ConfigMap, NS); @@ -430,7 +430,7 @@ public void whenDomainHasAdditionalVolumesWithCustomVariablesContainInvalidValue } @Test - public void createAdminPodStartupWithNullAdminUsernamePasswordEnvVarsValues() { + void createAdminPodStartupWithNullAdminUsernamePasswordEnvVarsValues() { configureAdminServer(); assertThat( @@ -439,7 +439,7 @@ public void createAdminPodStartupWithNullAdminUsernamePasswordEnvVarsValues() { } @Test - public void whenDomainHasAdditionalPvClaimVolumesWitVariables_createManagedPodWithThem() { + void whenDomainHasAdditionalPvClaimVolumesWitVariables_createManagedPodWithThem() { getConfigurator() .withAdditionalPvClaimVolume("volume-$(SERVER_NAME)", "$(SERVER_NAME)-claim"); @@ -449,7 +449,7 @@ public void whenDomainHasAdditionalPvClaimVolumesWitVariables_createManagedPodWi } @Test - public void whenServerHasAdditionalVolumes_createAdminPodWithThem() { + void whenServerHasAdditionalVolumes_createAdminPodWithThem() { configureAdminServer() .withAdditionalVolume("volume1", "/source-path1") .withAdditionalVolume("volume2", "/source-path2"); @@ -460,7 +460,7 @@ public void whenServerHasAdditionalVolumes_createAdminPodWithThem() { } @Test - public void whenServerHasAdditionalVolumeMounts_createAdminPodWithThem() { + void whenServerHasAdditionalVolumeMounts_createAdminPodWithThem() { configureAdminServer() .withAdditionalVolumeMount("volume1", "/destination-path1") .withAdditionalVolumeMount("volume2", "/destination-path2"); @@ -473,7 +473,7 @@ public void whenServerHasAdditionalVolumeMounts_createAdminPodWithThem() { } @Test - public void whenPodHasDuplicateVolumes_createAdminPodWithCombination() { + void whenPodHasDuplicateVolumes_createAdminPodWithCombination() { getConfigurator() .withAdditionalVolume("volume1", "/domain-path1") .withAdditionalVolume("volume2", "/domain-path2") @@ -486,7 +486,7 @@ public void whenPodHasDuplicateVolumes_createAdminPodWithCombination() { } @Test - public void whenPodHasDuplicateVolumeMounts_createAdminPodWithCombination() { + void whenPodHasDuplicateVolumeMounts_createAdminPodWithCombination() { getConfigurator() .withAdditionalVolumeMount("volume1", "/domain-path1") .withAdditionalVolumeMount("volume2", "/domain-path2") @@ -500,7 +500,7 @@ public void whenPodHasDuplicateVolumeMounts_createAdminPodWithCombination() { } @Test - public void whenDesiredStateIsAdmin_createPodWithStartupModeEnvironment() { + void whenDesiredStateIsAdmin_createPodWithStartupModeEnvironment() { getConfigurator().withServerStartState(ADMIN_STATE); assertThat( @@ -508,7 +508,7 @@ public void whenDesiredStateIsAdmin_createPodWithStartupModeEnvironment() { } @Test - public void whenServerDesiredStateIsAdmin_createPodWithStartupModeEnvironment() { + void whenServerDesiredStateIsAdmin_createPodWithStartupModeEnvironment() { getConfigurator().configureAdminServer().withServerStartState(ADMIN_STATE); assertThat( @@ -516,7 +516,7 @@ public void whenServerDesiredStateIsAdmin_createPodWithStartupModeEnvironment() } @Test - public void whenDesiredStateIsRunningServerIsAdmin_createPodWithStartupModeEnvironment() { + void whenDesiredStateIsRunningServerIsAdmin_createPodWithStartupModeEnvironment() { getConfigurator() .withServerStartState(RUNNING_STATE) .configureAdminServer() @@ -527,7 +527,7 @@ public void whenDesiredStateIsRunningServerIsAdmin_createPodWithStartupModeEnvir } @Test - public void whenDesiredStateIsAdminServerIsRunning_createPodWithStartupModeEnvironment() { + void whenDesiredStateIsAdminServerIsRunning_createPodWithStartupModeEnvironment() { getConfigurator() .withServerStartState(ADMIN_STATE) .configureAdminServer() @@ -538,7 +538,7 @@ public void whenDesiredStateIsAdminServerIsRunning_createPodWithStartupModeEnvir } @Test - public void whenDomainHasInitContainers_createAdminPodWithThem() { + void whenDomainHasInitContainers_createAdminPodWithThem() { getConfigurator() .withInitContainer( createContainer("container1", "busybox", "sh", "-c", "echo admin server && sleep 120")) @@ -552,7 +552,7 @@ public void whenDomainHasInitContainers_createAdminPodWithThem() { } @Test - public void whenDomainWithEnvVarHasInitContainers_verifyAdminPodInitContainersHaveEnvVar() { + void whenDomainWithEnvVarHasInitContainers_verifyAdminPodInitContainersHaveEnvVar() { getConfigurator().withEnvironmentVariable("item1", "value1") .withInitContainer( createContainer("container1", "busybox", "sh", @@ -571,7 +571,7 @@ public void whenDomainWithEnvVarHasInitContainers_verifyAdminPodInitContainersHa } @Test - public void whenServerHasInitContainers_createAdminPodWithThem() { + void whenServerHasInitContainers_createAdminPodWithThem() { getConfigurator() .configureAdminServer() .withInitContainer( @@ -586,7 +586,7 @@ public void whenServerHasInitContainers_createAdminPodWithThem() { } @Test - public void whenDomainAndServerHaveAuxiliaryImages_createAdminPodWithInitContainersInCorrectOrderAndVolumeMounts() { + void whenDomainAndServerHaveAuxiliaryImages_createAdminPodWithInitContainersInCorrectOrderAndVolumeMounts() { getConfigurator() .withAuxiliaryImageVolumes(getAuxiliaryImageVolume()) .withAuxiliaryImages(Collections.singletonList(getAuxiliaryImage("wdt-image:v1"))); @@ -611,7 +611,7 @@ public void whenDomainAndServerHaveAuxiliaryImages_createAdminPodWithInitContain } @Test - public void whenServerHasAuxiliaryImageVolumeWithMountPath_createPodWithVolumeMountHavingCorrectMountPath() { + void whenServerHasAuxiliaryImageVolumeWithMountPath_createPodWithVolumeMountHavingCorrectMountPath() { getConfigurator() .withAuxiliaryImageVolumes(getAuxiliaryImageVolume(CUSTOM_MOUNT_PATH)) .configureAdminServer() @@ -622,7 +622,7 @@ public void whenServerHasAuxiliaryImageVolumeWithMountPath_createPodWithVolumeMo } @Test - public void whenServerWithEnvVarHasInitContainers_verifyAdminPodInitContainersHaveEnvVar() { + void whenServerWithEnvVarHasInitContainers_verifyAdminPodInitContainersHaveEnvVar() { getConfigurator().withEnvironmentVariable("item1", "value1") .configureAdminServer() .withInitContainer( @@ -642,7 +642,7 @@ public void whenServerWithEnvVarHasInitContainers_verifyAdminPodInitContainersHa } @Test - public void whenServerHasDuplicateInitContainers_createAdminPodWithCombination() { + void whenServerHasDuplicateInitContainers_createAdminPodWithCombination() { getConfigurator() .withInitContainer( createContainer("container1", "busybox", "sh", "-c", "echo admin server && sleep 120")) @@ -658,7 +658,7 @@ public void whenServerHasDuplicateInitContainers_createAdminPodWithCombination() } @Test - public void whenDomainHasContainers_createAdminPodWithThem() { + void whenDomainHasContainers_createAdminPodWithThem() { getConfigurator() .withContainer( createContainer("container1", "busybox", "sh", "-c", "echo admin server && sleep 120")) @@ -672,7 +672,7 @@ public void whenDomainHasContainers_createAdminPodWithThem() { } @Test - public void whenServerHasContainers_createAdminPodWithThem() { + void whenServerHasContainers_createAdminPodWithThem() { getConfigurator() .configureAdminServer() .withContainer( @@ -687,7 +687,7 @@ public void whenServerHasContainers_createAdminPodWithThem() { } @Test - public void whenServerHasDuplicateContainers_createAdminPodWithCombination() { + void whenServerHasDuplicateContainers_createAdminPodWithCombination() { getConfigurator() .withContainer( createContainer("container1", "busybox", "sh", "-c", "echo admin server && sleep 120")) @@ -703,7 +703,7 @@ public void whenServerHasDuplicateContainers_createAdminPodWithCombination() { } @Test - public void whenDomainHasLabels_createAdminPodWithThem() { + void whenDomainHasLabels_createAdminPodWithThem() { getConfigurator() .withPodLabel("label1", "domain-label-value1") .withPodLabel("label2", "domain-label-value2"); @@ -717,7 +717,7 @@ private V1ObjectMeta getCreatedPodMetadata() { } @Test - public void whenDomainHasAnnotations_createAdminPodWithThem() { + void whenDomainHasAnnotations_createAdminPodWithThem() { getConfigurator() .withPodAnnotation("annotation1", "domain-annotation-value1") .withPodAnnotation("annotation2", "domain-annotation-value2"); @@ -728,7 +728,7 @@ public void whenDomainHasAnnotations_createAdminPodWithThem() { } @Test - public void whenServerHasLabels_createAdminPodWithThem() { + void whenServerHasLabels_createAdminPodWithThem() { configureAdminServer() .withPodLabel("label1", "server-label-value1") .withPodLabel("label2", "server-label-value2"); @@ -739,7 +739,7 @@ public void whenServerHasLabels_createAdminPodWithThem() { } @Test - public void whenServerHasAnnotations_createAdminPodWithThem() { + void whenServerHasAnnotations_createAdminPodWithThem() { configureAdminServer() .withPodAnnotation("annotation1", "server-annotation-value1") .withPodAnnotation("annotation2", "server-annotation-value2"); @@ -750,7 +750,7 @@ public void whenServerHasAnnotations_createAdminPodWithThem() { } @Test - public void whenPodHasDuplicateLabels_createAdminPodWithCombination() { + void whenPodHasDuplicateLabels_createAdminPodWithCombination() { getConfigurator() .withPodLabel("label1", "domain-label-value1") .withPodLabel("label2", "domain-label-value2") @@ -763,7 +763,7 @@ public void whenPodHasDuplicateLabels_createAdminPodWithCombination() { } @Test - public void whenPodHasDuplicateAnnotations_createAdminPodWithCombination() { + void whenPodHasDuplicateAnnotations_createAdminPodWithCombination() { getConfigurator() .withPodAnnotation("annotation1", "domain-annotation-value1") .withPodAnnotation("annotation2", "domain-annotation-value2") @@ -776,7 +776,7 @@ public void whenPodHasDuplicateAnnotations_createAdminPodWithCombination() { } @Test - public void whenPodHasCustomLabelConflictWithInternal_createAdminPodWithInternal() { + void whenPodHasCustomLabelConflictWithInternal_createAdminPodWithInternal() { getConfigurator() .configureAdminServer() .withPodLabel(LabelConstants.CREATEDBYOPERATOR_LABEL, "server-label-value1") @@ -788,7 +788,7 @@ public void whenPodHasCustomLabelConflictWithInternal_createAdminPodWithInternal } @Test - public void whenDomainAndAdminHasRestartVersion_createAdminPodWithRestartVersionLabel() { + void whenDomainAndAdminHasRestartVersion_createAdminPodWithRestartVersionLabel() { getConfigurator() .withRestartVersion("domainRestartV1") .configureAdminServer() @@ -802,7 +802,7 @@ public void whenDomainAndAdminHasRestartVersion_createAdminPodWithRestartVersion @Test - public void whenDomainHomeChanged_podCycleEventCreatedWithCorrectMessage() + void whenDomainHomeChanged_podCycleEventCreatedWithCorrectMessage() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { initializeExistingPod(); getConfiguredDomainSpec().setDomainHome("adfgg"); @@ -817,7 +817,7 @@ public void whenDomainHomeChanged_podCycleEventCreatedWithCorrectMessage() } @Test - public void whenDomainHomeChanged_podCycleEventCreatedWithCorrectNS() + void whenDomainHomeChanged_podCycleEventCreatedWithCorrectNS() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { initializeExistingPod(); getConfiguredDomainSpec().setDomainHome("adfgg"); @@ -829,7 +829,7 @@ public void whenDomainHomeChanged_podCycleEventCreatedWithCorrectNS() } @Test - public void whenDomainHomeChanged_generateExpectedLogMessage() + void whenDomainHomeChanged_generateExpectedLogMessage() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { consoleHandlerMemento.collectLogMessages(logRecords, getCyclePodKey()); initializeExistingPod(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/AdminServerServiceHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/AdminServerServiceHelperTest.java index c11fb44bce5..01ff60128f0 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/AdminServerServiceHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/AdminServerServiceHelperTest.java @@ -7,7 +7,7 @@ import static oracle.kubernetes.operator.logging.MessageKeys.ADMIN_SERVICE_EXISTS; import static oracle.kubernetes.operator.logging.MessageKeys.ADMIN_SERVICE_REPLACED; -public class AdminServerServiceHelperTest extends ServiceHelperTest { +class AdminServerServiceHelperTest extends ServiceHelperTest { public AdminServerServiceHelperTest() { super(new AdminServerTestFacade()); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/AuthenticationProxyTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/AuthenticationProxyTest.java index a737711944b..49a8301e9a2 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/AuthenticationProxyTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/AuthenticationProxyTest.java @@ -17,7 +17,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class AuthenticationProxyTest { +class AuthenticationProxyTest { private final List mementos = new ArrayList<>(); private final KubernetesTestSupport testSupport = new KubernetesTestSupport(); @@ -41,14 +41,14 @@ public void tearDown() { } @Test - public void verify_authorizationScope_isCluster_whenNamespaceIsNull() { + void verify_authorizationScope_isCluster_whenNamespaceIsNull() { AuthenticationProxy authorizationProxy = new AuthenticationProxy(); authorizationProxy.check("", "", null); assertThat(authorizationProxyStub.scope, equalTo(Scope.cluster)); } @Test - public void verify_authorizationScope_isNamespace_whenNamespaceIsDefined() { + void verify_authorizationScope_isNamespace_whenNamespaceIsDefined() { AuthenticationProxy authorizationProxy = new AuthenticationProxy(); authorizationProxy.check("", "", "NS"); assertThat(authorizationProxyStub.scope, equalTo(Scope.namespace)); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/CallBuilderTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/CallBuilderTest.java index 5c3ef390055..6b2532c9ec6 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/CallBuilderTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/CallBuilderTest.java @@ -36,9 +36,8 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; - @SuppressWarnings("SameParameterValue") -public class CallBuilderTest { +class CallBuilderTest { private static final String NAMESPACE = "testspace"; private static final String UID = "uid"; private static final String DOMAIN_RESOURCE = @@ -72,7 +71,7 @@ public void tearDown() { } @Test - public void getVersionCode_returnsAVersionInfo() throws ApiException { + void getVersionCode_returnsAVersionInfo() throws ApiException { VersionInfo versionInfo = new VersionInfo().major("1").minor("2"); defineHttpGetResponse("/version/", versionInfo); @@ -80,7 +79,7 @@ public void getVersionCode_returnsAVersionInfo() throws ApiException { } @Test - public void getVersionCode_firstAttemptFailsAndThenReturnsAVersionInfo() throws Exception { + void getVersionCode_firstAttemptFailsAndThenReturnsAVersionInfo() throws Exception { VersionInfo versionInfo = new VersionInfo().major("1").minor("2"); defineHttpGetResponse("/version/", new FailOnceGetServlet(versionInfo, HTTP_BAD_REQUEST)); @@ -108,7 +107,7 @@ public WebResource getGetResponse() throws IOException { } @Test - public void listDomains_returnsListAsJson() throws ApiException { + void listDomains_returnsListAsJson() throws ApiException { DomainList list = new DomainList().withItems(Arrays.asList(new Domain(), new Domain())); defineHttpGetResponse(DOMAIN_RESOURCE, list).expectingParameter("fieldSelector", "xxx"); @@ -116,7 +115,7 @@ public void listDomains_returnsListAsJson() throws ApiException { } @Test - public void replaceDomain_sendsNewDomain() throws ApiException { + void replaceDomain_sendsNewDomain() throws ApiException { Domain domain = new Domain().withMetadata(createMetadata()); defineHttpPutResponse( DOMAIN_RESOURCE, UID, domain, (json) -> requestBody = fromJson(json, Domain.class)); @@ -127,7 +126,7 @@ public void replaceDomain_sendsNewDomain() throws ApiException { } @Test - public void replaceDomain_errorResponseCode_throws() { + void replaceDomain_errorResponseCode_throws() { Domain domain = new Domain().withMetadata(createMetadata()); defineHttpPutResponse(DOMAIN_RESOURCE, UID, domain, new ErrorCodePutServlet(HTTP_BAD_REQUEST)); @@ -135,7 +134,7 @@ public void replaceDomain_errorResponseCode_throws() { } @Test - public void replaceDomain_conflictResponseCode_throws() { + void replaceDomain_conflictResponseCode_throws() { Domain domain = new Domain().withMetadata(createMetadata()); defineHttpPutResponse(DOMAIN_RESOURCE, UID, domain, new ErrorCodePutServlet(HTTP_CONFLICT)); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/ClientPoolTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/ClientPoolTest.java index 149a7587e7d..eaece6916e2 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/ClientPoolTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/ClientPoolTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.sameInstance; -public class ClientPoolTest { +class ClientPoolTest { private final List mementos = new ArrayList<>(); @@ -35,12 +35,12 @@ public void tearDown() { } @Test - public void onTake_returnApiClient() { + void onTake_returnApiClient() { assertThat(ClientPool.getInstance().take(), instanceOf(ApiClient.class)); } @Test - public void afterRecycle_takeReturnsSameClient() { + void afterRecycle_takeReturnsSameClient() { ApiClient apiClient = ClientPool.getInstance().take(); ClientPool.getInstance().recycle(apiClient); @@ -48,7 +48,7 @@ public void afterRecycle_takeReturnsSameClient() { } @Test - public void afterDiscard_takeReturnsDifferentClient() { + void afterDiscard_takeReturnsDifferentClient() { ApiClient apiClient = ClientPool.getInstance().take(); ClientPool.getInstance().discard(apiClient); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/ClusterServiceHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/ClusterServiceHelperTest.java index 915487e2998..9786cd0d6d8 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/ClusterServiceHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/ClusterServiceHelperTest.java @@ -17,7 +17,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class ClusterServiceHelperTest extends ServiceHelperTest { +class ClusterServiceHelperTest extends ServiceHelperTest { public ClusterServiceHelperTest() { super(new ClusterServiceTestFacade()); @@ -109,7 +109,7 @@ String getExpectedSelectorValue() { } @Test - public void whenCreated_modelHasSessionAffinity() { + void whenCreated_modelHasSessionAffinity() { V1Service model = createService(); assertThat( diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/ConfigMapHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/ConfigMapHelperTest.java index c03bd98572f..9fd3f893956 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/ConfigMapHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/ConfigMapHelperTest.java @@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.sameInstance; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class ConfigMapHelperTest { +class ConfigMapHelperTest { private static final String DOMAIN_NS = "namespace"; private static final SemanticVersion PRODUCT_VERSION = new SemanticVersion(3, 0, 0); @@ -85,7 +85,7 @@ public void tearDown() throws Exception { } @Test - public void whenUnableToReadConfigMap_reportFailure() { + void whenUnableToReadConfigMap_reportFailure() { testSupport.failOnResource(CONFIG_MAP, SCRIPT_CONFIG_MAP_NAME, DOMAIN_NS, 401); Step scriptConfigMapStep = ConfigMapHelper.createScriptConfigMapStep(DOMAIN_NS, null); @@ -95,7 +95,7 @@ public void whenUnableToReadConfigMap_reportFailure() { } @Test - public void whenNoConfigMap_createIt() { + void whenNoConfigMap_createIt() { testSupport.runSteps(ConfigMapHelper.createScriptConfigMapStep(DOMAIN_NS, null)); assertThat(testSupport.getResources(CONFIG_MAP), notNullValue()); @@ -103,7 +103,7 @@ public void whenNoConfigMap_createIt() { } @Test - public void whenNoConfigMap_retryOnFailure() { + void whenNoConfigMap_retryOnFailure() { testSupport.addRetryStrategy(retryStrategy); testSupport.failOnCreate(CONFIG_MAP, SCRIPT_CONFIG_MAP_NAME, DOMAIN_NS, 401); @@ -115,7 +115,7 @@ public void whenNoConfigMap_retryOnFailure() { } @Test - public void whenMatchingConfigMapExists_addToPacket() { + void whenMatchingConfigMapExists_addToPacket() { testSupport.defineResources(defaultConfigMap); Packet packet = testSupport.runSteps(ConfigMapHelper.createScriptConfigMapStep(DOMAIN_NS, PRODUCT_VERSION)); @@ -125,7 +125,7 @@ public void whenMatchingConfigMapExists_addToPacket() { } @Test - public void whenExistingConfigMapHasOldVersion_replaceIt() { + void whenExistingConfigMapHasOldVersion_replaceIt() { testSupport.defineResources(defineConfigMap(PRODUCT_VERSION_OLD)); testSupport.runSteps(ConfigMapHelper.createScriptConfigMapStep(DOMAIN_NS, PRODUCT_VERSION)); @@ -134,7 +134,7 @@ public void whenExistingConfigMapHasOldVersion_replaceIt() { } @Test - public void whenExistingConfigMapHasFutureVersion_dontReplaceIt() { + void whenExistingConfigMapHasFutureVersion_dontReplaceIt() { testSupport.defineResources(defineConfigMap(PRODUCT_VERSION_FUTURE)); testSupport.runSteps(ConfigMapHelper.createScriptConfigMapStep(DOMAIN_NS, PRODUCT_VERSION)); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/ConfigMapSplitterTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/ConfigMapSplitterTest.java index 00884d98f5f..b9c2686f75f 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/ConfigMapSplitterTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/ConfigMapSplitterTest.java @@ -25,7 +25,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class ConfigMapSplitterTest { +class ConfigMapSplitterTest { private static final int TEST_DATA_LIMIT = 1000; private static final String UNIT_DATA = "123456789"; @@ -52,7 +52,7 @@ public void tearDown() { } @Test - public void whenDataWithinLimits_createOneTargetObject() { + void whenDataWithinLimits_createOneTargetObject() { data.put("a", "aValue"); data.put("b", "bValue"); @@ -63,7 +63,7 @@ public void whenDataWithinLimits_createOneTargetObject() { } @Test - public void whenDataTooLarge_createMultipleTargetObjects() { + void whenDataTooLarge_createMultipleTargetObjects() { data.put("a", "aValue"); data.put("b", LARGE_DATA_VALUE); @@ -76,7 +76,7 @@ public void whenDataTooLarge_createMultipleTargetObjects() { } @Test - public void whenDataTooLarge_canReconstituteSplitValue() { + void whenDataTooLarge_canReconstituteSplitValue() { data.put("a", "aValue"); data.put("b", "123456789".repeat(250)); @@ -87,7 +87,7 @@ public void whenDataTooLarge_canReconstituteSplitValue() { } @Test - public void whenDataSplit_recordNumTargetsInFirstResult() { + void whenDataSplit_recordNumTargetsInFirstResult() { data.put("a", "aValue"); data.put("b", "123456789".repeat(250)); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/CrdHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/CrdHelperTest.java index b9086880ce7..05bf39ab2aa 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/CrdHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/CrdHelperTest.java @@ -49,7 +49,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; import static org.junit.Assert.assertNotNull; -public class CrdHelperTest { +class CrdHelperTest { private static final KubernetesVersion KUBERNETES_VERSION_15 = new KubernetesVersion(1, 15); private static final KubernetesVersion KUBERNETES_VERSION_16 = new KubernetesVersion(1, 16); @@ -143,14 +143,14 @@ Map getAdditionalPropertiesMap(String... pathElements) { } @Test - public void whenCrdV1SupportedAndNoCrd_createIt() { + void whenCrdV1SupportedAndNoCrd_createIt() { testSupport.runSteps(CrdHelper.createDomainCrdStep(KUBERNETES_VERSION_16, PRODUCT_VERSION)); assertThat(logRecords, containsInfo(CREATING_CRD)); } @Test - public void whenNoCrd_retryOnFailureAndLogFailedMessageInOnFailureNoRetry() { + void whenNoCrd_retryOnFailureAndLogFailedMessageInOnFailureNoRetry() { testSupport.addRetryStrategy(retryStrategy); testSupport.failOnCreate(CUSTOM_RESOURCE_DEFINITION, KubernetesConstants.CRD_NAME, null, HTTP_UNAUTHORIZED); @@ -161,7 +161,7 @@ public void whenNoCrd_retryOnFailureAndLogFailedMessageInOnFailureNoRetry() { } @Test - public void whenNoCrd_proceedToNextStep() { + void whenNoCrd_proceedToNextStep() { testSupport.addRetryStrategy(retryStrategy); testSupport.failOnCreate(CUSTOM_RESOURCE_DEFINITION, KubernetesConstants.CRD_NAME, null, HTTP_UNAUTHORIZED); @@ -173,7 +173,7 @@ public void whenNoCrd_proceedToNextStep() { } @Test - public void whenExistingCrdHasCurrentApiVersionButOldProductVersion_replaceIt() { + void whenExistingCrdHasCurrentApiVersionButOldProductVersion_replaceIt() { testSupport.defineResources(defineCrd(PRODUCT_VERSION)); testSupport.runSteps(CrdHelper.createDomainCrdStep(KUBERNETES_VERSION_16, PRODUCT_VERSION_FUTURE)); @@ -194,7 +194,7 @@ private SemanticVersion getProductVersionFromMetadata(V1ObjectMeta metadata) { } @Test - public void whenExistingCrdHasFutureVersion_dontReplaceIt() { + void whenExistingCrdHasFutureVersion_dontReplaceIt() { V1CustomResourceDefinition existing = defineCrd(PRODUCT_VERSION_FUTURE); existing .getSpec() @@ -208,7 +208,7 @@ public void whenExistingCrdHasFutureVersion_dontReplaceIt() { } @Test - public void whenExistingCrdHasFutureVersionButNotCurrentStorage_updateIt() { + void whenExistingCrdHasFutureVersionButNotCurrentStorage_updateIt() { testSupport.defineResources(defineCrd(PRODUCT_VERSION_FUTURE)); V1CustomResourceDefinition replacement = defineCrd(PRODUCT_VERSION_FUTURE); @@ -225,7 +225,7 @@ public void whenExistingCrdHasFutureVersionButNotCurrentStorage_updateIt() { } @Test - public void whenReplaceFails_scheduleRetryAndLogFailedMessageInOnFailureNoRetry() { + void whenReplaceFails_scheduleRetryAndLogFailedMessageInOnFailureNoRetry() { testSupport.addRetryStrategy(retryStrategy); testSupport.defineResources(defineCrd(PRODUCT_VERSION_OLD)); testSupport.failOnReplace(CUSTOM_RESOURCE_DEFINITION, KubernetesConstants.CRD_NAME, null, HTTP_UNAUTHORIZED); @@ -238,7 +238,7 @@ public void whenReplaceFails_scheduleRetryAndLogFailedMessageInOnFailureNoRetry( } @Test - public void whenReplaceFailsThrowsStreamException_scheduleRetryAndLogFailedMessageInOnFailureNoRetry() { + void whenReplaceFailsThrowsStreamException_scheduleRetryAndLogFailedMessageInOnFailureNoRetry() { testSupport.addRetryStrategy(retryStrategy); testSupport.defineResources(defineCrd(PRODUCT_VERSION_OLD)); testSupport.failOnReplaceWithStreamResetException(CUSTOM_RESOURCE_DEFINITION, KubernetesConstants.CRD_NAME, null); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainIntrospectorJobTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainIntrospectorJobTest.java index 9e7c95d9b3d..5380d95b782 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainIntrospectorJobTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainIntrospectorJobTest.java @@ -87,7 +87,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; @SuppressWarnings({"SameParameterValue"}) -public class DomainIntrospectorJobTest { +class DomainIntrospectorJobTest { private static final String NODEMGR_HOME = "/u01/nodemanager"; private static final String OVERRIDES_CM = "overrides-config-map"; private static final String OVERRIDE_SECRET_1 = "override-secret-1"; @@ -226,7 +226,7 @@ DomainConfigurator getConfigurator() { } @Test - public void whenNoJob_createIt() throws JsonProcessingException { + void whenNoJob_createIt() throws JsonProcessingException { IntrospectionTestUtils.defineResources(testSupport, createDomainConfig("cluster-1")); testSupport.defineResources( new V1ConfigMap() @@ -256,7 +256,7 @@ private FiberTestSupport.StepFactory getStepFactory() { } @Test - public void whenNoJob_onFiveHundred() { + void whenNoJob_onFiveHundred() { testSupport.addRetryStrategy(retryStrategy); testSupport.failOnResource(KubernetesTestSupport.JOB, getJobName(), NS, 500); @@ -267,7 +267,7 @@ public void whenNoJob_onFiveHundred() { } @Test - public void whenJobCreated_jobNameContainsDefaultSuffix() { + void whenJobCreated_jobNameContainsDefaultSuffix() { testSupport.runSteps(getStepFactory(), terminalStep); logRecords.clear(); @@ -282,7 +282,7 @@ private String getCreatedJobName() { } @Test - public void whenJobCreatedWithCustomIntrospectorJobnameSuffix_jobNameContainsConfiguredSuffix() { + void whenJobCreatedWithCustomIntrospectorJobnameSuffix_jobNameContainsConfiguredSuffix() { TuningParameters.getInstance().put(LegalNames.INTROSPECTOR_JOB_NAME_SUFFIX_PARAM, "-introspector-job"); testSupport.runSteps(getStepFactory(), terminalStep); logRecords.clear(); @@ -291,7 +291,7 @@ public void whenJobCreatedWithCustomIntrospectorJobnameSuffix_jobNameContainsCon } @Test - public void whenJobCreated_specHasOneContainer() { + void whenJobCreated_specHasOneContainer() { List jobs = runStepsAndGetJobs(); assertThat(getPodTemplateContainers(jobs.get(0)), hasSize(1)); } @@ -307,7 +307,7 @@ private List getPodTemplateInitContainers(V1Job v1Job) { } @Test - public void whenJobCreated_hasPredefinedEnvVariables() { + void whenJobCreated_hasPredefinedEnvVariables() { List jobs = runStepsAndGetJobs(); List podTemplateContainers = getPodTemplateContainers(jobs.get(0)); assertThat( @@ -324,7 +324,7 @@ public void whenJobCreated_hasPredefinedEnvVariables() { } @Test - public void whenJobCreatedWithModelHomeDefined_hasModelHomeEnvVariable() { + void whenJobCreatedWithModelHomeDefined_hasModelHomeEnvVariable() { getDomain().getSpec() .setConfiguration(new Configuration().withModel(new Model().withModelHome(WDT_MODEL_HOME))); List jobs = runStepsAndGetJobs(); @@ -335,7 +335,7 @@ public void whenJobCreatedWithModelHomeDefined_hasModelHomeEnvVariable() { } @Test - public void whenJobCreatedWithAuxiliaryImageDefined_hasAuxiliaryImageInitContainerVolumeAndMounts() { + void whenJobCreatedWithAuxiliaryImageDefined_hasAuxiliaryImageInitContainerVolumeAndMounts() { getConfigurator() .withAuxiliaryImageVolumes(getAuxiliaryImageVolume(DEFAULT_AUXILIARY_IMAGE_PATH)) .withAuxiliaryImages(Collections.singletonList(getAuxiliaryImage("wdt-image:v1"))); @@ -379,7 +379,7 @@ public static AuxiliaryImage getAuxiliaryImage(String image) { } @Test - public void whenJobCreatedWithAuxiliaryImageAndVolumeHavingAuxiliaryImagePath_hasVolumeMountWithAuxiliaryImagePath() { + void whenJobCreatedWithAuxiliaryImageAndVolumeHavingAuxiliaryImagePath_hasVolumeMountWithAuxiliaryImagePath() { DomainConfiguratorFactory.forDomain(domain) .withAuxiliaryImageVolumes(getAuxiliaryImageVolume(CUSTOM_MOUNT_PATH)) .withAuxiliaryImages(getAuxiliaryImages("wdt-image:v1")); @@ -391,7 +391,7 @@ public void whenJobCreatedWithAuxiliaryImageAndVolumeHavingAuxiliaryImagePath_ha } @Test - public void whenJobCreatedWithAuxiliaryImageVolumeWithMedium_createdJobPodsHasVolumeWithSpecifiedMedium() { + void whenJobCreatedWithAuxiliaryImageVolumeWithMedium_createdJobPodsHasVolumeWithSpecifiedMedium() { getConfigurator() .withAuxiliaryImageVolumes(Collections.singletonList( new AuxiliaryImageVolume().name(TEST_VOLUME_NAME).medium("Memory"))) @@ -405,7 +405,7 @@ public void whenJobCreatedWithAuxiliaryImageVolumeWithMedium_createdJobPodsHasVo @Test - public void whenJobCreatedWithAuxiliaryImageVolumeWithSizeLimit_createdJobPodsHasVolumeWithSpecifiedSizeLimit() { + void whenJobCreatedWithAuxiliaryImageVolumeWithSizeLimit_createdJobPodsHasVolumeWithSpecifiedSizeLimit() { getConfigurator() .withAuxiliaryImageVolumes(Collections.singletonList( new AuxiliaryImageVolume().name(TEST_VOLUME_NAME).sizeLimit("100G"))) @@ -418,7 +418,7 @@ public void whenJobCreatedWithAuxiliaryImageVolumeWithSizeLimit_createdJobPodsHa } @Test - public void whenJobCreatedWithAuxiliaryImageWithImagePullPolicy_createJobPodHasImagePullPolicy() { + void whenJobCreatedWithAuxiliaryImageWithImagePullPolicy_createJobPodHasImagePullPolicy() { getConfigurator() .withAuxiliaryImageVolumes(getAuxiliaryImageVolume(DEFAULT_AUXILIARY_IMAGE_PATH)) .withAuxiliaryImages(Collections.singletonList(getAuxiliaryImage("wdt-image:v1") @@ -432,7 +432,7 @@ public void whenJobCreatedWithAuxiliaryImageWithImagePullPolicy_createJobPodHasI } @Test - public void whenJobCreatedWithAuxiliaryImageAndCustomCommand_createJobPodsWithInitContainerHavingCustomCommand() { + void whenJobCreatedWithAuxiliaryImageAndCustomCommand_createJobPodsWithInitContainerHavingCustomCommand() { getConfigurator() .withAuxiliaryImageVolumes(getAuxiliaryImageVolume(DEFAULT_AUXILIARY_IMAGE_PATH)) .withAuxiliaryImages(Collections.singletonList(getAuxiliaryImage("wdt-image:v1") @@ -446,7 +446,7 @@ public void whenJobCreatedWithAuxiliaryImageAndCustomCommand_createJobPodsWithIn } @Test - public void whenJobCreatedWithMultipleAuxiliaryImages_createdJobPodsHasMultipleInitContainers() { + void whenJobCreatedWithMultipleAuxiliaryImages_createdJobPodsHasMultipleInitContainers() { getConfigurator() .withAuxiliaryImageVolumes(getAuxiliaryImageVolume(DEFAULT_AUXILIARY_IMAGE_PATH)) .withAuxiliaryImages(getAuxiliaryImages("wdt-image1:v1", "wdt-image2:v1")); @@ -466,7 +466,7 @@ public void whenJobCreatedWithMultipleAuxiliaryImages_createdJobPodsHasMultipleI } @Test - public void whenPodCreationFailsDueToUnprocessableEntityFailure_reportInDomainStatus() { + void whenPodCreationFailsDueToUnprocessableEntityFailure_reportInDomainStatus() { testSupport.failOnResource(JOB, getJobName(), NS, new UnrecoverableErrorBuilderImpl() .withReason("FieldValueNotFound") .withMessage("Test this failure") @@ -483,7 +483,7 @@ Domain getDomain() { } @Test - public void whenPodCreationFailsDueToUnprocessableEntityFailure_abortFiber() { + void whenPodCreationFailsDueToUnprocessableEntityFailure_abortFiber() { testSupport.failOnResource(JOB, getJobName(), NS, new UnrecoverableErrorBuilderImpl() .withReason("FieldValueNotFound") .withMessage("Test this failure") @@ -495,7 +495,7 @@ public void whenPodCreationFailsDueToUnprocessableEntityFailure_abortFiber() { } @Test - public void whenIntrospectorJobIsRun_validatesDomainTopology() throws JsonProcessingException { + void whenIntrospectorJobIsRun_validatesDomainTopology() throws JsonProcessingException { // create WlsDomainConfig with "cluster-2" whereas domain spec contains cluster-1 IntrospectionTestUtils.defineResources(testSupport, createDomainConfig("cluster-2")); @@ -507,7 +507,7 @@ public void whenIntrospectorJobIsRun_validatesDomainTopology() throws JsonProces } @Test - public void whenIntrospectorJobNotNeeded_doesNotValidatesDomainTopology() throws JsonProcessingException { + void whenIntrospectorJobNotNeeded_doesNotValidatesDomainTopology() throws JsonProcessingException { // create WlsDomainConfig with "cluster-2" whereas domain spec contains "cluster-1" WlsDomainConfig wlsDomainConfig = createDomainConfig("cluster-2"); IntrospectionTestUtils.defineResources(testSupport, wlsDomainConfig); @@ -523,7 +523,7 @@ public void whenIntrospectorJobNotNeeded_doesNotValidatesDomainTopology() throws } @Test - public void whenJobLogContainsSevereError_logJobInfosOnDelete() { + void whenJobLogContainsSevereError_logJobInfosOnDelete() { testSupport.defineResources( new V1Job().metadata(new V1ObjectMeta().name(getJobName()).namespace(NS)).status(new V1JobStatus())); IntrospectionTestUtils.defineResources(testSupport, SEVERE_MESSAGE_1); @@ -537,7 +537,7 @@ public void whenJobLogContainsSevereError_logJobInfosOnDelete() { } @Test - public void whenJobLogContainsSevereError_logJobInfosOnReadPogLog() { + void whenJobLogContainsSevereError_logJobInfosOnReadPogLog() { testSupport.defineResources( new V1Job().metadata(new V1ObjectMeta().name(getJobName()).namespace(NS)).status(new V1JobStatus())); IntrospectionTestUtils.defineResources(testSupport, SEVERE_MESSAGE_1); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainPresenceInfoTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainPresenceInfoTest.java index 947cdf875bb..86692332f2b 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainPresenceInfoTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainPresenceInfoTest.java @@ -19,16 +19,16 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class DomainPresenceInfoTest { +class DomainPresenceInfoTest { private final DomainPresenceInfo info = new DomainPresenceInfo("ns", "domain"); @Test - public void whenNoneDefined_getClusterServiceReturnsNull() { + void whenNoneDefined_getClusterServiceReturnsNull() { assertThat(info.getClusterService("cluster"), nullValue()); } @Test - public void afterClusterServiceDefined_nextCallReturnsIt() { + void afterClusterServiceDefined_nextCallReturnsIt() { V1Service service = new V1Service(); info.setClusterService("cluster", service); @@ -36,12 +36,12 @@ public void afterClusterServiceDefined_nextCallReturnsIt() { } @Test - public void whenNoneDefined_getServerServiceReturnsNull() { + void whenNoneDefined_getServerServiceReturnsNull() { assertThat(info.getServerService("admin"), nullValue()); } @Test - public void afterServerServiceDefined_nextCallReturnsIt() { + void afterServerServiceDefined_nextCallReturnsIt() { V1Service service = new V1Service(); info.setServerService("admin", service); @@ -49,12 +49,12 @@ public void afterServerServiceDefined_nextCallReturnsIt() { } @Test - public void whenNoneDefined_getExternalServiceReturnsNull() { + void whenNoneDefined_getExternalServiceReturnsNull() { assertThat(info.getExternalService("admin"), nullValue()); } @Test - public void afterExternalServiceDefined_nextCallReturnsIt() { + void afterExternalServiceDefined_nextCallReturnsIt() { V1Service service = new V1Service(); info.setExternalService("admin", service); @@ -62,12 +62,12 @@ public void afterExternalServiceDefined_nextCallReturnsIt() { } @Test - public void whenNoneDefined_getServerPodReturnsNull() { + void whenNoneDefined_getServerPodReturnsNull() { assertThat(info.getServerPod("myserver"), nullValue()); } @Test - public void afterServerPodDefined_nextCallReturnsIt() { + void afterServerPodDefined_nextCallReturnsIt() { V1Pod pod = new V1Pod(); info.setServerPod("myserver", pod); @@ -75,12 +75,12 @@ public void afterServerPodDefined_nextCallReturnsIt() { } @Test - public void whenNoneDefined_getPodDisruptionBudgetReturnsNull() { + void whenNoneDefined_getPodDisruptionBudgetReturnsNull() { assertThat(info.getPodDisruptionBudget("cluster"), nullValue()); } @Test - public void afterPodDisruptionBudgetDefined_nextCallReturnsIt() { + void afterPodDisruptionBudgetDefined_nextCallReturnsIt() { V1beta1PodDisruptionBudget pdb = new V1beta1PodDisruptionBudget(); info.setPodDisruptionBudget("cluster", pdb); @@ -88,7 +88,7 @@ public void afterPodDisruptionBudgetDefined_nextCallReturnsIt() { } @Test - public void afterValidationWarningsAdded_nextCallReturnsThem() { + void afterValidationWarningsAdded_nextCallReturnsThem() { final String warning1 = "warning1"; final String warning2 = "warning2"; @@ -100,7 +100,7 @@ public void afterValidationWarningsAdded_nextCallReturnsThem() { } @Test - public void countReadyServers() { + void countReadyServers() { addServer("MS1", "cluster1"); addReadyServer("MS2", "cluster1"); addServer("MS3", "cluster2"); @@ -134,7 +134,7 @@ private void setReady(V1Pod pod) { } @Test - public void countScheduledServers() { + void countScheduledServers() { addServer("MS1", "cluster1"); addScheduledServer("MS2", "cluster1"); addServer("MS3", "cluster2"); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainStatusPatchTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainStatusPatchTest.java index f4cde1bb1d8..85524d14bed 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainStatusPatchTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainStatusPatchTest.java @@ -40,11 +40,11 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class DomainStatusPatchTest { +class DomainStatusPatchTest { private final PatchBuilderStub builder = createStrictStub(PatchBuilderStub.class); @Test - public void whenExistingStatusNull_addStatus() { + void whenExistingStatusNull_addStatus() { DomainStatus status2 = new DomainStatus().withReplicas(2); computePatch(null, status2); @@ -53,7 +53,7 @@ public void whenExistingStatusNull_addStatus() { } @Test - public void whenExistingStatusNotNull_dontAddStatus() { + void whenExistingStatusNotNull_dontAddStatus() { DomainStatus status1 = new DomainStatus().withReplicas(3); DomainStatus status2 = new DomainStatus().withReplicas(2); @@ -63,7 +63,7 @@ public void whenExistingStatusNotNull_dontAddStatus() { } @Test - public void whenOnlyNewStatusHasReplicas_addIt() { + void whenOnlyNewStatusHasReplicas_addIt() { DomainStatus status2 = new DomainStatus().withReplicas(2); computePatch(null, status2); @@ -72,7 +72,7 @@ public void whenOnlyNewStatusHasReplicas_addIt() { } @Test - public void whenOnlyExistingNewStatusHasReplicas_addIt() { + void whenOnlyExistingNewStatusHasReplicas_addIt() { DomainStatus status1 = new DomainStatus(); DomainStatus status2 = new DomainStatus().withReplicas(2); @@ -86,7 +86,7 @@ private void computePatch(DomainStatus status1, DomainStatus status2) { } @Test - public void whenOnlyOldStatusHasReplicas_removeIt() { + void whenOnlyOldStatusHasReplicas_removeIt() { DomainStatus status1 = new DomainStatus().withReplicas(2); DomainStatus status2 = new DomainStatus(); @@ -96,7 +96,7 @@ public void whenOnlyOldStatusHasReplicas_removeIt() { } @Test - public void whenBothHaveSameReplicas_ignoreIt() { + void whenBothHaveSameReplicas_ignoreIt() { DomainStatus status1 = new DomainStatus().withReplicas(2); DomainStatus status2 = new DomainStatus().withReplicas(2); @@ -106,7 +106,7 @@ public void whenBothHaveSameReplicas_ignoreIt() { } @Test - public void whenBothHaveDifferentReplicas_replaceIt() { + void whenBothHaveDifferentReplicas_replaceIt() { DomainStatus status1 = new DomainStatus().withReplicas(2); DomainStatus status2 = new DomainStatus().withReplicas(3); @@ -116,7 +116,7 @@ public void whenBothHaveDifferentReplicas_replaceIt() { } @Test - public void whenOnlyNewHasMessage_addIt() { + void whenOnlyNewHasMessage_addIt() { DomainStatus status1 = new DomainStatus(); DomainStatus status2 = new DomainStatus().withMessage("new and hot"); @@ -126,7 +126,7 @@ public void whenOnlyNewHasMessage_addIt() { } @Test - public void whenBothHaveDifferentMessages_replaceIt() { + void whenBothHaveDifferentMessages_replaceIt() { DomainStatus status1 = new DomainStatus().withMessage("old and broken"); DomainStatus status2 = new DomainStatus().withMessage("new and hot"); @@ -136,7 +136,7 @@ public void whenBothHaveDifferentMessages_replaceIt() { } @Test - public void whenOnlyOldHasReason_deleteIt() { + void whenOnlyOldHasReason_deleteIt() { DomainStatus status1 = new DomainStatus().withReason("just because"); DomainStatus status2 = new DomainStatus(); @@ -146,7 +146,7 @@ public void whenOnlyOldHasReason_deleteIt() { } @Test - public void whenOnlyNewStatusHasConditions_addNewConditions() { + void whenOnlyNewStatusHasConditions_addNewConditions() { DomainStatus status1 = new DomainStatus(); DomainStatus status2 = new DomainStatus() .addCondition(new DomainCondition(DomainConditionType.Available) @@ -165,7 +165,7 @@ public void whenOnlyNewStatusHasConditions_addNewConditions() { } @Test - public void whenOnlyOldStatusHasConditions_removeThem() { + void whenOnlyOldStatusHasConditions_removeThem() { DomainStatus status1 = new DomainStatus() .addCondition(new DomainCondition(DomainConditionType.Available) .withReason("because").withMessage("hello").withStatus("true")) @@ -179,7 +179,7 @@ public void whenOnlyOldStatusHasConditions_removeThem() { } @Test - public void whenBothStatusesHaveConditions_replaceMismatches() { // time to rethink this + void whenBothStatusesHaveConditions_replaceMismatches() { // time to rethink this DomainStatus status1 = new DomainStatus() .addCondition(new DomainCondition(DomainConditionType.Available) .withReason("ok now").withMessage("hello").withStatus("true")) @@ -199,7 +199,7 @@ public void whenBothStatusesHaveConditions_replaceMismatches() { // time to ret } @Test - public void whenBothStatusesHaveSameConditionTypeWithMismatch_replaceIt() { // time to rethink this + void whenBothStatusesHaveSameConditionTypeWithMismatch_replaceIt() { // time to rethink this DomainStatus status1 = new DomainStatus() .addCondition(new DomainCondition(DomainConditionType.Progressing) .withReason("because").withMessage("Not There")); @@ -215,7 +215,7 @@ public void whenBothStatusesHaveSameConditionTypeWithMismatch_replaceIt() { // } @Test - public void whenOnlyNewStatusHasClusters_addNewClusters() { + void whenOnlyNewStatusHasClusters_addNewClusters() { DomainStatus status1 = new DomainStatus(); DomainStatus status2 = new DomainStatus() .addCluster(new ClusterStatus() @@ -235,7 +235,7 @@ public void whenOnlyNewStatusHasClusters_addNewClusters() { } @Test - public void whenOnlyOldStatusHasClusters_removeThem() { + void whenOnlyOldStatusHasClusters_removeThem() { DomainStatus status1 = new DomainStatus() .addCluster(new ClusterStatus() .withClusterName("cluster1").withReplicas(2).withReadyReplicas(4).withMaximumReplicas(10)) @@ -249,7 +249,7 @@ public void whenOnlyOldStatusHasClusters_removeThem() { } @Test - public void whenBothStatusesHaveClusters_replaceChangedFieldsInMatchingOnes() { + void whenBothStatusesHaveClusters_replaceChangedFieldsInMatchingOnes() { DomainStatus status1 = new DomainStatus() .addCluster(new ClusterStatus() .withClusterName("cluster1").withReplicas(2).withReadyReplicas(4).withMaximumReplicas(10) @@ -281,7 +281,7 @@ public void whenBothStatusesHaveClusters_replaceChangedFieldsInMatchingOnes() { } @Test - public void excludingHealthWhenOnlyNewStatusHasServers_addThem() { + void excludingHealthWhenOnlyNewStatusHasServers_addThem() { DomainStatus status1 = new DomainStatus(); DomainStatus status2 = new DomainStatus() .addServer(new ServerStatus() @@ -301,7 +301,7 @@ public void excludingHealthWhenOnlyNewStatusHasServers_addThem() { } @Test - public void excludingHealthWhenOnlyOldStatusHasServers_removeThem() { + void excludingHealthWhenOnlyOldStatusHasServers_removeThem() { DomainStatus status1 = new DomainStatus() .addServer(new ServerStatus().withServerName("ms1").withClusterName("cluster1")) .addServer(new ServerStatus().withServerName("ms2").withClusterName("cluster1")); @@ -319,7 +319,7 @@ private OffsetDateTime now() { } @Test - public void withHealthScalarsWhenOnlyNewStatusHasServers_addThem() { + void withHealthScalarsWhenOnlyNewStatusHasServers_addThem() { OffsetDateTime activationTime = now(); DomainStatus status1 = new DomainStatus(); DomainStatus status2 = new DomainStatus() @@ -342,7 +342,7 @@ public void withHealthScalarsWhenOnlyNewStatusHasServers_addThem() { } @Test - public void withHealthScalarsWhenBothStatusesHasServers_modifyThem() { + void withHealthScalarsWhenBothStatusesHasServers_modifyThem() { OffsetDateTime activationTime = now(); DomainStatus status1 = new DomainStatus() .addServer(new ServerStatus() @@ -369,7 +369,7 @@ public void withHealthScalarsWhenBothStatusesHasServers_modifyThem() { } @Test - public void withSubsystemHealthWhenOnlyNewStatusHasSubsystemValues_addThem() { + void withSubsystemHealthWhenOnlyNewStatusHasSubsystemValues_addThem() { OffsetDateTime activationTime = now(); DomainStatus status1 = new DomainStatus() .addServer(new ServerStatus().withServerName("ms1")) @@ -409,7 +409,7 @@ public void withSubsystemHealthWhenOnlyNewStatusHasSubsystemValues_addThem() { } @Test - public void whenSubsystemRemovedOrModified_patchAsNeeded() { + void whenSubsystemRemovedOrModified_patchAsNeeded() { OffsetDateTime activationTime = now(); DomainStatus status1 = new DomainStatus() .addServer(new ServerStatus().withServerName("ms1") @@ -445,7 +445,7 @@ public void whenSubsystemRemovedOrModified_patchAsNeeded() { } @Test - public void whenSubsystemSymptomsAddedAndRemoved_addAndRemove() { + void whenSubsystemSymptomsAddedAndRemoved_addAndRemove() { DomainStatus status1 = new DomainStatus() .addServer(new ServerStatus().withServerName("ms1") .withHealth(new ServerHealth() diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainTopologyTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainTopologyTest.java index 20fa4591746..bd595485da5 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainTopologyTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainTopologyTest.java @@ -19,8 +19,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class DomainTopologyTest { - +class DomainTopologyTest { private static final String DOMAIN_TOPOLOGY = "domainValid: true\n" @@ -139,7 +138,7 @@ public class DomainTopologyTest { "domainValid: false\n" + "validationErrors:\n"; @Test - public void parseDomainTopologyYaml() { + void parseDomainTopologyYaml() { DomainTopology domainTopology = DomainTopology.parseDomainTopologyYaml(DOMAIN_TOPOLOGY); @@ -187,7 +186,7 @@ public void parseDomainTopologyYaml() { } @Test - public void parseDynamicServerTopologyYaml() { + void parseDynamicServerTopologyYaml() { DomainTopology domainTopology = DomainTopology.parseDomainTopologyYaml(DYNAMIC_SERVER_TOPOLOGY); @@ -231,7 +230,7 @@ public void parseDynamicServerTopologyYaml() { } @Test - public void parseMixedClusterTopologyYaml() { + void parseMixedClusterTopologyYaml() { DomainTopology domainTopology = DomainTopology.parseDomainTopologyYaml(MIXED_CLUSTER_TOPOLOGY); @@ -310,7 +309,7 @@ public void parseMixedClusterTopologyYaml() { } @Test - public void parseInvalidTopologyYamlWithValidationErrors() { + void parseInvalidTopologyYamlWithValidationErrors() { DomainTopology domainTopology = Objects.requireNonNull(DomainTopology.parseDomainTopologyYaml(INVALID_TOPOLOGY)); assertFalse(domainTopology.getValidationErrors().isEmpty()); @@ -321,7 +320,7 @@ public void parseInvalidTopologyYamlWithValidationErrors() { } @Test - public void parseInvalidTopologyYamlWithNoValidationErrors() { + void parseInvalidTopologyYamlWithNoValidationErrors() { DomainTopology domainTopology = Objects.requireNonNull(DomainTopology.parseDomainTopologyYaml(DOMAIN_INVALID_NO_ERRORS)); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainValidationStepTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainValidationStepTest.java index 73a6526a523..1a3e6ca4e23 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainValidationStepTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/DomainValidationStepTest.java @@ -67,7 +67,7 @@ import static org.hamcrest.Matchers.stringContainsInOrder; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class DomainValidationStepTest { +class DomainValidationStepTest { /** More than one chunk's worth of secrets or configmaps. */ private static final int MULTI_CHUNKS_FIRST_NUM_IN_SECOND_CHUNK = DEFAULT_CALL_LIMIT + 1; private static final int MULTI_CHUNKS_MIDDLE_NUM_IN_FIRST_CHUNK = DEFAULT_CALL_LIMIT / 2; @@ -132,19 +132,19 @@ public void tearDown() { } @Test - public void stepImplementsStepClass() { + void stepImplementsStepClass() { assertThat(domainValidationSteps, instanceOf(Step.class)); } @Test - public void whenDomainIsValid_runNextStep() { + void whenDomainIsValid_runNextStep() { testSupport.runSteps(domainValidationSteps); assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenDomainIsNotValid_dontRunNextStep() { + void whenDomainIsNotValid_dontRunNextStep() { consoleControl.ignoreMessage(DOMAIN_VALIDATION_FAILED); defineDuplicateServerNames(); @@ -154,7 +154,7 @@ public void whenDomainIsNotValid_dontRunNextStep() { } @Test - public void whenDomainIsNotValid_updateStatus() { + void whenDomainIsNotValid_updateStatus() { consoleControl.ignoreMessage(DOMAIN_VALIDATION_FAILED); defineDuplicateServerNames(); @@ -166,7 +166,7 @@ public void whenDomainIsNotValid_updateStatus() { } @Test - public void whenDomainIsNotValid_logSevereMessage() { + void whenDomainIsNotValid_logSevereMessage() { defineDuplicateServerNames(); testSupport.runSteps(domainValidationSteps); @@ -188,7 +188,7 @@ private void defineDuplicateServerNames() { } @Test - public void whenDomainRefersToUnknownSecret_updateStatus() { + void whenDomainRefersToUnknownSecret_updateStatus() { consoleControl.ignoreMessage(DOMAIN_VALIDATION_FAILED); domain.getSpec().withWebLogicCredentialsSecret(new V1SecretReference().name("name").namespace("ns")); @@ -200,7 +200,7 @@ public void whenDomainRefersToUnknownSecret_updateStatus() { } @Test - public void whenDomainRefersToUnknownSecret_dontRunNextStep() { + void whenDomainRefersToUnknownSecret_dontRunNextStep() { consoleControl.ignoreMessage(DOMAIN_VALIDATION_FAILED); domain.getSpec().withWebLogicCredentialsSecret(new V1SecretReference().name("name").namespace("ns")); @@ -210,7 +210,7 @@ public void whenDomainRefersToUnknownSecret_dontRunNextStep() { } @Test - public void whenDomainRefersToDefinedSecret_runNextStep() { + void whenDomainRefersToDefinedSecret_runNextStep() { domain.getSpec().withWebLogicCredentialsSecret(new V1SecretReference().name("name")); testSupport.defineResources(new V1Secret().metadata(new V1ObjectMeta().name("name").namespace(NS))); @@ -220,7 +220,7 @@ public void whenDomainRefersToDefinedSecret_runNextStep() { } @Test - public void whenDomainValidationStepsCalled_withSecretInMultiChunks_packetContainsAllSecrets() { + void whenDomainValidationStepsCalled_withSecretInMultiChunks_packetContainsAllSecrets() { createSecrets(MULTI_CHUNKS_LAST_NUM); testSupport.runSteps(domainValidationSteps); @@ -239,7 +239,7 @@ private boolean matchesExpectedSecretNamePattern(V1Secret secret) { } @Test - public void whenDomainRefersToDefinedSecretInMiddleChunk_runNextStep() { + void whenDomainRefersToDefinedSecretInMiddleChunk_runNextStep() { domain.getSpec().withWebLogicCredentialsSecret( new V1SecretReference().name(TEST_SECRET_PREFIX + MULTI_CHUNKS_FIRST_NUM_IN_SECOND_CHUNK).namespace(NS)); createSecrets(MULTI_CHUNKS_LAST_NUM); @@ -249,7 +249,7 @@ public void whenDomainRefersToDefinedSecretInMiddleChunk_runNextStep() { } @Test - public void whenDomainRefersToDefinedSecretInFirstChunk_runNextStep() { + void whenDomainRefersToDefinedSecretInFirstChunk_runNextStep() { domain.getSpec().withWebLogicCredentialsSecret( new V1SecretReference().name(TEST_SECRET_PREFIX + MULTI_CHUNKS_MIDDLE_NUM_IN_FIRST_CHUNK).namespace(NS)); createSecrets(MULTI_CHUNKS_LAST_NUM); @@ -259,7 +259,7 @@ public void whenDomainRefersToDefinedSecretInFirstChunk_runNextStep() { } @Test - public void whenDomainRefersToDefinedSecretInLastChunk_runNextStep() { + void whenDomainRefersToDefinedSecretInLastChunk_runNextStep() { domain.getSpec().withWebLogicCredentialsSecret( new V1SecretReference().name(TEST_SECRET_PREFIX + MULTI_CHUNKS_LAST_NUM).namespace(NS)); createSecrets(MULTI_CHUNKS_LAST_NUM); @@ -281,7 +281,7 @@ private V1Secret createSecret(String secret) { } @Test - public void whenDomainValidationStepsCalled_withConfigMapInMultiChunks_packetContainsAllConfigMaps() { + void whenDomainValidationStepsCalled_withConfigMapInMultiChunks_packetContainsAllConfigMaps() { createConfigMaps(MULTI_CHUNKS_LAST_NUM); testSupport.runSteps(domainValidationSteps); @@ -300,7 +300,7 @@ private boolean matchesExpectedConfigMapNamePattern(V1ConfigMap cm) { } @Test - public void whenDomainRefersToDefinedConfigMapInMiddleChunk_runNextStep() { + void whenDomainRefersToDefinedConfigMapInMiddleChunk_runNextStep() { domain.getSpec() .withWebLogicCredentialsSecret(new V1SecretReference().name("name")) .setConfiguration(new Configuration().withModel( @@ -316,7 +316,7 @@ public void whenDomainRefersToDefinedConfigMapInMiddleChunk_runNextStep() { } @Test - public void whenDomainRefersToDefinedConfigMapInFirstChunk_runNextStep() { + void whenDomainRefersToDefinedConfigMapInFirstChunk_runNextStep() { domain.getSpec() .withWebLogicCredentialsSecret(new V1SecretReference().name("name")) .setConfiguration(new Configuration().withModel( @@ -332,7 +332,7 @@ public void whenDomainRefersToDefinedConfigMapInFirstChunk_runNextStep() { } @Test - public void whenDomainRefersToDefinedConfigMapInLastChunk_runNextStep() { + void whenDomainRefersToDefinedConfigMapInLastChunk_runNextStep() { domain.getSpec() .withWebLogicCredentialsSecret(new V1SecretReference().name("name")) .setConfiguration(new Configuration().withModel( @@ -360,7 +360,7 @@ private V1ConfigMap createConfigMap(String cm) { } @Test - public void whenClusterDoesNotExistInDomain_logWarning() { + void whenClusterDoesNotExistInDomain_logWarning() { domain.getSpec().withCluster(createCluster("no-such-cluster")); testSupport.addToPacket(DOMAIN_TOPOLOGY, domainConfig); @@ -372,7 +372,7 @@ public void whenClusterDoesNotExistInDomain_logWarning() { } @Test - public void whenServerDoesNotExistInDomain_logWarning() { + void whenServerDoesNotExistInDomain_logWarning() { domain.getSpec().getManagedServers().add(new ManagedServer().withServerName("no-such-server")); testSupport.addToPacket(DOMAIN_TOPOLOGY, domainConfig); @@ -388,7 +388,7 @@ private DomainConfigurator configureDomain(Domain domain) { } @Test - public void whenMonitoringExporterPortConflictsWithAdminServerPort_logWarningAndGenerateEvent() { + void whenMonitoringExporterPortConflictsWithAdminServerPort_logWarningAndGenerateEvent() { configureDomain(domain).withMonitoringExporterConfiguration("queries:\n").withMonitoringExporterPort(7001); testSupport.addToPacket(DOMAIN_TOPOLOGY, domainConfig); @@ -404,7 +404,7 @@ public void whenMonitoringExporterPortConflictsWithAdminServerPort_logWarningAnd } @Test - public void whenMonitoringExporterPortConflictsWithManagedServerPort_logWarningAndGenerateEvent() { + void whenMonitoringExporterPortConflictsWithManagedServerPort_logWarningAndGenerateEvent() { configureDomain(domain).withMonitoringExporterConfiguration("queries:\n").withMonitoringExporterPort(8001); testSupport.addToPacket(DOMAIN_TOPOLOGY, domainConfig); @@ -420,7 +420,7 @@ public void whenMonitoringExporterPortConflictsWithManagedServerPort_logWarningA } @Test - public void whenMonitoringExporterPortConflictsWithClusterServerTemplatePort_logWarningAndGenerateEvent() { + void whenMonitoringExporterPortConflictsWithClusterServerTemplatePort_logWarningAndGenerateEvent() { configureDomain(domain).withMonitoringExporterConfiguration("queries:\n").withMonitoringExporterPort(9001); testSupport.addToPacket(DOMAIN_TOPOLOGY, domainConfig); @@ -437,7 +437,7 @@ public void whenMonitoringExporterPortConflictsWithClusterServerTemplatePort_log } @Test - public void whenServerDoesNotExistInDomain_createEvent() { + void whenServerDoesNotExistInDomain_createEvent() { consoleControl.ignoreMessage(NO_MANAGED_SERVER_IN_DOMAIN); domain.getSpec().getManagedServers().add(new ManagedServer().withServerName("no-such-server")); testSupport.addToPacket(DOMAIN_TOPOLOGY, domainConfig); @@ -448,7 +448,7 @@ public void whenServerDoesNotExistInDomain_createEvent() { } @Test - public void whenClusterDoesNotExistInDomain_createEvent() { + void whenClusterDoesNotExistInDomain_createEvent() { consoleControl.ignoreMessage(NO_CLUSTER_IN_DOMAIN); domain.getSpec().withCluster(createCluster("no-such-cluster")); testSupport.addToPacket(DOMAIN_TOPOLOGY, domainConfig); @@ -459,7 +459,7 @@ public void whenClusterDoesNotExistInDomain_createEvent() { } @Test - public void whenBothServerAndClusterDoNotExistInDomain_createEventWithBothWarnings() { + void whenBothServerAndClusterDoNotExistInDomain_createEventWithBothWarnings() { consoleControl.ignoreMessage(NO_MANAGED_SERVER_IN_DOMAIN); consoleControl.ignoreMessage(NO_CLUSTER_IN_DOMAIN); domain.getSpec().getManagedServers().add(new ManagedServer().withServerName("no-such-server")); @@ -473,7 +473,7 @@ public void whenBothServerAndClusterDoNotExistInDomain_createEventWithBothWarnin } @Test - public void whenIsExplicitRecheck_doNotCreateEvent() { + void whenIsExplicitRecheck_doNotCreateEvent() { consoleControl.ignoreMessage(NO_CLUSTER_IN_DOMAIN); setExplicitRecheck(); domain.getSpec().withCluster(createCluster("no-such-cluster")); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/EventHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/EventHelperTest.java index ae6d64206e8..e4e938fea1c 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/EventHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/EventHelperTest.java @@ -98,7 +98,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -public class EventHelperTest { +class EventHelperTest { private static final String OPERATOR_POD_NAME = "my-weblogic-operator-1234"; private static final String OP_NS = "operator-namespace"; @@ -142,7 +142,7 @@ public void tearDown() { } @Test - public void whenDomainMakeRightCalled_domainProcessingStartingEventCreated() { + void whenDomainMakeRightCalled_domainProcessingStartingEventCreated() { makeRightOperation.execute(); assertThat("Found DOMAIN_PROCESSING_STARTING event", @@ -150,7 +150,7 @@ public void whenDomainMakeRightCalled_domainProcessingStartingEventCreated() { } @Test - public void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithExpectedLabels() { + void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithExpectedLabels() { makeRightOperation.execute(); Map expectedLabels = new HashMap<>(); @@ -162,7 +162,7 @@ public void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithEx } @Test - public void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithExpectedNamespace() { + void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithExpectedNamespace() { makeRightOperation.execute(); assertThat("Found DOMAIN_PROCESSING_STARTING event with expected namespace", @@ -171,7 +171,7 @@ public void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithEx } @Test - public void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithExpectedMessage() { + void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithExpectedMessage() { makeRightOperation.execute(); assertThat("Found DOMAIN_PROCESSING_STARTING event with expected message", @@ -181,7 +181,7 @@ public void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithEx } @Test - public void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithInvolvedObject() { + void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithInvolvedObject() { V1ObjectMeta metadata = domain.getMetadata(); String k8sUID = metadata.getUid(); @@ -194,7 +194,7 @@ public void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithIn } @Test - public void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithReportingComponent() { + void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithReportingComponent() { makeRightOperation.execute(); assertThat("Found DOMAIN_PROCESSING_STARTING event with expected reporting component", @@ -202,7 +202,7 @@ public void whenDomainMakeRightCalled_domainProcessingStartingEventCreatedWithRe } @Test - public void whenCreateEventStepCalledForStarting_domainProcessingStartingEventCreatedWithReportingInstance() { + void whenCreateEventStepCalledForStarting_domainProcessingStartingEventCreatedWithReportingInstance() { String namespaceFromHelm = NamespaceHelper.getOperatorNamespace(); testSupport.runSteps(createEventStep(new EventData(DOMAIN_PROCESSING_STARTING))); @@ -216,7 +216,7 @@ public void whenCreateEventStepCalledForStarting_domainProcessingStartingEventCr } @Test - public void whenCreateEventStepCalledForStartingAndCompleted_domainProcessingCompletedEventCreated() { + void whenCreateEventStepCalledForStartingAndCompleted_domainProcessingCompletedEventCreated() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_STARTING)), createEventStep(new EventData(DOMAIN_PROCESSING_COMPLETED)))); @@ -226,7 +226,7 @@ public void whenCreateEventStepCalledForStartingAndCompleted_domainProcessingCom } @Test - public void whenCreateEventStepCalled4StartingCompleted_domainProcessingCompletedEventCreatedWithExpectedMessage() { + void whenCreateEventStepCalled4StartingCompleted_domainProcessingCompletedEventCreatedWithExpectedMessage() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_STARTING)), createEventStep(new EventData(DOMAIN_PROCESSING_COMPLETED))) @@ -239,7 +239,7 @@ public void whenCreateEventStepCalled4StartingCompleted_domainProcessingComplete } @Test - public void whenCreateEventStepCalled_domainProcessingStartingEventCreatedWithExpectedCount() { + void whenCreateEventStepCalled_domainProcessingStartingEventCreatedWithExpectedCount() { testSupport.runSteps(Step.chain(createEventStep(new EventData(DOMAIN_PROCESSING_STARTING)))); assertThat("Found DOMAIN_PROCESSING_STARTING event with expected count", @@ -247,7 +247,7 @@ public void whenCreateEventStepCalled_domainProcessingStartingEventCreatedWithEx } @Test - public void whenCreateEventCalledTwice_domainProcessingStartingEventCreatedOnceWithExpectedCount() { + void whenCreateEventCalledTwice_domainProcessingStartingEventCreatedOnceWithExpectedCount() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_STARTING)), createEventStep(new EventData(DOMAIN_PROCESSING_COMPLETED)))); @@ -262,7 +262,7 @@ public void whenCreateEventCalledTwice_domainProcessingStartingEventCreatedOnceW } @Test - public void whenCreateEventTwice_fail404OnReplaceEvent_domainProcessingStartingEventCreatedTwice() { + void whenCreateEventTwice_fail404OnReplaceEvent_domainProcessingStartingEventCreatedTwice() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_STARTING)), createEventStep(new EventData(DOMAIN_PROCESSING_COMPLETED)))); @@ -278,7 +278,7 @@ public void whenCreateEventTwice_fail404OnReplaceEvent_domainProcessingStartingE } @Test - public void whenCreateEventTwice_fail409OnReplaceEvent_domainProcessingStartingEventCreatedTwice() { + void whenCreateEventTwice_fail409OnReplaceEvent_domainProcessingStartingEventCreatedTwice() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_STARTING)), createEventStep(new EventData(DOMAIN_PROCESSING_COMPLETED)))); @@ -294,7 +294,7 @@ public void whenCreateEventTwice_fail409OnReplaceEvent_domainProcessingStartingE } @Test - public void whenCreateEventTwice_fail410OnReplaceEvent_domainProcessingStartingEventCreatedTwice() { + void whenCreateEventTwice_fail410OnReplaceEvent_domainProcessingStartingEventCreatedTwice() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_STARTING)), createEventStep(new EventData(DOMAIN_PROCESSING_COMPLETED)))); @@ -310,7 +310,7 @@ public void whenCreateEventTwice_fail410OnReplaceEvent_domainProcessingStartingE } @Test - public void whenCreateEventTwice_fail403OnReplaceEvent_domainProcessingStartingEventCreatedOnce() { + void whenCreateEventTwice_fail403OnReplaceEvent_domainProcessingStartingEventCreatedOnce() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_STARTING)), createEventStep(new EventData(DOMAIN_PROCESSING_COMPLETED)))); @@ -326,7 +326,7 @@ public void whenCreateEventTwice_fail403OnReplaceEvent_domainProcessingStartingE } @Test - public void whenCreateEventStepCalledWithOutStartingEvent_domainProcessingCompletedEventNotCreated() { + void whenCreateEventStepCalledWithOutStartingEvent_domainProcessingCompletedEventNotCreated() { testSupport.runSteps(createEventStep(new EventData(DOMAIN_PROCESSING_COMPLETED))); assertThat("Found DOMAIN_PROCESSING_COMPLETED event", @@ -334,7 +334,7 @@ public void whenCreateEventStepCalledWithOutStartingEvent_domainProcessingComple } @Test - public void whenCreateEventStepCalledWithRetryingAndEvent_domainProcessingCompletedEventCreated() { + void whenCreateEventStepCalledWithRetryingAndEvent_domainProcessingCompletedEventCreated() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_RETRYING)), createEventStep(new EventData(DOMAIN_PROCESSING_STARTING)), @@ -346,7 +346,7 @@ public void whenCreateEventStepCalledWithRetryingAndEvent_domainProcessingComple } @Test - public void whenCreateEventCalledTwice_domainProcessingCompletedEventCreatedOnceWithExpectedCount() { + void whenCreateEventCalledTwice_domainProcessingCompletedEventCreatedOnceWithExpectedCount() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_STARTING)), createEventStep(new EventData(DOMAIN_PROCESSING_COMPLETED)))); @@ -362,7 +362,7 @@ public void whenCreateEventCalledTwice_domainProcessingCompletedEventCreatedOnce } @Test - public void whenCreateEventCalledTwice_thenDeleteEvent_domainProcessingStartingEventCreatedTwice() { + void whenCreateEventCalledTwice_thenDeleteEvent_domainProcessingStartingEventCreatedTwice() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_CREATED)))); @@ -378,7 +378,7 @@ public void whenCreateEventCalledTwice_thenDeleteEvent_domainProcessingStartingE } @Test - public void whenCreateEventCalledTwice_thenDeleteCompletedEvent_domainProcessingCompletedEventCreatedTwice() { + void whenCreateEventCalledTwice_thenDeleteCompletedEvent_domainProcessingCompletedEventCreatedTwice() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_STARTING)), createEventStep(new EventData(DOMAIN_PROCESSING_COMPLETED)))); @@ -396,7 +396,7 @@ public void whenCreateEventCalledTwice_thenDeleteCompletedEvent_domainProcessing } @Test - public void whenCreateEventStepCalledWithFailedEvent_domainProcessingFailedEventCreated() { + void whenCreateEventStepCalledWithFailedEvent_domainProcessingFailedEventCreated() { testSupport.runSteps(createFailureRelatedSteps("FAILED", "Test failure", new TerminalStep())); assertThat("Found DOMAIN_PROCESSING_FAILED event", @@ -404,7 +404,7 @@ public void whenCreateEventStepCalledWithFailedEvent_domainProcessingFailedEvent } @Test - public void whenCreateEventStepCalledWithFailedEvent_domainProcessingFailedEventCreatedWithExpectedMessage() { + void whenCreateEventStepCalledWithFailedEvent_domainProcessingFailedEventCreatedWithExpectedMessage() { testSupport.runSteps(createFailureRelatedSteps("FAILED", "Test this failure", new TerminalStep())); assertThat("Found DOMAIN_PROCESSING_FAILED event with expected message", @@ -414,7 +414,7 @@ public void whenCreateEventStepCalledWithFailedEvent_domainProcessingFailedEvent } @Test - public void whenCreateEventStepCalledWithFailedEventTwice_domainProcessingFailedEventCreatedOnceWithExpectedCount() { + void whenCreateEventStepCalledWithFailedEventTwice_domainProcessingFailedEventCreatedOnceWithExpectedCount() { testSupport.runSteps(createFailureRelatedSteps("FAILED", "Test failure", new TerminalStep())); dispatchAddedEventWatches(); testSupport.runSteps(createFailureRelatedSteps("FAILED", "Test failure", new TerminalStep())); @@ -424,7 +424,7 @@ public void whenCreateEventStepCalledWithFailedEventTwice_domainProcessingFailed } @Test - public void whenMakeRightCalled_withRetryingEventData_domainProcessingRetryingEventCreated() { + void whenMakeRightCalled_withRetryingEventData_domainProcessingRetryingEventCreated() { makeRightOperation.withEventData(DOMAIN_PROCESSING_RETRYING, null).execute(); assertThat("Found DOMAIN_PROCESSING_RETRYING event", @@ -432,7 +432,7 @@ public void whenMakeRightCalled_withRetryingEventData_domainProcessingRetryingEv } @Test - public void whenMakeRightCalled_withRetryingEventData_domainProcessingRetryingEventCreatedWithExpectedMessage() { + void whenMakeRightCalled_withRetryingEventData_domainProcessingRetryingEventCreatedWithExpectedMessage() { makeRightOperation.withEventData(DOMAIN_PROCESSING_RETRYING, null).execute(); assertThat("Found DOMAIN_PROCESSING_RETRYING event with expected message", @@ -442,7 +442,7 @@ public void whenMakeRightCalled_withRetryingEventData_domainProcessingRetryingEv } @Test - public void whenMakeRightCalled_withCreatedEventData_domainCreatedEventCreated() { + void whenMakeRightCalled_withCreatedEventData_domainCreatedEventCreated() { makeRightOperation.withEventData(DOMAIN_CREATED, null).execute(); assertThat("Found DOMAIN_CREATED event", @@ -450,7 +450,7 @@ public void whenMakeRightCalled_withCreatedEventData_domainCreatedEventCreated() } @Test - public void whenMakeRightCalled_withCreatedEventData_domainCreatedEventCreatedWithExpectedMessage() { + void whenMakeRightCalled_withCreatedEventData_domainCreatedEventCreatedWithExpectedMessage() { makeRightOperation.withEventData(DOMAIN_CREATED, null).execute(); assertThat("Found DOMAIN_CREATED event with expected message", @@ -460,7 +460,7 @@ public void whenMakeRightCalled_withCreatedEventData_domainCreatedEventCreatedWi } @Test - public void whenMakeRightCalled_withChangedEventData_domainChangedEventCreated() { + void whenMakeRightCalled_withChangedEventData_domainChangedEventCreated() { makeRightOperation.withEventData(DOMAIN_CHANGED, null).execute(); assertThat("Found DOMAIN_CHANGED event", @@ -468,7 +468,7 @@ public void whenMakeRightCalled_withChangedEventData_domainChangedEventCreated() } @Test - public void whenMakeRightCalled_withChangedEventData_domainChangedEventCreatedWithExpectedMessage() { + void whenMakeRightCalled_withChangedEventData_domainChangedEventCreatedWithExpectedMessage() { makeRightOperation.withEventData(DOMAIN_CHANGED, null).execute(); assertThat("Found DOMAIN_CHANGED event with expected message", @@ -478,7 +478,7 @@ public void whenMakeRightCalled_withChangedEventData_domainChangedEventCreatedWi } @Test - public void whenDomainChangedEventCreateCalledTwice_domainChangedEventCreatedOnceWithExpectedCount() { + void whenDomainChangedEventCreateCalledTwice_domainChangedEventCreatedOnceWithExpectedCount() { presenceInfoMap.put(NS, Map.of(UID, info)); testSupport.runSteps(Step.chain(createEventStep(new EventData(DOMAIN_CHANGED)))); dispatchAddedEventWatches(); @@ -491,7 +491,7 @@ public void whenDomainChangedEventCreateCalledTwice_domainChangedEventCreatedOnc } @Test - public void whenMakeRightCalled_withDeletedEventData_domainDeletedEventCreated() { + void whenMakeRightCalled_withDeletedEventData_domainDeletedEventCreated() { makeRightOperation.withEventData(DOMAIN_DELETED, null).execute(); assertThat("Found DOMAIN_DELETED event", @@ -499,7 +499,7 @@ public void whenMakeRightCalled_withDeletedEventData_domainDeletedEventCreated() } @Test - public void whenMakeRightCalled_withDeletedEventData_domainDeletedEventCreatedWithExpectedMessage() { + void whenMakeRightCalled_withDeletedEventData_domainDeletedEventCreatedWithExpectedMessage() { makeRightOperation.withEventData(DOMAIN_DELETED, null).execute(); assertThat("Found DOMAIN_DELETED event with expected message", @@ -509,7 +509,7 @@ public void whenMakeRightCalled_withDeletedEventData_domainDeletedEventCreatedWi } @Test - public void whenCreateEventStepCalledWithAbortedEvent_domainProcessingAbortedEventCreated() { + void whenCreateEventStepCalledWithAbortedEvent_domainProcessingAbortedEventCreated() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_FAILED)), createEventStep(new EventData(DOMAIN_PROCESSING_ABORTED).message("Test this failure"))) @@ -520,7 +520,7 @@ public void whenCreateEventStepCalledWithAbortedEvent_domainProcessingAbortedEve } @Test - public void whenCreateEventStepCalledWithAbortedEvent_domainProcessingAbortedEventCreatedWithExpectedMessage() { + void whenCreateEventStepCalledWithAbortedEvent_domainProcessingAbortedEventCreatedWithExpectedMessage() { testSupport.runSteps(Step.chain( createEventStep(new EventData(DOMAIN_PROCESSING_FAILED)), createEventStep(new EventData(DOMAIN_PROCESSING_ABORTED).message("Test this failure"))) @@ -533,7 +533,7 @@ public void whenCreateEventStepCalledWithAbortedEvent_domainProcessingAbortedEve } @Test - public void whenCreateEventStepCalledForStartManagingNamespace_eventCreatedWithExpectedMessage() { + void whenCreateEventStepCalledForStartManagingNamespace_eventCreatedWithExpectedMessage() { testSupport.runSteps(createEventStep(new EventData(START_MANAGING_NAMESPACE).namespace(OP_NS).resourceName(NS))); assertThat("Found NAMESPACE_WATCHING_STARTED event with expected message", containsEventWithMessage(getEvents(testSupport), @@ -542,7 +542,7 @@ public void whenCreateEventStepCalledForStartManagingNamespace_eventCreatedWithE } @Test - public void whenCreateEventStepCalledWithNSWatchStartedEvent_eventCreatedWithExpectedNamespace() { + void whenCreateEventStepCalledWithNSWatchStartedEvent_eventCreatedWithExpectedNamespace() { testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STARTED).namespace(NS).resourceName(NS))); assertThat("Found NAMESPACE_WATCHING_STARTED event with expected namespace", containsEventWithNamespace(getEvents(testSupport), @@ -550,7 +550,7 @@ public void whenCreateEventStepCalledWithNSWatchStartedEvent_eventCreatedWithExp } @Test - public void whenCreateEventStepCalledWithNSWatchStartedEvent_eventCreatedWithExpectedLabels() { + void whenCreateEventStepCalledWithNSWatchStartedEvent_eventCreatedWithExpectedLabels() { testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STARTED).namespace(NS).resourceName(NS))); Map expectedLabels = new HashMap<>(); @@ -561,7 +561,7 @@ public void whenCreateEventStepCalledWithNSWatchStartedEvent_eventCreatedWithExp } @Test - public void whenNSWatchStartedEventCreatedTwice_eventCreatedOnceWithExpectedCount() { + void whenNSWatchStartedEventCreatedTwice_eventCreatedOnceWithExpectedCount() { testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STARTED).namespace(NS).resourceName(NS))); dispatchAddedEventWatches(); testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STARTED).namespace(NS).resourceName(NS))); @@ -572,7 +572,7 @@ public void whenNSWatchStartedEventCreatedTwice_eventCreatedOnceWithExpectedCoun } @Test - public void whenNSWatchStartedEventCreated_thenDelete_eventCreatedTwice() { + void whenNSWatchStartedEventCreated_thenDelete_eventCreatedTwice() { testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STARTED).namespace(NS).resourceName(NS))); dispatchAddedEventWatches(); dispatchDeletedEventWatches(); @@ -584,7 +584,7 @@ public void whenNSWatchStartedEventCreated_thenDelete_eventCreatedTwice() { } @Test - public void whenNSWatchStartedEventCreated_fail403OnCreate_foundExpectedLogMessage() { + void whenNSWatchStartedEventCreated_fail403OnCreate_foundExpectedLogMessage() { loggerControl.collectLogMessages(logRecords, CREATING_EVENT_FORBIDDEN); testSupport.failOnCreate(EVENT, null, NS, HTTP_FORBIDDEN); @@ -595,7 +595,7 @@ public void whenNSWatchStartedEventCreated_fail403OnCreate_foundExpectedLogMessa } @Test - public void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailedEventGenerated() { + void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailedEventGenerated() { testSupport.failOnCreate(EVENT, null, NS, HTTP_FORBIDDEN); testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STARTED).namespace(NS).resourceName(NS))); @@ -606,7 +606,7 @@ public void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailed } @Test - public void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailedEventGeneratedWithExpectedMessage() { + void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailedEventGeneratedWithExpectedMessage() { testSupport.failOnCreate(EVENT, null, NS, HTTP_FORBIDDEN); testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STARTED).namespace(NS).resourceName(NS))); @@ -618,7 +618,7 @@ public void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailed } @Test - public void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailedEventGeneratedWithExpectedLabel() { + void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailedEventGeneratedWithExpectedLabel() { testSupport.failOnCreate(EVENT, null, NS, HTTP_FORBIDDEN); testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STARTED).namespace(NS).resourceName(NS))); @@ -631,7 +631,7 @@ public void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailed } @Test - public void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailedEventGeneratedWithExpectedNS() { + void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailedEventGeneratedWithExpectedNS() { testSupport.failOnCreate(EVENT, null, NS, HTTP_FORBIDDEN); testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STARTED).namespace(NS).resourceName(NS))); @@ -644,7 +644,7 @@ public void whenNSWatchStartedEventCreated_fail403OnCreate_startManagingNSFailed } @Test - public void whenCreateEventStepCalledWithNSWatchStoppedEvent_eventCreatedWithExpectedLabels() { + void whenCreateEventStepCalledWithNSWatchStoppedEvent_eventCreatedWithExpectedLabels() { testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STOPPED).namespace(NS).resourceName(NS))); Map expectedLabels = new HashMap<>(); @@ -655,7 +655,7 @@ public void whenCreateEventStepCalledWithNSWatchStoppedEvent_eventCreatedWithExp } @Test - public void whenNSWatchStoppedEventCreated_eventCreatedWithExpectedInvolvedObject() { + void whenNSWatchStoppedEventCreated_eventCreatedWithExpectedInvolvedObject() { testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STOPPED).namespace(NS).resourceName(NS))); assertThat("Found NAMESPACE_WATCHING_STOPPED event with expected involvedObject", @@ -665,7 +665,7 @@ public void whenNSWatchStoppedEventCreated_eventCreatedWithExpectedInvolvedObjec } @Test - public void whenNSWatchStoppedEventCreated_fail404OnReplace_eventCreatedTwice() { + void whenNSWatchStoppedEventCreated_fail404OnReplace_eventCreatedTwice() { testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STOPPED).namespace(NS).resourceName(NS))); dispatchAddedEventWatches(); @@ -680,7 +680,7 @@ public void whenNSWatchStoppedEventCreated_fail404OnReplace_eventCreatedTwice() } @Test - public void whenNSWatchStoppedEventCreated_fail403OnCreate_foundExpectedLogMessage() { + void whenNSWatchStoppedEventCreated_fail403OnCreate_foundExpectedLogMessage() { loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, CREATING_EVENT_FORBIDDEN); testSupport.failOnCreate(EVENT, null, NS, HTTP_FORBIDDEN); @@ -690,7 +690,7 @@ public void whenNSWatchStoppedEventCreated_fail403OnCreate_foundExpectedLogMessa } @Test - public void whenNSWatchStoppedEventCreatedTwice_fail403OnReplace_eventCreatedOnce() { + void whenNSWatchStoppedEventCreatedTwice_fail403OnReplace_eventCreatedOnce() { testSupport.runSteps(Step.chain(createEventStep(new EventData(NAMESPACE_WATCHING_STOPPED)))); CoreV1Event event = EventTestUtils.getEventWithReason(getEvents(testSupport), NAMESPACE_WATCHING_STOPPED_EVENT); @@ -704,7 +704,7 @@ public void whenNSWatchStoppedEventCreatedTwice_fail403OnReplace_eventCreatedOnc } @Test - public void whenNSWatchStoppedEventCreatedTwice_fail403OnReplace_foundExpectedLogMessage() { + void whenNSWatchStoppedEventCreatedTwice_fail403OnReplace_foundExpectedLogMessage() { loggerControl.withLogLevel(Level.INFO).collectLogMessages(logRecords, CREATING_EVENT_FORBIDDEN); testSupport.runSteps(Step.chain(createEventStep(new EventData(NAMESPACE_WATCHING_STOPPED)))); @@ -718,7 +718,7 @@ public void whenNSWatchStoppedEventCreatedTwice_fail403OnReplace_foundExpectedLo } @Test - public void whenCreateEventStepCalledForNSWatchStartedEvent_eventCreatedWithExpectedMessage() { + void whenCreateEventStepCalledForNSWatchStartedEvent_eventCreatedWithExpectedMessage() { testSupport.runSteps(createEventStep(new EventData(NAMESPACE_WATCHING_STARTED).namespace(NS).resourceName(NS))); assertThat("Found START_MANAGING_NAMESPACE event with expected message", containsEventWithMessage(getEvents(testSupport), @@ -727,7 +727,7 @@ public void whenCreateEventStepCalledForNSWatchStartedEvent_eventCreatedWithExpe } @Test - public void whenCreateEventStepCalledForStartManagingNS_eventCreatedWithExpectedNamespace() { + void whenCreateEventStepCalledForStartManagingNS_eventCreatedWithExpectedNamespace() { testSupport.runSteps(createEventStep(new EventData(START_MANAGING_NAMESPACE).namespace(OP_NS).resourceName(NS))); assertThat("Found START_MANAGING_NAMESPACE event with expected namespace", containsEventWithNamespace(getEvents(testSupport), @@ -735,7 +735,7 @@ public void whenCreateEventStepCalledForStartManagingNS_eventCreatedWithExpected } @Test - public void whenCreateEventStepCalledForStartManagingNS_eventCreatedWithExpectedLabels() { + void whenCreateEventStepCalledForStartManagingNS_eventCreatedWithExpectedLabels() { testSupport.runSteps(createEventStep(new EventData(START_MANAGING_NAMESPACE).namespace(OP_NS).resourceName(NS))); Map expectedLabels = new HashMap<>(); @@ -746,7 +746,7 @@ public void whenCreateEventStepCalledForStartManagingNS_eventCreatedWithExpected } @Test - public void whenStartManagingNSEventCreatedTwice_eventCreatedOnceWithExpectedCount() { + void whenStartManagingNSEventCreatedTwice_eventCreatedOnceWithExpectedCount() { Step step = createEventStep(new EventData(START_MANAGING_NAMESPACE).namespace(OP_NS).resourceName(NS)); testSupport.runSteps(step); dispatchAddedEventWatches(); @@ -758,7 +758,7 @@ public void whenStartManagingNSEventCreatedTwice_eventCreatedOnceWithExpectedCou } @Test - public void whenStartManagingNSEventCreated_thenDelete_eventCreatedTwice() { + void whenStartManagingNSEventCreated_thenDelete_eventCreatedTwice() { Step step = createEventStep(new EventData(START_MANAGING_NAMESPACE).namespace(OP_NS).resourceName(NS)); testSupport.runSteps(step); dispatchAddedEventWatches(); @@ -771,7 +771,7 @@ public void whenStartManagingNSEventCreated_thenDelete_eventCreatedTwice() { } @Test - public void whenCreateEventStepCalledForStopManagingNS_eventCreatedWithExpectedLabels() { + void whenCreateEventStepCalledForStopManagingNS_eventCreatedWithExpectedLabels() { testSupport.runSteps(createEventStep(new EventData(STOP_MANAGING_NAMESPACE).namespace(OP_NS).resourceName(NS))); Map expectedLabels = new HashMap<>(); @@ -782,7 +782,7 @@ public void whenCreateEventStepCalledForStopManagingNS_eventCreatedWithExpectedL } @Test - public void whenCreateEventStepCalledForStopManagingNS_eventCreatedWithExpectedInvolvedObject() { + void whenCreateEventStepCalledForStopManagingNS_eventCreatedWithExpectedInvolvedObject() { testSupport.runSteps(createEventStep(new EventData(STOP_MANAGING_NAMESPACE).namespace(OP_NS).resourceName(NS))); assertThat("Found STOP_MANAGING_NAMESPACE event with expected involvedObject", @@ -792,7 +792,7 @@ public void whenCreateEventStepCalledForStopManagingNS_eventCreatedWithExpectedI } @Test - public void whenStopManagingNSEventCreated_fail404OnReplace_eventCreatedWithExpectedCount() { + void whenStopManagingNSEventCreated_fail404OnReplace_eventCreatedWithExpectedCount() { Step step = createEventStep(new EventData(STOP_MANAGING_NAMESPACE).namespace(OP_NS).resourceName(NS)); testSupport.runSteps(step); dispatchAddedEventWatches(); @@ -807,7 +807,7 @@ public void whenStopManagingNSEventCreated_fail404OnReplace_eventCreatedWithExpe } @Test - public void whenStopManagingNSEventCreatedTwice_fail403OnReplace_eventCreatedOnce() { + void whenStopManagingNSEventCreatedTwice_fail403OnReplace_eventCreatedOnce() { Step eventStep = createEventStep(new EventData(STOP_MANAGING_NAMESPACE).namespace(OP_NS).resourceName(NS)); testSupport.runSteps(eventStep); @@ -823,7 +823,7 @@ public void whenStopManagingNSEventCreatedTwice_fail403OnReplace_eventCreatedOnc } @Test - public void whenNSWatchStoppedEventCreatedTwice_fail409OnReplace_eventCreatedOnceWithExpectedCount() { + void whenNSWatchStoppedEventCreatedTwice_fail409OnReplace_eventCreatedOnceWithExpectedCount() { testSupport.addRetryStrategy(retryStrategy); Step eventStep = createEventStep(new EventData(NAMESPACE_WATCHING_STOPPED).namespace(NS).resourceName(NS)); @@ -841,7 +841,7 @@ public void whenNSWatchStoppedEventCreatedTwice_fail409OnReplace_eventCreatedOnc } @Test - public void whenNSWatchStoppedEventCreatedTwice_fail503OnReplace_eventCreatedOnceWithExpectedCount() { + void whenNSWatchStoppedEventCreatedTwice_fail503OnReplace_eventCreatedOnceWithExpectedCount() { testSupport.addRetryStrategy(retryStrategy); Step eventStep = createEventStep(new EventData(NAMESPACE_WATCHING_STOPPED).namespace(NS).resourceName(NS)); @@ -859,7 +859,7 @@ public void whenNSWatchStoppedEventCreatedTwice_fail503OnReplace_eventCreatedOnc } @Test - public void whenDomainRollStartingEventCreateCalled_domainRollStartingEventCreatedWithExpectedCount() { + void whenDomainRollStartingEventCreateCalled_domainRollStartingEventCreatedWithExpectedCount() { testSupport.runSteps(createEventStep(new EventData(DOMAIN_ROLL_STARTING))); assertThat("Found DOMAIN_ROLL_STARTING event with expected count", @@ -867,7 +867,7 @@ public void whenDomainRollStartingEventCreateCalled_domainRollStartingEventCreat } @Test - public void whenDomainRollStartingEventCreateCalled_domainRollStartingEventCreatedWithExpectedMessage() { + void whenDomainRollStartingEventCreateCalled_domainRollStartingEventCreatedWithExpectedMessage() { testSupport.runSteps(createEventStep(new EventData(DOMAIN_ROLL_STARTING).message("abcde"))); assertThat("Found DOMAIN_ROLL_STARTING event with expected message", @@ -877,7 +877,7 @@ public void whenDomainRollStartingEventCreateCalled_domainRollStartingEventCreat } @Test - public void whenDomainRollCompletedEventCreateCalled_domainRollCompletedEventCreatedWithExpectedCount() { + void whenDomainRollCompletedEventCreateCalled_domainRollCompletedEventCreatedWithExpectedCount() { testSupport.runSteps(createEventStep(new EventData(DOMAIN_ROLL_COMPLETED))); assertThat("Found DOMAIN_ROLL_COMPLETED event with expected count", @@ -885,7 +885,7 @@ public void whenDomainRollCompletedEventCreateCalled_domainRollCompletedEventCre } @Test - public void whenDomainRollCompletedEventCreateCalled_domainRollCompletedEventCreatedWithExpectedMessage() { + void whenDomainRollCompletedEventCreateCalled_domainRollCompletedEventCreatedWithExpectedMessage() { testSupport.runSteps(createEventStep(new EventData(DOMAIN_ROLL_COMPLETED))); assertThat("Found DOMAIN_ROLL_COMPLETED event with expected message", @@ -895,7 +895,7 @@ public void whenDomainRollCompletedEventCreateCalled_domainRollCompletedEventCre } @Test - public void whenPodCycleStartingEventCreateCalled_podCycleStartingEventCreatedWithExpectedCount() { + void whenPodCycleStartingEventCreateCalled_podCycleStartingEventCreatedWithExpectedCount() { testSupport.runSteps(createEventStep(new EventData(POD_CYCLE_STARTING))); assertThat("Found POD_CYCLE_STARTING event with expected count", @@ -903,7 +903,7 @@ public void whenPodCycleStartingEventCreateCalled_podCycleStartingEventCreatedWi } @Test - public void whenPodCycleStartingEventCreateCalled_podCycleStartingEventCreatedWithExpectedMessage() { + void whenPodCycleStartingEventCreateCalled_podCycleStartingEventCreatedWithExpectedMessage() { testSupport.runSteps(createEventStep(new EventData(POD_CYCLE_STARTING).podName("12345").message("abcde"))); assertThat("Found POD_CYCLE_STARTING event with expected message", diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/ExternalServiceHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/ExternalServiceHelperTest.java index f46170ce7d0..96c4c32b6d3 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/ExternalServiceHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/ExternalServiceHelperTest.java @@ -26,7 +26,7 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class ExternalServiceHelperTest extends ServiceHelperTest { +class ExternalServiceHelperTest extends ServiceHelperTest { private static final int NODE_PORT = 2300; private static final int LISTEN_PORT = 2100; diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/FileGroupReaderTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/FileGroupReaderTest.java index 5dd6e31d332..01c2b8f1dcb 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/FileGroupReaderTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/FileGroupReaderTest.java @@ -13,12 +13,12 @@ import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class FileGroupReaderTest { +class FileGroupReaderTest { private static final InMemoryFileSystem fileSystem = InMemoryFileSystem.createInstance(); @Test - public void loadFilesFromMemory() throws IOException { + void loadFilesFromMemory() throws IOException { fileSystem.defineFile("group/a.b", "1234"); fileSystem.defineFile("group/x/c.d", "5678"); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/HealthCheckHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/HealthCheckHelperTest.java index 34ebf35e05d..13c2467c138 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/HealthCheckHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/HealthCheckHelperTest.java @@ -37,7 +37,7 @@ import static oracle.kubernetes.utils.LogMatcher.containsWarning; import static org.hamcrest.MatcherAssert.assertThat; -public class HealthCheckHelperTest { +class HealthCheckHelperTest { // The log messages to be checked during this test private static final String[] LOG_KEYS = { @@ -113,7 +113,7 @@ public void tearDown() { } @Test - public void whenRulesReviewSupported_accessGrantedForEverything() { + void whenRulesReviewSupported_accessGrantedForEverything() { expectSelfSubjectRulesReview(); for (String ns : TARGET_NAMESPACES) { @@ -123,7 +123,7 @@ public void whenRulesReviewSupported_accessGrantedForEverything() { } @Test - public void whenRulesReviewSupportedAndNoDomainNamespaceAccess_logWarning() { + void whenRulesReviewSupportedAndNoDomainNamespaceAccess_logWarning() { accessChecks.setMayAccessNamespace(false); expectSelfSubjectRulesReview(); @@ -138,7 +138,7 @@ public void whenRulesReviewSupportedAndNoDomainNamespaceAccess_logWarning() { // HERE @Test - public void whenRulesReviewSupportedAndNoOperatorNamespaceAccess_logWarning() { + void whenRulesReviewSupportedAndNoOperatorNamespaceAccess_logWarning() { accessChecks.setMayAccessNamespace(false); expectSelfSubjectRulesReview(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectionLoggingTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectionLoggingTest.java index b69692f7abd..8dc9730efe1 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectionLoggingTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectionLoggingTest.java @@ -26,7 +26,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class IntrospectionLoggingTest { +class IntrospectionLoggingTest { private final Domain domain = DomainProcessorTestSetup.createTestDomain(); private final DomainPresenceInfo info = new DomainPresenceInfo(domain); private final KubernetesTestSupport testSupport = new KubernetesTestSupport(); @@ -60,7 +60,7 @@ public void tearDown() { private static final String INFO_EXTRA_2 = "still more"; @Test - public void logIntrospectorMessages() { + void logIntrospectorMessages() { IntrospectionTestUtils.defineResources(testSupport, onSeparateLines(SEVERE_MESSAGE_1, WARNING_MESSAGE, INFO_MESSAGE)); @@ -77,7 +77,7 @@ private String onSeparateLines(String... s) { } @Test - public void whenIntrospectorMessageContainsAdditionalLines_logThem() { + void whenIntrospectorMessageContainsAdditionalLines_logThem() { String extendedInfoMessage = onSeparateLines(INFO_MESSAGE, INFO_EXTRA1, INFO_EXTRA_2); IntrospectionTestUtils.defineResources(testSupport, extendedInfoMessage); @@ -88,7 +88,7 @@ public void whenIntrospectorMessageContainsAdditionalLines_logThem() { } @Test - public void whenJobLogContainsSevereError_copyToDomainStatus() { + void whenJobLogContainsSevereError_copyToDomainStatus() { IntrospectionTestUtils.defineResources(testSupport, SEVERE_MESSAGE_1); testSupport.runSteps(JobHelper.readDomainIntrospectorPodLog(terminalStep)); @@ -100,7 +100,7 @@ public void whenJobLogContainsSevereError_copyToDomainStatus() { } @Test - public void whenJobLogContainsMultipleSevereErrors_copyToDomainStatus() { + void whenJobLogContainsMultipleSevereErrors_copyToDomainStatus() { IntrospectionTestUtils.defineResources(testSupport, onSeparateLines(SEVERE_MESSAGE_1, INFO_MESSAGE, INFO_EXTRA1, SEVERE_MESSAGE_2)); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectionStatusTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectionStatusTest.java index 8184296c0fa..5746799e25e 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectionStatusTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectionStatusTest.java @@ -40,7 +40,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; /** Tests updates to a domain status from progress of the introspection job. */ -public class IntrospectionStatusTest { +class IntrospectionStatusTest { private static final String CHAR_LOWER = "abcdefghijklmnopqrstuvwxyz"; private static final Random random = new Random(); @@ -76,7 +76,7 @@ public void tearDown() { } @Test - public void whenNewIntrospectorJobPodStatusContainerStatusesNull_ignoreIt() { + void whenNewIntrospectorJobPodStatusContainerStatusesNull_ignoreIt() { V1Pod introspectorJobPod = createIntrospectorJobPod(createWaitingState(IMAGE_PULL_FAILURE, MESSAGE)); Objects.requireNonNull(introspectorJobPod.getStatus()).containerStatuses(null); @@ -88,7 +88,7 @@ public void whenNewIntrospectorJobPodStatusContainerStatusesNull_ignoreIt() { } @Test - public void whenNewIntrospectorJobPodStatusNull_ignoreIt() { + void whenNewIntrospectorJobPodStatusNull_ignoreIt() { V1Pod introspectorJobPod = createIntrospectorJobPod(UID); processor.dispatchPodWatch(WatchEvent.createAddedEvent(introspectorJobPod).toWatchResponse()); @@ -99,7 +99,7 @@ public void whenNewIntrospectorJobPodStatusNull_ignoreIt() { } @Test - public void whenNewIntrospectorJobPodCreatedWithErrImagePullStatus_patchDomain() { + void whenNewIntrospectorJobPodCreatedWithErrImagePullStatus_patchDomain() { processor.dispatchPodWatch( WatchEvent.createAddedEvent( createIntrospectorJobPod(createWaitingState(IMAGE_PULL_FAILURE, MESSAGE))) @@ -111,7 +111,7 @@ public void whenNewIntrospectorJobPodCreatedWithErrImagePullStatus_patchDomain() } @Test - public void whenNewIntrospectorJobPodCreatedWithNullMessage_ignoreIt() { + void whenNewIntrospectorJobPodCreatedWithNullMessage_ignoreIt() { processor.dispatchPodWatch( WatchEvent.createAddedEvent( createIntrospectorJobPod(createWaitingState(IMAGE_PULL_BACKOFF, null))) @@ -123,7 +123,7 @@ public void whenNewIntrospectorJobPodCreatedWithNullMessage_ignoreIt() { } @Test - public void whenNewIntrospectorJobPodCreatedWithImagePullBackupStatus_patchDomain() { + void whenNewIntrospectorJobPodCreatedWithImagePullBackupStatus_patchDomain() { processor.dispatchPodWatch( WatchEvent.createAddedEvent( createIntrospectorJobPod(createWaitingState(IMAGE_PULL_BACKOFF, MESSAGE))) @@ -135,7 +135,7 @@ public void whenNewIntrospectorJobPodCreatedWithImagePullBackupStatus_patchDomai } @Test - public void whenIntrospectorJobPodPendingWithUnschedulableStatus_patchDomain() { + void whenIntrospectorJobPodPendingWithUnschedulableStatus_patchDomain() { processor.dispatchPodWatch( WatchEvent.createModifiedEvent( createIntrospectorJobPodWithConditions(createPodConditions(UNSCHEDULABLE, MESSAGE))) @@ -147,7 +147,7 @@ public void whenIntrospectorJobPodPendingWithUnschedulableStatus_patchDomain() { } @Test - public void whenIntrospectorJobPodPhaseFailed_patchDomain() { + void whenIntrospectorJobPodPhaseFailed_patchDomain() { processor.dispatchPodWatch( WatchEvent.createModifiedEvent( createIntrospectorJobPodWithPhase("Failed", DEADLINE_EXCEEDED)) @@ -159,7 +159,7 @@ public void whenIntrospectorJobPodPhaseFailed_patchDomain() { } @Test - public void whenNewJobPodFailedBecauseDeletionAfterDeadlineExceeded_dontPatchDomain() { + void whenNewJobPodFailedBecauseDeletionAfterDeadlineExceeded_dontPatchDomain() { processor.dispatchPodWatch( WatchEvent.createModifiedEvent( createIntrospectorJobPodWithPhase("Failed", DEADLINE_EXCEEDED)) @@ -176,7 +176,7 @@ public void whenNewJobPodFailedBecauseDeletionAfterDeadlineExceeded_dontPatchDom } @Test - public void whenNewJobPodFailedWithoutTerminatedAfterDeadlineExceeded_patchDomain() { + void whenNewJobPodFailedWithoutTerminatedAfterDeadlineExceeded_patchDomain() { processor.dispatchPodWatch( WatchEvent.createModifiedEvent( createIntrospectorJobPodWithPhase("Failed", DEADLINE_EXCEEDED)) @@ -193,7 +193,7 @@ public void whenNewJobPodFailedWithoutTerminatedAfterDeadlineExceeded_patchDomai @Test - public void whenNewIntrospectorJobPodStatusReasonNullAfterImagePullFailure_patchDomain() { + void whenNewIntrospectorJobPodStatusReasonNullAfterImagePullFailure_patchDomain() { processor.dispatchPodWatch( WatchEvent.createAddedEvent( createIntrospectorJobPod(createWaitingState(IMAGE_PULL_FAILURE, MESSAGE))) diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectorConfigMapTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectorConfigMapTest.java index a6f24d1a45d..76834d9f291 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectorConfigMapTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/IntrospectorConfigMapTest.java @@ -63,7 +63,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class IntrospectorConfigMapTest { +class IntrospectorConfigMapTest { private static final int TEST_DATA_LIMIT = 1000; private static final int DATA_ALLOWANCE = 500; // assumed size of data that will not be split @@ -125,7 +125,7 @@ void addToPacket() { } @Test - public void whenNoTopologySpecified_continueProcessing() { + void whenNoTopologySpecified_continueProcessing() { testSupport.defineResources( createIntrospectorConfigMap(0, Map.of(TOPOLOGY_YAML, TOPOLOGY_VALUE, SECRETS_MD_5, MD5_SECRETS))); introspectResult.defineFile(SECRETS_MD_5, "not telling").addToPacket(); @@ -136,7 +136,7 @@ public void whenNoTopologySpecified_continueProcessing() { } @Test - public void whenNoTopologySpecified_dontUpdateConfigMap() { + void whenNoTopologySpecified_dontUpdateConfigMap() { testSupport.defineResources( createIntrospectorConfigMap(0, Map.of(TOPOLOGY_YAML, TOPOLOGY_VALUE, SECRETS_MD_5, MD5_SECRETS))); introspectResult.defineFile(SECRETS_MD_5, "not telling").addToPacket(); @@ -147,7 +147,7 @@ public void whenNoTopologySpecified_dontUpdateConfigMap() { } @Test - public void whenNoTopologySpecified_addIntrospectionVersionLabel() { + void whenNoTopologySpecified_addIntrospectionVersionLabel() { forDomain(domain).withIntrospectVersion("4"); testSupport.defineResources( createIntrospectorConfigMap(0, Map.of(TOPOLOGY_YAML, TOPOLOGY_VALUE, SECRETS_MD_5, MD5_SECRETS))); @@ -175,7 +175,7 @@ private String getIntrospectionVersion() { } @Test - public void whenTopologyNotValid_reportInDomainStatus() { + void whenTopologyNotValid_reportInDomainStatus() { introspectResult.defineFile(TOPOLOGY_YAML, "domainValid: false", "validationErrors: [first problem, second problem]").addToPacket(); @@ -198,7 +198,7 @@ private Domain getDomain() { } @Test - public void whenTopologyNotValid_abortProcessing() { + void whenTopologyNotValid_abortProcessing() { introspectResult.defineFile(TOPOLOGY_YAML, "domainValid: false", "validationErrors: []").addToPacket(); testSupport.runSteps(ConfigMapHelper.createIntrospectorConfigMapStep(terminalStep)); @@ -207,7 +207,7 @@ public void whenTopologyNotValid_abortProcessing() { } @Test - public void whenTopologyPresent_continueProcessing() { + void whenTopologyPresent_continueProcessing() { introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"").addToPacket(); @@ -217,7 +217,7 @@ public void whenTopologyPresent_continueProcessing() { } @Test - public void whenTopologyPresent_addToPacket() { + void whenTopologyPresent_addToPacket() { introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"").addToPacket(); @@ -227,7 +227,7 @@ public void whenTopologyPresent_addToPacket() { } @Test - public void whenTopologyAndDomainZipHashPresent_addToPacket() { + void whenTopologyAndDomainZipHashPresent_addToPacket() { introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"") .defineFile(DOMAINZIP_HASH, DOMAIN_HASH_VALUE) @@ -239,7 +239,7 @@ public void whenTopologyAndDomainZipHashPresent_addToPacket() { } @Test - public void whenTopologyAndDomainZipHashPresent_addToConfigMap() { + void whenTopologyAndDomainZipHashPresent_addToConfigMap() { introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"") .defineFile(DOMAINZIP_HASH, DOMAIN_HASH_VALUE) @@ -285,7 +285,7 @@ private static String getConfigMapName(V1ConfigMap configMap) { } @Test - public void whenTopologyAndMIISecretsHashPresent_addToPacket() { + void whenTopologyAndMIISecretsHashPresent_addToPacket() { introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"") .defineFile(SECRETS_MD_5, MD5_SECRETS) @@ -297,7 +297,7 @@ public void whenTopologyAndMIISecretsHashPresent_addToPacket() { } @Test - public void whenTopologyAndMIISecretsHashPresent_addToConfigMap() { + void whenTopologyAndMIISecretsHashPresent_addToConfigMap() { introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"") .defineFile(SECRETS_MD_5, MD5_SECRETS) @@ -309,7 +309,7 @@ public void whenTopologyAndMIISecretsHashPresent_addToConfigMap() { } @Test - public void whenDataTooLargeForSingleConfigMap_recordCountInMap() { + void whenDataTooLargeForSingleConfigMap_recordCountInMap() { introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"") .defineFile(LARGE_DATA_KEY, LARGE_DATA_VALUE) @@ -321,7 +321,7 @@ public void whenDataTooLargeForSingleConfigMap_recordCountInMap() { } @Test - public void whenDataTooLargeForSingleConfigMap_recordCountInPacket() { + void whenDataTooLargeForSingleConfigMap_recordCountInPacket() { introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"") .defineFile(LARGE_DATA_KEY, LARGE_DATA_VALUE) @@ -333,7 +333,7 @@ public void whenDataTooLargeForSingleConfigMap_recordCountInPacket() { } @Test - public void whenDataTooLargeForSingleConfigMap_createMultipleMaps() { + void whenDataTooLargeForSingleConfigMap_createMultipleMaps() { introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"") .defineFile(LARGE_DATA_KEY, LARGE_DATA_VALUE) @@ -345,7 +345,7 @@ public void whenDataTooLargeForSingleConfigMap_createMultipleMaps() { } @Test - public void whenDomainHasRestartVersion_addToPacket() { + void whenDomainHasRestartVersion_addToPacket() { configureDomain().withRestartVersion(RESTART_VERSION); introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"") @@ -361,7 +361,7 @@ private DomainConfigurator configureDomain() { } @Test - public void whenDomainIsModelInImage_addImageSpecHashToPacket() { + void whenDomainIsModelInImage_addImageSpecHashToPacket() { configureDomain().withDomainHomeSourceType(DomainSourceType.FromModel); introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"") @@ -373,7 +373,7 @@ public void whenDomainIsModelInImage_addImageSpecHashToPacket() { } @Test - public void whenDomainIsModelInImage_dontAddRangesForZipsThatFitInMainConfigMap() { + void whenDomainIsModelInImage_dontAddRangesForZipsThatFitInMainConfigMap() { configureDomain().withDomainHomeSourceType(DomainSourceType.FromModel); introspectResult .defineFile(TOPOLOGY_YAML, "domainValid: true", "domain:", " name: \"sample\"") @@ -403,7 +403,7 @@ private static String getIntrospectorConfigMapName(int mapIndex) { } @Test - public void loadExistingEntriesFromIntrospectorConfigMap() { + void loadExistingEntriesFromIntrospectorConfigMap() { testSupport.defineResources(createIntrospectorConfigMap(0, Map.of( TOPOLOGY_YAML, TOPOLOGY_VALUE, SECRETS_MD_5, MD5_SECRETS, @@ -431,7 +431,7 @@ private WlsDomainConfig getParsedDomain(String topologyYaml) { } @Test - public void whenSitConfigEntriesMissingFromIntrospectionResult_removeFromConfigMap() { + void whenSitConfigEntriesMissingFromIntrospectionResult_removeFromConfigMap() { testSupport.defineResources(createIntrospectorConfigMap(0, Map.of( TOPOLOGY_YAML, TOPOLOGY_VALUE, "Sit-Cfg-1", "value1", @@ -446,7 +446,7 @@ public void whenSitConfigEntriesMissingFromIntrospectionResult_removeFromConfigM } @Test - public void whenNoTopologySpecified_dontRemoveSitConfigEntries() { + void whenNoTopologySpecified_dontRemoveSitConfigEntries() { testSupport.defineResources( createIntrospectorConfigMap(0, Map.of(TOPOLOGY_YAML, TOPOLOGY_VALUE, "Sit-Cfg-1", "value1"))); introspectResult.defineFile(SECRETS_MD_5, "not telling").addToPacket(); @@ -457,7 +457,7 @@ public void whenNoTopologySpecified_dontRemoveSitConfigEntries() { } @Test - public void whenRequested_deleteAllIntrospectorConfigMaps() { + void whenRequested_deleteAllIntrospectorConfigMaps() { testSupport.defineResources( createIntrospectorConfigMap(0, Map.of()), createIntrospectorConfigMap(1, Map.of()), diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/JobHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/JobHelperTest.java index 28490848613..a69a1cf6c51 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/JobHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/JobHelperTest.java @@ -97,7 +97,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class JobHelperTest extends DomainValidationBaseTest { +class JobHelperTest extends DomainValidationBaseTest { private static final String RAW_VALUE_1 = "find uid1 at $(DOMAIN_HOME)"; private static final String END_VALUE_1 = "find uid1 at /u01/oracle/user_projects/domains"; protected static final String LONG_RESOURCE_NAME @@ -156,21 +156,21 @@ public void tearDown() { } @Test - public void creatingServers_true_whenClusterReplicas_gt_0() { + void creatingServers_true_whenClusterReplicas_gt_0() { configureCluster("cluster1").withReplicas(1); assertThat(JobHelper.creatingServers(domainPresenceInfo), equalTo(true)); } @Test - public void creatingServers_false_whenClusterReplicas_is_0() { + void creatingServers_false_whenClusterReplicas_is_0() { configureCluster("cluster1").withReplicas(0); assertThat(JobHelper.creatingServers(domainPresenceInfo), equalTo(false)); } @Test - public void creatingServers_true_whenDomainReplicas_gt_0_and_cluster_has_no_replicas() { + void creatingServers_true_whenDomainReplicas_gt_0_and_cluster_has_no_replicas() { configureDomain().withDefaultReplicaCount(1); configureCluster("cluster1"); @@ -179,7 +179,7 @@ public void creatingServers_true_whenDomainReplicas_gt_0_and_cluster_has_no_repl } @Test - public void creatingServers_false_whenDomainReplicas_is_0_and_cluster_has_no_replicas() { + void creatingServers_false_whenDomainReplicas_is_0_and_cluster_has_no_replicas() { configureDomain().withDefaultReplicaCount(0); configureCluster("cluster1"); @@ -188,19 +188,19 @@ public void creatingServers_false_whenDomainReplicas_is_0_and_cluster_has_no_rep } @Test - public void creatingServers_false_when_no_domain_nor_cluster_replicas() { + void creatingServers_false_when_no_domain_nor_cluster_replicas() { configureCluster("cluster1"); assertThat(JobHelper.creatingServers(domainPresenceInfo), equalTo(false)); } @Test - public void creatingServers_false_when_noCluster_and_Start_Never_startPolicy() { + void creatingServers_false_when_noCluster_and_Start_Never_startPolicy() { assertThat(JobHelper.creatingServers(domainPresenceInfo), equalTo(false)); } @Test - public void creatingServers_true_when_noCluster_and_Start_If_Needed_startPolicy() { + void creatingServers_true_when_noCluster_and_Start_If_Needed_startPolicy() { configureDomain() .withDefaultServerStartPolicy(ConfigurationConstants.START_IF_NEEDED); @@ -208,7 +208,7 @@ public void creatingServers_true_when_noCluster_and_Start_If_Needed_startPolicy( } @Test - public void creatingServers_true_when_noCluster_and_Start_Always_startPolicy() { + void creatingServers_true_when_noCluster_and_Start_Always_startPolicy() { configureDomain() .withDefaultServerStartPolicy(ConfigurationConstants.START_ALWAYS); @@ -216,7 +216,7 @@ public void creatingServers_true_when_noCluster_and_Start_Always_startPolicy() { } @Test - public void creatingServers_false_when_server_with_Start_Never_startPolicy() { + void creatingServers_false_when_server_with_Start_Never_startPolicy() { configureServer("managed-server1") .withServerStartPolicy(ConfigurationConstants.START_NEVER); @@ -224,7 +224,7 @@ public void creatingServers_false_when_server_with_Start_Never_startPolicy() { } @Test - public void creatingServers_true_when_server_with_Start_If_Needed_startPolicy() { + void creatingServers_true_when_server_with_Start_If_Needed_startPolicy() { configureServer("managed-server1") .withServerStartPolicy(ConfigurationConstants.START_IF_NEEDED); @@ -232,7 +232,7 @@ public void creatingServers_true_when_server_with_Start_If_Needed_startPolicy() } @Test - public void creatingServers_true_when_server_with_Start_Always_startPolicy() { + void creatingServers_true_when_server_with_Start_Always_startPolicy() { configureServer("managed-server1") .withServerStartPolicy(ConfigurationConstants.START_ALWAYS); @@ -240,7 +240,7 @@ public void creatingServers_true_when_server_with_Start_Always_startPolicy() { } @Test - public void whenDomainHasEnvironmentItems_introspectorPodStartupWithThem() { + void whenDomainHasEnvironmentItems_introspectorPodStartupWithThem() { configureDomain() .withEnvironmentVariable("item1", "value1") .withEnvironmentVariable("item2", "value2") @@ -267,7 +267,7 @@ public void whenDomainHasEnvironmentItems_introspectorPodStartupWithThem() { } @Test - public void whenDomainIsOnlineUpdate_introspectorPodStartupWithThem() { + void whenDomainIsOnlineUpdate_introspectorPodStartupWithThem() { configureDomain() .withMIIOnlineUpdate(); @@ -289,7 +289,7 @@ public void whenDomainIsOnlineUpdate_introspectorPodStartupWithThem() { } @Test - public void whenDomainIsNotOnlineUpdate_introspectorPodStartupWithoutThem() { + void whenDomainIsNotOnlineUpdate_introspectorPodStartupWithoutThem() { V1JobSpec jobSpec = createJobSpec(); @@ -319,7 +319,7 @@ private V1JobSpec createJobSpec() { } @Test - public void introspectorPodStartsWithDefaultUser_Mem_Args_environmentVariable() { + void introspectorPodStartsWithDefaultUser_Mem_Args_environmentVariable() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -329,7 +329,7 @@ public void introspectorPodStartsWithDefaultUser_Mem_Args_environmentVariable() } @Test - public void whenDomainHasEmptyStringUser_Mem_Args_EnvironmentItem_introspectorPodStartupWithIt() { + void whenDomainHasEmptyStringUser_Mem_Args_EnvironmentItem_introspectorPodStartupWithIt() { configureDomain().withEnvironmentVariable("USER_MEM_ARGS", ""); V1JobSpec jobSpec = createJobSpec(); @@ -342,7 +342,7 @@ public void whenDomainHasEmptyStringUser_Mem_Args_EnvironmentItem_introspectorPo } @Test - public void whenDomainHasEnvironmentItemsWithVariables_introspectorPodStartupWithThem() { + void whenDomainHasEnvironmentItemsWithVariables_introspectorPodStartupWithThem() { configureDomain().withEnvironmentVariable("item1", RAW_VALUE_1); V1JobSpec jobSpec = createJobSpec(); @@ -358,7 +358,7 @@ public void whenDomainHasEnvironmentItemsWithVariables_introspectorPodStartupWit private static final String EMPTY_DATA_HOME = ""; @Test - public void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyDataHomeEnvNotDefined() { + void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyDataHomeEnvNotDefined() { V1JobSpec jobSpec = createJobSpec(); assertThat(getMatchingContainerEnv(domainPresenceInfo, jobSpec), @@ -375,7 +375,7 @@ public void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyDataHomeEnv private static final String OVERRIDE_DATA_HOME = OVERRIDE_DATA_DIR + File.separator + UID; @Test - public void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyDataHomeEnvDefined() { + void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyDataHomeEnvDefined() { configureDomain().withDataHome(OVERRIDE_DATA_DIR); V1JobSpec jobSpec = createJobSpec(); @@ -388,7 +388,7 @@ public void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyDataHomeEnv } @Test - public void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyEmptyDataHome() { + void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyEmptyDataHome() { configureDomain().withDataHome(EMPTY_DATA_HOME); V1JobSpec jobSpec = createJobSpec(); @@ -405,7 +405,7 @@ public void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyEmptyDataHo private static final String NULL_DATA_HOME = null; @Test - public void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyNullDataHome() { + void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyNullDataHome() { configureDomain().withDataHome(NULL_DATA_HOME); V1JobSpec jobSpec = createJobSpec(); @@ -415,7 +415,7 @@ public void whenDomainHasEnvironmentVars_introspectorPodStartupVerifyNullDataHom } @Test - public void whenAdminServerHasEnvironmentItems_introspectorPodStartupWithThem() { + void whenAdminServerHasEnvironmentItems_introspectorPodStartupWithThem() { configureDomain() .withEnvironmentVariable("item1", "domain-value1") .withEnvironmentVariable("item2", "domain-value2") @@ -441,7 +441,7 @@ public void whenAdminServerHasEnvironmentItems_introspectorPodStartupWithThem() } @Test - public void whenDomainHasValueFromEnvironmentItems_introspectorPodStartupWithThem() { + void whenDomainHasValueFromEnvironmentItems_introspectorPodStartupWithThem() { configureDomain() .withEnvironmentVariable(configMapKeyRefEnvVar) .withEnvironmentVariable(secretKeyRefEnvVar) @@ -465,7 +465,7 @@ public void whenDomainHasValueFromEnvironmentItems_introspectorPodStartupWithThe } @Test - public void whenAdminServerHasValueFromEnvironmentItems_introspectorPodStartupWithThem() { + void whenAdminServerHasValueFromEnvironmentItems_introspectorPodStartupWithThem() { configureDomain() .configureAdminServer() .withEnvironmentVariable(configMapKeyRefEnvVar) @@ -490,7 +490,7 @@ public void whenAdminServerHasValueFromEnvironmentItems_introspectorPodStartupWi } @Test - public void introspectorPodStartupWithNullAdminUsernamePasswordEnvVarValues() { + void introspectorPodStartupWithNullAdminUsernamePasswordEnvVarValues() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -505,7 +505,7 @@ public void introspectorPodStartupWithNullAdminUsernamePasswordEnvVarValues() { } @Test - public void + void whenDomainHasEnvironmentItemsWithVariable_createIntrospectorPodShouldNotChangeItsValue() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { DomainConfigurator domainConfigurator = @@ -518,7 +518,7 @@ public void introspectorPodStartupWithNullAdminUsernamePasswordEnvVarValues() { } @Test - public void whenDomainHasAdditionalVolumesWithReservedVariables_createIntrospectorPodWithSubstitutions() { + void whenDomainHasAdditionalVolumesWithReservedVariables_createIntrospectorPodWithSubstitutions() { configureDomain() .withAdditionalVolumeMount("volume2", "/source-$(DOMAIN_UID)"); runCreateJob(); @@ -544,7 +544,7 @@ private List getJobVolumes() { } @Test - public void whenDomainHasAdditionalVolumesWithCustomVariables_createIntrospectorPodWithSubstitutions() { + void whenDomainHasAdditionalVolumesWithCustomVariables_createIntrospectorPodWithSubstitutions() { resourceLookup.defineResource(SECRET_NAME, KubernetesResourceType.Secret, NS); resourceLookup.defineResource(OVERRIDES_CM_NAME_MODEL, KubernetesResourceType.ConfigMap, NS); resourceLookup.defineResource(OVERRIDES_CM_NAME_IMAGE, KubernetesResourceType.ConfigMap, NS); @@ -561,7 +561,7 @@ public void whenDomainHasAdditionalVolumesWithCustomVariables_createIntrospector } @Test - public void whenDomainHasAdditionalVolumesWithCustomVariablesInvalidValue_jobNotCreated() { + void whenDomainHasAdditionalVolumesWithCustomVariablesInvalidValue_jobNotCreated() { resourceLookup.defineResource(SECRET_NAME, KubernetesResourceType.Secret, NS); resourceLookup.defineResource(OVERRIDES_CM_NAME_MODEL, KubernetesResourceType.ConfigMap, NS); resourceLookup.defineResource(OVERRIDES_CM_NAME_IMAGE, KubernetesResourceType.ConfigMap, NS); @@ -582,7 +582,7 @@ public void whenDomainHasAdditionalVolumesWithCustomVariablesInvalidValue_jobNot } @Test - public void whenDomainHasMultipleConfigOverrideSecretsWithLongNames_volumesCreatedWithShorterNames() { + void whenDomainHasMultipleConfigOverrideSecretsWithLongNames_volumesCreatedWithShorterNames() { resourceLookup.defineResource(LONG_RESOURCE_NAME, KubernetesResourceType.Secret, NS); resourceLookup.defineResource(SECOND_LONG_RESOURCE_NAME, KubernetesResourceType.Secret, NS); @@ -601,7 +601,7 @@ public void whenDomainHasMultipleConfigOverrideSecretsWithLongNames_volumesCreat } @Test - public void whenDomainHasConfigMapOverrideWithLongConfigMapName_volumeCreatedWithShorterName() { + void whenDomainHasConfigMapOverrideWithLongConfigMapName_volumeCreatedWithShorterName() { resourceLookup.defineResource(LONG_RESOURCE_NAME, KubernetesResourceType.ConfigMap, NS); configureDomain() @@ -615,7 +615,7 @@ public void whenDomainHasConfigMapOverrideWithLongConfigMapName_volumeCreatedWit } @Test - public void whenDomainHasModelConfigMapOverrideWithLongModelCMName_volumeCreatedWithShorterName() { + void whenDomainHasModelConfigMapOverrideWithLongModelCMName_volumeCreatedWithShorterName() { resourceLookup.defineResource(LONG_RESOURCE_NAME, KubernetesResourceType.ConfigMap, NS); configureDomain() @@ -630,7 +630,7 @@ public void whenDomainHasModelConfigMapOverrideWithLongModelCMName_volumeCreated } @Test - public void whenDomainHasMultipleConfigOverrideSecretsWithLongAndShortNames_volumeCreatedWithCorrectNames() { + void whenDomainHasMultipleConfigOverrideSecretsWithLongAndShortNames_volumeCreatedWithCorrectNames() { resourceLookup.defineResource(SECRET_NAME, KubernetesResourceType.Secret, NS); resourceLookup.defineResource(LONG_RESOURCE_NAME, KubernetesResourceType.Secret, NS); @@ -648,7 +648,7 @@ public void whenDomainHasMultipleConfigOverrideSecretsWithLongAndShortNames_volu } @Test - public void verify_introspectorPodSpec_activeDeadlineSeconds_initial_values() { + void verify_introspectorPodSpec_activeDeadlineSeconds_initial_values() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -667,7 +667,7 @@ private static V1PodSpec getTemplateSpec(V1JobSpec jobSpec) { } @Test - public void verify_introspectorPodSpec_activeDeadlineSeconds_retry_values() { + void verify_introspectorPodSpec_activeDeadlineSeconds_retry_values() { int failureCount = domainPresenceInfo.incrementAndGetFailureCount(); V1JobSpec jobSpec = createJobSpec(); @@ -680,7 +680,7 @@ public void verify_introspectorPodSpec_activeDeadlineSeconds_retry_values() { } @Test - public void verify_introspectorPodSpec_activeDeadlineSeconds_domain_overrides_values() { + void verify_introspectorPodSpec_activeDeadlineSeconds_domain_overrides_values() { configureDomain().withIntrospectorJobActiveDeadlineSeconds(600L); V1JobSpec jobSpec = createJobSpec(); @@ -690,21 +690,21 @@ public void verify_introspectorPodSpec_activeDeadlineSeconds_domain_overrides_va } @Test - public void podTemplate_hasCreateByOperatorLabel() { + void podTemplate_hasCreateByOperatorLabel() { V1JobSpec jobSpec = createJobSpec(); assertThat(getTemplateLabel(jobSpec, LabelConstants.CREATEDBYOPERATOR_LABEL), equalTo("true")); } @Test - public void podTemplate_hasDomainUidLabel() { + void podTemplate_hasDomainUidLabel() { V1JobSpec jobSpec = createJobSpec(); assertThat(getTemplateLabel(jobSpec, LabelConstants.DOMAINUID_LABEL), equalTo(UID)); } @Test - public void podTemplate_hasJobNameLabel() { + void podTemplate_hasJobNameLabel() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -721,7 +721,7 @@ private String getTemplateLabel(V1JobSpec jobSpec, String labelKey) { } @Test - public void introspectorPodSpec_alwaysCreatedWithNeverRestartPolicy() { + void introspectorPodSpec_alwaysCreatedWithNeverRestartPolicy() { configureDomain() .withRestartPolicy("Always"); V1JobSpec jobSpec = createJobSpec(); @@ -732,7 +732,7 @@ public void introspectorPodSpec_alwaysCreatedWithNeverRestartPolicy() { } @Test - public void introspectorPodSpec_createdWithoutConfiguredReadinessGates() { + void introspectorPodSpec_createdWithoutConfiguredReadinessGates() { configureDomain() .withReadinessGate(new V1PodReadinessGate().conditionType("www.example.com/feature-1")); V1JobSpec jobSpec = createJobSpec(); @@ -743,7 +743,7 @@ public void introspectorPodSpec_createdWithoutConfiguredReadinessGates() { } @Test - public void introspectorPodSpec_createdWithoutConfiguredInitContainers() { + void introspectorPodSpec_createdWithoutConfiguredInitContainers() { configureDomain() .withInitContainer( createContainer( @@ -757,7 +757,7 @@ public void introspectorPodSpec_createdWithoutConfiguredInitContainers() { } @Test - public void introspectorPodSpec_createdWithoutConfiguredContainers() { + void introspectorPodSpec_createdWithoutConfiguredContainers() { configureDomain() .withContainer( createContainer( @@ -772,7 +772,7 @@ public void introspectorPodSpec_createdWithoutConfiguredContainers() { } @Test - public void introspectorPodContainerSpec_hasJobNameAsContainerName() { + void introspectorPodContainerSpec_hasJobNameAsContainerName() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -781,7 +781,7 @@ public void introspectorPodContainerSpec_hasJobNameAsContainerName() { } @Test - public void whenDomainHasContainerSecurityContext_introspectorPodContainersStartupWithIt() { + void whenDomainHasContainerSecurityContext_introspectorPodContainersStartupWithIt() { configureDomain().withContainerSecurityContext(containerSecurityContext); V1JobSpec jobSpec = createJobSpec(); @@ -789,14 +789,14 @@ public void whenDomainHasContainerSecurityContext_introspectorPodContainersStart } @Test - public void whenNotConfigured_introspectorPodContainers_hasEmptySecurityContext() { + void whenNotConfigured_introspectorPodContainers_hasEmptySecurityContext() { V1JobSpec jobSpec = createJobSpec(); getContainerStream(jobSpec).forEach(c -> assertThat(c.getSecurityContext(), is(new V1SecurityContext()))); } @Test - public void whenDomainHasPodSecurityContext_introspectorPodSpecStartupWithIt() { + void whenDomainHasPodSecurityContext_introspectorPodSpecStartupWithIt() { configureDomain().withPodSecurityContext(podSecurityContext); V1JobSpec jobSpec = createJobSpec(); @@ -806,7 +806,7 @@ public void whenDomainHasPodSecurityContext_introspectorPodSpecStartupWithIt() { } @Test - public void whenNotConfigured_introspectorPodSpec_hasEmptySecurityContext() { + void whenNotConfigured_introspectorPodSpec_hasEmptySecurityContext() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -815,7 +815,7 @@ public void whenNotConfigured_introspectorPodSpec_hasEmptySecurityContext() { } @Test - public void whenDomainHasAffinityConfigured_introspectorPodSpecStartupWithIt() { + void whenDomainHasAffinityConfigured_introspectorPodSpecStartupWithIt() { configureDomain().withAffinity(podAffinity); V1JobSpec jobSpec = createJobSpec(); @@ -825,7 +825,7 @@ public void whenDomainHasAffinityConfigured_introspectorPodSpecStartupWithIt() { } @Test - public void whenNotConfigured_introspectorPodSpec_hasNullAffinity() { + void whenNotConfigured_introspectorPodSpec_hasNullAffinity() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -834,7 +834,7 @@ public void whenNotConfigured_introspectorPodSpec_hasNullAffinity() { } @Test - public void whenDomainHasNodeSelectorConfigured_introspectorPodSpecStartupWithIt() { + void whenDomainHasNodeSelectorConfigured_introspectorPodSpecStartupWithIt() { configureDomain().withNodeSelector("os", "linux"); V1JobSpec jobSpec = createJobSpec(); @@ -844,7 +844,7 @@ public void whenDomainHasNodeSelectorConfigured_introspectorPodSpecStartupWithIt } @Test - public void whenNotConfigured_introspectorPodSpec_hasEmptyNodeSelector() { + void whenNotConfigured_introspectorPodSpec_hasEmptyNodeSelector() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -853,7 +853,7 @@ public void whenNotConfigured_introspectorPodSpec_hasEmptyNodeSelector() { } @Test - public void whenDomainHasNodeNameConfigured_introspectorPodSpecStartupWithIt() { + void whenDomainHasNodeNameConfigured_introspectorPodSpecStartupWithIt() { configureDomain().withNodeName("kube-02"); V1JobSpec jobSpec = createJobSpec(); @@ -863,7 +863,7 @@ public void whenDomainHasNodeNameConfigured_introspectorPodSpecStartupWithIt() { } @Test - public void whenNotConfigured_introspectorPodSpec_hasNullNodeName() { + void whenNotConfigured_introspectorPodSpec_hasNullNodeName() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -872,7 +872,7 @@ public void whenNotConfigured_introspectorPodSpec_hasNullNodeName() { } @Test - public void whenDomainHasSchedulerNameConfigured_introspectorPodSpecStartupWithIt() { + void whenDomainHasSchedulerNameConfigured_introspectorPodSpecStartupWithIt() { configureDomain().withSchedulerName("my-scheduler"); V1JobSpec jobSpec = createJobSpec(); @@ -882,7 +882,7 @@ public void whenDomainHasSchedulerNameConfigured_introspectorPodSpecStartupWithI } @Test - public void whenNotConfigured_introspectorPodSpec_hasNullSchedulerName() { + void whenNotConfigured_introspectorPodSpec_hasNullSchedulerName() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -891,7 +891,7 @@ public void whenNotConfigured_introspectorPodSpec_hasNullSchedulerName() { } @Test - public void whenDomainHasRuntimeClassNameConfigured_introspectorPodSpecStartupWithIt() { + void whenDomainHasRuntimeClassNameConfigured_introspectorPodSpecStartupWithIt() { configureDomain().withRuntimeClassName("MyRuntimeClass"); V1JobSpec jobSpec = createJobSpec(); @@ -901,7 +901,7 @@ public void whenDomainHasRuntimeClassNameConfigured_introspectorPodSpecStartupWi } @Test - public void whenNotConfigured_introspectorPodSpec_hasNullRuntimeClassName() { + void whenNotConfigured_introspectorPodSpec_hasNullRuntimeClassName() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -910,7 +910,7 @@ public void whenNotConfigured_introspectorPodSpec_hasNullRuntimeClassName() { } @Test - public void whenDomainHasImagePullSecretsConfigured_introspectorPodSpecStartupWithIt() { + void whenDomainHasImagePullSecretsConfigured_introspectorPodSpecStartupWithIt() { V1LocalObjectReference imagePullSecret = new V1LocalObjectReference().name("secret"); configureDomain().withDefaultImagePullSecrets(imagePullSecret); @@ -920,7 +920,7 @@ public void whenDomainHasImagePullSecretsConfigured_introspectorPodSpecStartupWi } @Test - public void whenNotConfigured_introspectorPodSpec_hasEmptyImagePullSecrets() { + void whenNotConfigured_introspectorPodSpec_hasEmptyImagePullSecrets() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -929,7 +929,7 @@ public void whenNotConfigured_introspectorPodSpec_hasEmptyImagePullSecrets() { } @Test - public void whenDomainHasPriorityClassNameConfigured_introspectorPodSpecStartupWithIt() { + void whenDomainHasPriorityClassNameConfigured_introspectorPodSpecStartupWithIt() { configureDomain().withPriorityClassName("MyPriorityClass"); V1JobSpec jobSpec = createJobSpec(); @@ -939,7 +939,7 @@ public void whenDomainHasPriorityClassNameConfigured_introspectorPodSpecStartupW } @Test - public void whenNotConfigured_introspectorPodSpec_hasNullPriorityClassName() { + void whenNotConfigured_introspectorPodSpec_hasNullPriorityClassName() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -948,7 +948,7 @@ public void whenNotConfigured_introspectorPodSpec_hasNullPriorityClassName() { } @Test - public void whenDomainHasTolerationsConfigured_introspectorPodSpecStartupWithThem() { + void whenDomainHasTolerationsConfigured_introspectorPodSpecStartupWithThem() { configureDomain().withToleration(toleration); V1JobSpec jobSpec = createJobSpec(); @@ -958,7 +958,7 @@ public void whenDomainHasTolerationsConfigured_introspectorPodSpecStartupWithThe } @Test - public void whenNotConfigured_introspectorPodSpec_hasNullTolerations() { + void whenNotConfigured_introspectorPodSpec_hasNullTolerations() { V1JobSpec jobSpec = createJobSpec(); assertThat( @@ -967,7 +967,7 @@ public void whenNotConfigured_introspectorPodSpec_hasNullTolerations() { } @Test - public void whenDomainHasHttpAccessLogInLogHomeConfigured_introspectorPodSpecStartupWithIt() { + void whenDomainHasHttpAccessLogInLogHomeConfigured_introspectorPodSpecStartupWithIt() { configureDomain().withHttpAccessLogInLogHome(false); V1JobSpec jobSpec = createJobSpec(); @@ -977,7 +977,7 @@ public void whenDomainHasHttpAccessLogInLogHomeConfigured_introspectorPodSpecSta } @Test - public void whenNotConfigured_introspectorPodSpec_hasTrueAccessLogInLogHomeEnvVar() { + void whenNotConfigured_introspectorPodSpec_hasTrueAccessLogInLogHomeEnvVar() { V1JobSpec jobSpec = createJobSpec(); assertThat(getMatchingContainerEnv(domainPresenceInfo, jobSpec), @@ -986,7 +986,7 @@ public void whenNotConfigured_introspectorPodSpec_hasTrueAccessLogInLogHomeEnvVa } @Test - public void whenNoExistingTopologyRunIntrospector() { + void whenNoExistingTopologyRunIntrospector() { runCreateJob(); assertThat(job, notNullValue()); @@ -998,7 +998,7 @@ private void runCreateJob() { } @Test - public void whenTopologyExistsAndNothingChanged_dontRunIntrospector() { + void whenTopologyExistsAndNothingChanged_dontRunIntrospector() { defineTopology(); runCreateJob(); @@ -1007,7 +1007,7 @@ public void whenTopologyExistsAndNothingChanged_dontRunIntrospector() { } @Test - public void whenIntrospectNotRequested_dontRunIntrospector() { + void whenIntrospectNotRequested_dontRunIntrospector() { defineTopology(); runCreateJob(); @@ -1016,7 +1016,7 @@ public void whenIntrospectNotRequested_dontRunIntrospector() { } @Test - public void whenIntrospectRequestSet_runIntrospector() { + void whenIntrospectRequestSet_runIntrospector() { defineTopology(); testSupport.addToPacket(ProcessingConstants.DOMAIN_INTROSPECT_REQUESTED, "123"); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/KubernetesTestSupportTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/KubernetesTestSupportTest.java index ceb90220133..8408530faaf 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/KubernetesTestSupportTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/KubernetesTestSupportTest.java @@ -70,7 +70,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public class KubernetesTestSupportTest { +class KubernetesTestSupportTest { private static final String NS = "namespace1"; private static final String POD_LOG_CONTENTS = "asdfghjkl"; @@ -94,7 +94,7 @@ public void tearDown() throws Exception { // tests for non-namespaced resources @Test - public void afterCreateCrd_crdExists() { + void afterCreateCrd_crdExists() { V1CustomResourceDefinition crd = createCrd("mycrd"); TestResponseStep responseStep = new TestResponseStep<>(); @@ -104,7 +104,7 @@ public void afterCreateCrd_crdExists() { } @Test - public void afterCreateCrd_incrementNumCalls() { + void afterCreateCrd_incrementNumCalls() { V1CustomResourceDefinition crd = createCrd("mycrd"); TestResponseStep responseStep = new TestResponseStep<>(); @@ -119,7 +119,7 @@ private V1CustomResourceDefinition createCrd(String name) { } @Test - public void afterCreateCrd_crdReturnedInCallResponse() { + void afterCreateCrd_crdReturnedInCallResponse() { V1CustomResourceDefinition crd = createCrd("mycrd"); TestResponseStep responseStep = new TestResponseStep<>(); @@ -129,7 +129,7 @@ public void afterCreateCrd_crdReturnedInCallResponse() { } @Test - public void whenCrdWithSameNameExists_createFails() { + void whenCrdWithSameNameExists_createFails() { testSupport.defineResources(createCrd("mycrd")); TestResponseStep responseStep = new TestResponseStep<>(); @@ -141,7 +141,7 @@ public void whenCrdWithSameNameExists_createFails() { } @Test - public void afterReplaceExistingCrd_crdExists() { + void afterReplaceExistingCrd_crdExists() { V1CustomResourceDefinition oldCrd = createCrd("mycrd"); testSupport.defineResources(oldCrd); @@ -156,7 +156,7 @@ public void afterReplaceExistingCrd_crdExists() { } @Test - public void afterReplaceDomainWithTimeStampEnabled_timeStampIsChanged() { + void afterReplaceDomainWithTimeStampEnabled_timeStampIsChanged() { Domain originalDomain = createDomain(NS, "domain1"); testSupport.defineResources(originalDomain); testSupport.setAddCreationTimestamp(true); @@ -170,7 +170,7 @@ public void afterReplaceDomainWithTimeStampEnabled_timeStampIsChanged() { } @Test - public void afterReplaceDomainWithTimeStampDisabled_timeStampIsNotChanged() { + void afterReplaceDomainWithTimeStampDisabled_timeStampIsNotChanged() { Domain originalDomain = createDomain(NS, "domain1"); testSupport.defineResources(originalDomain); @@ -183,7 +183,7 @@ public void afterReplaceDomainWithTimeStampDisabled_timeStampIsNotChanged() { } @Test - public void afterDomainStatusReplaced_resourceVersionIsIncremented() { + void afterDomainStatusReplaced_resourceVersionIsIncremented() { Domain originalDomain = createDomain(NS, "domain1"); testSupport.defineResources(originalDomain); originalDomain.getMetadata().setResourceVersion("123"); @@ -200,7 +200,7 @@ public void afterDomainStatusReplaced_resourceVersionIsIncremented() { } @Test - public void afterPatchDomainWithTimeStampEnabled_timeStampIsNotChanged() { + void afterPatchDomainWithTimeStampEnabled_timeStampIsNotChanged() { Domain originalDomain = createDomain(NS, "domain1"); testSupport.defineResources(originalDomain); testSupport.setAddCreationTimestamp(true); @@ -216,7 +216,7 @@ public void afterPatchDomainWithTimeStampEnabled_timeStampIsNotChanged() { } @Test - public void afterPatchDomainAsynchronously_statusIsUnchanged() { + void afterPatchDomainAsynchronously_statusIsUnchanged() { Domain originalDomain = createDomain(NS, "domain").withStatus(new DomainStatus().withMessage("leave this")); testSupport.defineResources(originalDomain); @@ -231,7 +231,7 @@ public void afterPatchDomainAsynchronously_statusIsUnchanged() { } @Test - public void afterPatchDomainSynchronously_statusIsUnchanged() throws ApiException { + void afterPatchDomainSynchronously_statusIsUnchanged() throws ApiException { Domain originalDomain = createDomain(NS, "domain").withStatus(new DomainStatus().withMessage("leave this")); testSupport.defineResources(originalDomain); @@ -249,7 +249,7 @@ private V1Patch getPatchBody(JsonPatchBuilder patchBuilder) { } @Test - public void afterReplaceDomainAsync_statusIsUnchanged() { + void afterReplaceDomainAsync_statusIsUnchanged() { Domain originalDomain = createDomain(NS, "domain1").withStatus(new DomainStatus().withMessage("leave this")); testSupport.defineResources(originalDomain); @@ -268,7 +268,7 @@ public void afterReplaceDomainAsync_statusIsUnchanged() { } @Test - public void afterReplaceDomainStatusAsync_specIsUnchanged() { + void afterReplaceDomainStatusAsync_specIsUnchanged() { Domain originalDomain = createDomain(NS, "domain1").withSpec(new DomainSpec().withReplicas(5)); testSupport.defineResources(originalDomain); @@ -281,7 +281,7 @@ public void afterReplaceDomainStatusAsync_specIsUnchanged() { } @Test - public void afterReplaceDomainStatusSynchronously_specIsUnchanged() throws ApiException { + void afterReplaceDomainStatusSynchronously_specIsUnchanged() throws ApiException { Domain originalDomain = createDomain(NS, "domain1").withSpec(new DomainSpec().withReplicas(5)); testSupport.defineResources(originalDomain); @@ -297,7 +297,7 @@ private OffsetDateTime getCreationTimestamp(Domain domain) { } @Test - public void afterCreateTokenReview_tokenReviewExists() throws ApiException { + void afterCreateTokenReview_tokenReviewExists() throws ApiException { V1TokenReview tokenReview = new V1TokenReview().metadata(new V1ObjectMeta().name("tr")); new CallBuilder().createTokenReview(tokenReview); @@ -306,7 +306,7 @@ public void afterCreateTokenReview_tokenReviewExists() throws ApiException { } @Test - public void whenHttpErrorNotAssociatedWithResource_dontThrowException() throws ApiException { + void whenHttpErrorNotAssociatedWithResource_dontThrowException() throws ApiException { testSupport.failOnResource(TOKEN_REVIEW, "tr2", HTTP_BAD_REQUEST); V1TokenReview tokenReview = new V1TokenReview().metadata(new V1ObjectMeta().name("tr")); @@ -314,7 +314,7 @@ public void whenHttpErrorNotAssociatedWithResource_dontThrowException() throws A } @Test - public void whenHttpErrorAssociatedWithResource_throwException() { + void whenHttpErrorAssociatedWithResource_throwException() { testSupport.failOnResource(TOKEN_REVIEW, "tr", HTTP_BAD_REQUEST); V1TokenReview tokenReview = new V1TokenReview().metadata(new V1ObjectMeta().name("tr")); @@ -322,7 +322,7 @@ public void whenHttpErrorAssociatedWithResource_throwException() { } @Test - public void afterCreateSubjectAccessReview_subjectAccessReviewExists() throws ApiException { + void afterCreateSubjectAccessReview_subjectAccessReviewExists() throws ApiException { V1SubjectAccessReview sar = new V1SubjectAccessReview().metadata(new V1ObjectMeta().name("rr")); new CallBuilder().createSubjectAccessReview(sar); @@ -333,7 +333,7 @@ public void afterCreateSubjectAccessReview_subjectAccessReviewExists() throws Ap // tests for namespaced resources @Test - public void afterCreatePod_podExists() { + void afterCreatePod_podExists() { V1Pod pod = createPod(NS, "mycrd"); TestResponseStep responseStep = new TestResponseStep<>(); @@ -347,7 +347,7 @@ private V1Pod createPod(String namespace, String name) { } @Test - public void afterCreatePodsWithSameNameAndDifferentNamespaces_bothExist() { + void afterCreatePodsWithSameNameAndDifferentNamespaces_bothExist() { V1Pod pod1 = createPod("ns1", "mycrd"); V1Pod pod2 = createPod("ns2", "mycrd"); @@ -359,7 +359,7 @@ public void afterCreatePodsWithSameNameAndDifferentNamespaces_bothExist() { } @Test - public void afterDeletePod_podsInDifferentNamespacesStillExist() { + void afterDeletePod_podsInDifferentNamespacesStillExist() { V1Pod pod1 = createPod("ns1", "mycrd"); V1Pod pod2 = createPod("ns2", "mycrd"); V1Pod pod3 = createPod("ns3", "another"); @@ -372,7 +372,7 @@ public void afterDeletePod_podsInDifferentNamespacesStillExist() { } @Test - public void whenHttpErrorAssociatedWithResource_callResponseIsError() { + void whenHttpErrorAssociatedWithResource_callResponseIsError() { testSupport.failOnResource(POD, "pod1", "ns2", HTTP_BAD_REQUEST); TestResponseStep responseStep = new TestResponseStep<>(); @@ -383,7 +383,7 @@ public void whenHttpErrorAssociatedWithResource_callResponseIsError() { } @Test - public void whenHttpErrorNotAssociatedWithResource_ignoreIt() { + void whenHttpErrorNotAssociatedWithResource_ignoreIt() { testSupport.failOnResource(POD, "pod1", "ns2", HTTP_BAD_REQUEST); TestResponseStep responseStep = new TestResponseStep<>(); @@ -391,7 +391,7 @@ public void whenHttpErrorNotAssociatedWithResource_ignoreIt() { } @Test - public void listPodSelectsByLabel() { + void listPodSelectsByLabel() { V1Pod pod1 = createLabeledPod("pod1", "ns1", ImmutableMap.of("k1", "v1", "k2", "v2")); V1Pod pod2 = createLabeledPod("pod2", "ns1", ImmutableMap.of("k1", "v2")); V1Pod pod3 = createLabeledPod("pod3", "ns1", ImmutableMap.of("k1", "v1", "k2", "v3")); @@ -410,7 +410,7 @@ private V1Pod createLabeledPod(String name, String namespace, Map endStep = new TestResponseStep<>(); testSupport.runSteps(new CallBuilder().readConfigMapAsync("", "", "", endStep)); @@ -532,7 +532,7 @@ public void whenConfigMapNotFound_readStatusIsNotFound() { } @Test - public void whenDefined_readPodLog() { + void whenDefined_readPodLog() { TestResponseStep endStep = new TestResponseStep<>(); testSupport.definePodLog("name", "namespace", POD_LOG_CONTENTS); @@ -542,7 +542,7 @@ public void whenDefined_readPodLog() { } @Test - public void deleteNamespace_deletesAllMatchingNamespacedResources() { + void deleteNamespace_deletesAllMatchingNamespacedResources() { Domain dom1 = createDomain("ns1", "domain1"); Domain dom2 = createDomain("ns2", "domain2"); V1Service s1 = createService("ns1", "service1"); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/KubernetesUtilsTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/KubernetesUtilsTest.java index f98bfbe4890..86c9ae390e6 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/KubernetesUtilsTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/KubernetesUtilsTest.java @@ -13,14 +13,14 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class KubernetesUtilsTest { +class KubernetesUtilsTest { private static final OffsetDateTime startTime = SystemClock.now(); private static final OffsetDateTime time1 = startTime.plusSeconds(1); private static final OffsetDateTime time2 = startTime.plusSeconds(2); @Test - public void whenCreationTimesDiffer_metadataWithLaterTimeIsNewer() { + void whenCreationTimesDiffer_metadataWithLaterTimeIsNewer() { V1ObjectMeta meta1 = new V1ObjectMeta().creationTimestamp(time2).resourceVersion("2"); V1ObjectMeta meta2 = new V1ObjectMeta().creationTimestamp(time1).resourceVersion("1"); @@ -29,7 +29,7 @@ public void whenCreationTimesDiffer_metadataWithLaterTimeIsNewer() { } @Test - public void whenCreationTimesMatch_metadataWithHigherResourceVersionIsNewer() { + void whenCreationTimesMatch_metadataWithHigherResourceVersionIsNewer() { V1ObjectMeta meta1 = new V1ObjectMeta().creationTimestamp(time1).resourceVersion("2"); V1ObjectMeta meta2 = new V1ObjectMeta().creationTimestamp(time1).resourceVersion("1"); @@ -38,7 +38,7 @@ public void whenCreationTimesMatch_metadataWithHigherResourceVersionIsNewer() { } @Test - public void whenCreationTimesAndResourceVersionsMatch_neitherIsNewer() { + void whenCreationTimesAndResourceVersionsMatch_neitherIsNewer() { V1ObjectMeta meta1 = new V1ObjectMeta().creationTimestamp(time1).resourceVersion("2"); V1ObjectMeta meta2 = new V1ObjectMeta().creationTimestamp(time1).resourceVersion("2"); @@ -47,7 +47,7 @@ public void whenCreationTimesAndResourceVersionsMatch_neitherIsNewer() { } @Test - public void whenHaveLargeResourceVersionsAndSameTime_succeedIsFirstNewer() { + void whenHaveLargeResourceVersionsAndSameTime_succeedIsFirstNewer() { OffsetDateTime now = SystemClock.now(); // This needs to be a value bigger than 2147483647 @@ -61,7 +61,7 @@ public void whenHaveLargeResourceVersionsAndSameTime_succeedIsFirstNewer() { } @Test - public void whenHaveNonParsableResourceVersionsAndSameTime_succeedIsFirstNewer() { + void whenHaveNonParsableResourceVersionsAndSameTime_succeedIsFirstNewer() { OffsetDateTime now = SystemClock.now(); String resVersion = "ThisIsNotANumber"; @@ -74,7 +74,7 @@ public void whenHaveNonParsableResourceVersionsAndSameTime_succeedIsFirstNewer() } @Test - public void whenHaveSmallResourceVersion_parseCorrectly() { + void whenHaveSmallResourceVersion_parseCorrectly() { String resVersion = "1"; BigInteger bigInteger = KubernetesUtils.getResourceVersion(resVersion); @@ -82,13 +82,13 @@ public void whenHaveSmallResourceVersion_parseCorrectly() { } @Test - public void whenHaveNullResourceVersion_parseCorrectly() { + void whenHaveNullResourceVersion_parseCorrectly() { BigInteger bigInteger = KubernetesUtils.getResourceVersion((String) null); assertThat(bigInteger, is(BigInteger.ZERO)); } @Test - public void whenHaveOpaqueResourceVersion_parseCorrectly() { + void whenHaveOpaqueResourceVersion_parseCorrectly() { String resVersion = "123NotANumber456"; BigInteger bigInteger = KubernetesUtils.getResourceVersion(resVersion); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/LegalNamesTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/LegalNamesTest.java index 28701ed3e9f..5f4f3304bcf 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/LegalNamesTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/LegalNamesTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -public class LegalNamesTest { +class LegalNamesTest { private final List mementos = new ArrayList<>(); @@ -36,21 +36,21 @@ public void tearDown() { @Test - public void createValidServerServiceNames() { + void createValidServerServiceNames() { assertThat(toServerServiceName("abc", "cls1"), equalTo("abc-cls1")); assertThat(toServerServiceName("Abc", "cLs1"), equalTo("abc-cls1")); assertThat(toServerServiceName("Abc", "cls_1"), equalTo("abc-cls-1")); } @Test - public void createValidClusterServiceNames() { + void createValidClusterServiceNames() { assertThat(toClusterServiceName("abc", "cls1"), equalTo("abc-cluster-cls1")); assertThat(toClusterServiceName("Abc", "cLs1"), equalTo("abc-cluster-cls1")); assertThat(toClusterServiceName("Abc", "cls_1"), equalTo("abc-cluster-cls-1")); } @Test - public void verify_requiresDns1123Names_returnsTrue_for_names_in_defaultList() { + void verify_requiresDns1123Names_returnsTrue_for_names_in_defaultList() { assertThat(LegalNames.isDns1123Required("ClaimName"), is(true)); assertThat(LegalNames.isDns1123Required("ClusterName"), is(true)); assertThat(LegalNames.isDns1123Required("ContainerName"), is(true)); @@ -73,7 +73,7 @@ public void verify_requiresDns1123Names_returnsTrue_for_names_in_defaultList() { } @Test - public void verify_requiresDns1123Names_returnFalse_for_names_not_in_list() { + void verify_requiresDns1123Names_returnFalse_for_names_not_in_list() { assertThat(LegalNames.isDns1123Required("DatasetName"), is(false)); assertThat(LegalNames.isDns1123Required("DiskName"), is(false)); assertThat(LegalNames.isDns1123Required("InitiatorName"), is(false)); @@ -84,13 +84,13 @@ public void verify_requiresDns1123Names_returnFalse_for_names_not_in_list() { } @Test - public void verify_requiresDns1123Names_returnFalse_for_invalidValues() { + void verify_requiresDns1123Names_returnFalse_for_invalidValues() { assertThat(LegalNames.isDns1123Required(null), is(false)); assertThat(LegalNames.isDns1123Required(""), is(false)); } @Test - public void verify_requiresDns1123Names_with_customList() { + void verify_requiresDns1123Names_with_customList() { String customList = "diskName, claimName"; TuningParameters.getInstance().put(DNS_1123_FIELDS_PARAM, customList); @@ -102,7 +102,7 @@ public void verify_requiresDns1123Names_with_customList() { } @Test - public void verify_requiresDns1123Names_return_true_with_emptyStringCustomList() { + void verify_requiresDns1123Names_return_true_with_emptyStringCustomList() { String customList = ""; TuningParameters.getInstance().put(DNS_1123_FIELDS_PARAM, customList); @@ -111,7 +111,7 @@ public void verify_requiresDns1123Names_return_true_with_emptyStringCustomList() } @Test - public void verify_requiresDns1123Names_return_true_with_singleSpaceCustomList() { + void verify_requiresDns1123Names_return_true_with_singleSpaceCustomList() { String customList = " "; TuningParameters.getInstance().put(DNS_1123_FIELDS_PARAM, customList); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/ManagedPodHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/ManagedPodHelperTest.java index cfbf9e000a8..a089668d622 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/ManagedPodHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/ManagedPodHelperTest.java @@ -75,7 +75,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; @SuppressWarnings("ConstantConditions") -public class ManagedPodHelperTest extends PodHelperTestBase { +class ManagedPodHelperTest extends PodHelperTestBase { private static final String SERVER_NAME = "ess_server1"; private static final int LISTEN_PORT = 8001; @@ -147,14 +147,14 @@ List createStartCommand() { } @Test - public void whenManagedPodCreated_containerHasStartServerCommand() { + void whenManagedPodCreated_containerHasStartServerCommand() { assertThat( getCreatedPodSpecContainer().getCommand(), contains("/weblogic-operator/scripts/startServer.sh")); } @Test - public void whenPacketHasEnvironmentItems_createManagedPodStartupWithThem() { + void whenPacketHasEnvironmentItems_createManagedPodStartupWithThem() { testSupport.addToPacket( ProcessingConstants.ENVVARS, Arrays.asList(toEnvVar(ITEM1, VALUE1), toEnvVar(ITEM2, VALUE2))); @@ -169,7 +169,7 @@ private V1EnvVar toEnvVar(String name, String value) { } @Test - public void whenPacketHasEnvironmentItemsWithVariables_createManagedPodStartupWithSubstitutedValues() { + void whenPacketHasEnvironmentItemsWithVariables_createManagedPodStartupWithSubstitutedValues() { testSupport.addToPacket( ProcessingConstants.ENVVARS, Arrays.asList(toEnvVar(ITEM1, RAW_VALUE_1), toEnvVar(ITEM2, RAW_VALUE_2), toEnvVar(ITEM3, RAW_VALUE_3))); @@ -180,7 +180,7 @@ public void whenPacketHasEnvironmentItemsWithVariables_createManagedPodStartupWi } @Test - public void whenPacketHasValueFromEnvironmentItems_createManagedPodStartupWithThem() { + void whenPacketHasValueFromEnvironmentItems_createManagedPodStartupWithThem() { V1EnvVar configMapKeyRefEnvVar = createConfigMapKeyRefEnvVar("VARIABLE1", "my-env", "VAR1"); V1EnvVar secretKeyRefEnvVar = createSecretKeyRefEnvVar("VARIABLE2", "my-secret", "VAR2"); V1EnvVar fieldRefEnvVar = createFieldRefEnvVar("MY_NODE_IP", "status.hostIP"); @@ -196,7 +196,7 @@ public void whenPacketHasValueFromEnvironmentItems_createManagedPodStartupWithTh } @Test - public void whenPacketHasValueFromEnvironmentItemsWithVariables_createManagedPodStartupWithSubstitutions() { + void whenPacketHasValueFromEnvironmentItemsWithVariables_createManagedPodStartupWithSubstitutions() { V1EnvVar configMapKeyRefEnvVar = createConfigMapKeyRefEnvVar(ITEM1, "my-env", RAW_VALUE_1); V1EnvVar secretKeyRefEnvVar = createSecretKeyRefEnvVar(ITEM2, "my-secret", RAW_VALUE_2); V1EnvVar fieldRefEnvVar = createFieldRefEnvVar(ITEM3, RAW_VALUE_3); @@ -216,7 +216,7 @@ public void whenPacketHasValueFromEnvironmentItemsWithVariables_createManagedPod } @Test - public void whenClusterHasAdditionalVolumesWithReservedVariables_createManagedPodWithSubstitutions() { + void whenClusterHasAdditionalVolumesWithReservedVariables_createManagedPodWithSubstitutions() { testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); getConfigurator() .configureCluster(CLUSTER_NAME) @@ -231,7 +231,7 @@ public void whenClusterHasAdditionalVolumesWithReservedVariables_createManagedPo } @Test - public void whenDomainHasAdditionalVolumesWithReservedVariables_createManagedPodWithSubstitutions() { + void whenDomainHasAdditionalVolumesWithReservedVariables_createManagedPodWithSubstitutions() { getConfigurator() .withAdditionalVolume("volume1", "/source-$(SERVER_NAME)") .withAdditionalVolume("volume2", "/source-$(DOMAIN_NAME)"); @@ -244,7 +244,7 @@ public void whenDomainHasAdditionalVolumesWithReservedVariables_createManagedPod } @Test - public void whenDomainHasAdditionalVolumesWithCustomVariables_createManagedPodWithSubstitutions() { + void whenDomainHasAdditionalVolumesWithCustomVariables_createManagedPodWithSubstitutions() { resourceLookup.defineResource(SECRET_NAME, KubernetesResourceType.Secret, NS); resourceLookup.defineResource(OVERRIDES_CM_NAME_MODEL, KubernetesResourceType.ConfigMap, NS); resourceLookup.defineResource(OVERRIDES_CM_NAME_IMAGE, KubernetesResourceType.ConfigMap, NS); @@ -266,7 +266,7 @@ public void whenDomainHasAdditionalVolumesWithCustomVariables_createManagedPodWi } @Test - public void whenDomainHasAdditionalVolumesWithCustomVariablesContainInvalidValue_reportValidationError() { + void whenDomainHasAdditionalVolumesWithCustomVariablesContainInvalidValue_reportValidationError() { resourceLookup.defineResource(SECRET_NAME, KubernetesResourceType.Secret, NS); resourceLookup.defineResource(OVERRIDES_CM_NAME_MODEL, KubernetesResourceType.ConfigMap, NS); resourceLookup.defineResource(OVERRIDES_CM_NAME_IMAGE, KubernetesResourceType.ConfigMap, NS); @@ -287,7 +287,7 @@ public void whenDomainHasAdditionalVolumesWithCustomVariablesContainInvalidValue } @Test - public void whenClusterHasLabelsWithVariables_createManagedPodWithSubstitutions() { + void whenClusterHasLabelsWithVariables_createManagedPodWithSubstitutions() { V1EnvVar envVar = toEnvVar("TEST_ENV", "test-value"); testSupport.addToPacket(ProcessingConstants.ENVVARS, Collections.singletonList(envVar)); @@ -319,7 +319,7 @@ public void whenClusterHasLabelsWithVariables_createManagedPodWithSubstitutions( } @Test - public void createManagedPodStartupWithNullAdminUsernamePasswordEnvVarsValues() { + void createManagedPodStartupWithNullAdminUsernamePasswordEnvVarsValues() { testSupport.addToPacket(ProcessingConstants.ENVVARS, Collections.emptyList()); assertThat( @@ -328,7 +328,7 @@ public void createManagedPodStartupWithNullAdminUsernamePasswordEnvVarsValues() } @Test - public void whenPacketHasEnvironmentItemsWithVariable_createManagedPodShouldNotChangeItsValue() { + void whenPacketHasEnvironmentItemsWithVariable_createManagedPodShouldNotChangeItsValue() { V1EnvVar envVar = toEnvVar(ITEM1, RAW_VALUE_1); testSupport.addToPacket(ProcessingConstants.ENVVARS, Collections.singletonList(envVar)); @@ -338,7 +338,7 @@ public void whenPacketHasEnvironmentItemsWithVariable_createManagedPodShouldNotC } @Test - public void whenPacketHasClusterConfig_managedPodHasClusterLabel() { + void whenPacketHasClusterConfig_managedPodHasClusterLabel() { testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); assertThat( @@ -347,7 +347,7 @@ public void whenPacketHasClusterConfig_managedPodHasClusterLabel() { } @Test - public void whenDomainHasAdditionalVolumesWithVariables_createManagedPodWithThem() { + void whenDomainHasAdditionalVolumesWithVariables_createManagedPodWithThem() { getConfigurator() .withAdditionalVolume("volume1", "/$(SERVER_NAME)/source-path1/") .withAdditionalVolume("volume2", "/$(SERVER_NAME)/source-path2/") @@ -362,7 +362,7 @@ public void whenDomainHasAdditionalVolumesWithVariables_createManagedPodWithThem } @Test - public void whenDomainHasAdditionalPvClaimVolumesWitVariables_createManagedPodWithThem() { + void whenDomainHasAdditionalPvClaimVolumesWitVariables_createManagedPodWithThem() { getConfigurator() .withAdditionalPvClaimVolume(RAW_VALUE_4, RAW_VALUE_3); @@ -372,7 +372,7 @@ public void whenDomainHasAdditionalPvClaimVolumesWitVariables_createManagedPodWi } @Test - public void whenDomainHasAdditionalVolumeMounts_createManagedPodWithThem() { + void whenDomainHasAdditionalVolumeMounts_createManagedPodWithThem() { getConfigurator() .withAdditionalVolumeMount("volume1", "/destination-path1") .withAdditionalVolumeMount("volume2", "/destination-path2"); @@ -384,7 +384,7 @@ public void whenDomainHasAdditionalVolumeMounts_createManagedPodWithThem() { } @Test - public void whenClusterHasAdditionalVolumes_createManagedPodWithThem() { + void whenClusterHasAdditionalVolumes_createManagedPodWithThem() { testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); getConfigurator() .configureCluster(CLUSTER_NAME) @@ -397,7 +397,7 @@ public void whenClusterHasAdditionalVolumes_createManagedPodWithThem() { } @Test - public void whenClusterHasAdditionalVolumeMounts_createManagedPodWithThem() { + void whenClusterHasAdditionalVolumeMounts_createManagedPodWithThem() { testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); getConfigurator() .configureCluster(CLUSTER_NAME) @@ -412,7 +412,7 @@ public void whenClusterHasAdditionalVolumeMounts_createManagedPodWithThem() { } @Test - public void whenServerHasAdditionalVolumes_createManagedPodWithThem() { + void whenServerHasAdditionalVolumes_createManagedPodWithThem() { configureServer(getConfigurator(), SERVER_NAME) .withAdditionalVolume("volume1", "/source-path1") .withAdditionalVolume("volume2", "/source-path2"); @@ -423,7 +423,7 @@ public void whenServerHasAdditionalVolumes_createManagedPodWithThem() { } @Test - public void whenServerHasAdditionalVolumeMounts_createManagedPodWithThem() { + void whenServerHasAdditionalVolumeMounts_createManagedPodWithThem() { configureServer(getConfigurator(), SERVER_NAME) .withAdditionalVolumeMount("volume1", "/destination-path1") .withAdditionalVolumeMount("volume2", "/destination-path2"); @@ -436,7 +436,7 @@ public void whenServerHasAdditionalVolumeMounts_createManagedPodWithThem() { } @Test - public void whenPodHasDuplicateVolumes_createManagedPodWithCombination() { + void whenPodHasDuplicateVolumes_createManagedPodWithCombination() { getConfigurator() .withAdditionalVolume("volume1", "/domain-path1") .withAdditionalVolume("volume2", "/domain-path2") @@ -458,7 +458,7 @@ public void whenPodHasDuplicateVolumes_createManagedPodWithCombination() { } @Test - public void whenPodHasDuplicateVolumeMounts_createManagedPodWithCombination() { + void whenPodHasDuplicateVolumeMounts_createManagedPodWithCombination() { getConfigurator() .withAdditionalVolumeMount("volume1", "/domain-path1") .withAdditionalVolumeMount("volume2", "/domain-path2") @@ -480,21 +480,21 @@ public void whenPodHasDuplicateVolumeMounts_createManagedPodWithCombination() { } @Test - public void whenDesiredStateIsAdmin_createPodWithStartupModeEnvironment() { + void whenDesiredStateIsAdmin_createPodWithStartupModeEnvironment() { getConfigurator().withServerStartState(ADMIN_STATE); assertThat(getCreatedPodSpecContainer().getEnv(), hasEnvVar("STARTUP_MODE", ADMIN_STATE)); } @Test - public void whenServerDesiredStateIsAdmin_createPodWithStartupModeEnvironment() { + void whenServerDesiredStateIsAdmin_createPodWithStartupModeEnvironment() { getConfigurator().configureServer(SERVER_NAME).withServerStartState(ADMIN_STATE); assertThat(getCreatedPodSpecContainer().getEnv(), hasEnvVar("STARTUP_MODE", ADMIN_STATE)); } @Test - public void whenDesiredStateIsRunningServerIsAdmin_createPodWithStartupModeEnvironment() { + void whenDesiredStateIsRunningServerIsAdmin_createPodWithStartupModeEnvironment() { getConfigurator() .withServerStartState(RUNNING_STATE) .configureServer(SERVER_NAME) @@ -504,7 +504,7 @@ public void whenDesiredStateIsRunningServerIsAdmin_createPodWithStartupModeEnvir } @Test - public void whenDesiredStateIsAdminServerIsRunning_createPodWithStartupModeEnvironment() { + void whenDesiredStateIsAdminServerIsRunning_createPodWithStartupModeEnvironment() { getConfigurator() .withServerStartState(ADMIN_STATE) .configureServer(SERVER_NAME) @@ -514,7 +514,7 @@ public void whenDesiredStateIsAdminServerIsRunning_createPodWithStartupModeEnvir } @Test - public void whenClusterDesiredStateIsAdmin_createPodWithStartupModeEnvironment() { + void whenClusterDesiredStateIsAdmin_createPodWithStartupModeEnvironment() { getConfigurator().configureServer(SERVER_NAME); testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); @@ -524,7 +524,7 @@ public void whenClusterDesiredStateIsAdmin_createPodWithStartupModeEnvironment() } @Test - public void whenClusterDesiredStateIsRunningServerIsAdmin_createPodWithStartupModeEnvironment() { + void whenClusterDesiredStateIsRunningServerIsAdmin_createPodWithStartupModeEnvironment() { getConfigurator().configureServer(SERVER_NAME).withServerStartState(ADMIN_STATE); testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); @@ -534,7 +534,7 @@ public void whenClusterDesiredStateIsRunningServerIsAdmin_createPodWithStartupMo } @Test - public void whenClusterDesiredStateIsAdminServerIsRunning_createPodWithStartupModeEnvironment() { + void whenClusterDesiredStateIsAdminServerIsRunning_createPodWithStartupModeEnvironment() { getConfigurator().configureServer(SERVER_NAME).withServerStartState(RUNNING_STATE); testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); @@ -545,7 +545,7 @@ public void whenClusterDesiredStateIsAdminServerIsRunning_createPodWithStartupMo } @Test - public void whenDomainHasInitContainers_createPodWithThem() { + void whenDomainHasInitContainers_createPodWithThem() { getConfigurator() .withInitContainer( createContainer( @@ -560,7 +560,7 @@ public void whenDomainHasInitContainers_createPodWithThem() { } @Test - public void whenServerHasInitContainers_createPodWithThem() { + void whenServerHasInitContainers_createPodWithThem() { getConfigurator() .configureServer(SERVER_NAME) .withInitContainer( @@ -576,7 +576,7 @@ public void whenServerHasInitContainers_createPodWithThem() { } @Test - public void whenInitContainersHaveEnvVar_verifyInitContainersAfterPopulatingEnvStillHaveOriginalEnvVar() { + void whenInitContainersHaveEnvVar_verifyInitContainersAfterPopulatingEnvStillHaveOriginalEnvVar() { V1EnvVar envVar = toEnvVar(ITEM1, END_VALUE_1); List envVars = new ArrayList<>(); envVars.add(envVar); @@ -598,7 +598,7 @@ public void whenInitContainersHaveEnvVar_verifyInitContainersAfterPopulatingEnvS } @Test - public void whenInitContainersHaveEnvVar_verifyInitContainersEnvVarTakesPrecedenceOverPreConfiguredEnvVar() { + void whenInitContainersHaveEnvVar_verifyInitContainersEnvVarTakesPrecedenceOverPreConfiguredEnvVar() { V1EnvVar envVar = toEnvVar("DOMAIN_NAME", "LOCAL_DOMAIN_NAME"); List envVars = new ArrayList<>(); envVars.add(envVar); @@ -620,7 +620,7 @@ public void whenInitContainersHaveEnvVar_verifyInitContainersEnvVarTakesPreceden } @Test - public void whenServerWithEnvVarHasInitContainers_verifyInitContainersHaveEnvVar() { + void whenServerWithEnvVarHasInitContainers_verifyInitContainersHaveEnvVar() { V1EnvVar envVar = toEnvVar(ITEM1, END_VALUE_1); testSupport.addToPacket(ProcessingConstants.ENVVARS, Collections.singletonList(envVar)); @@ -643,7 +643,7 @@ public void whenServerWithEnvVarHasInitContainers_verifyInitContainersHaveEnvVar } @Test - public void whenServerHasDuplicateInitContainers_createPodWithCombination() { + void whenServerHasDuplicateInitContainers_createPodWithCombination() { getConfigurator() .withInitContainer( createContainer( @@ -660,7 +660,7 @@ public void whenServerHasDuplicateInitContainers_createPodWithCombination() { } @Test - public void whenClusterHasInitContainers_createPodWithThem() { + void whenClusterHasInitContainers_createPodWithThem() { getConfigurator() .configureCluster(CLUSTER_NAME) .withInitContainer( @@ -677,7 +677,7 @@ public void whenClusterHasInitContainers_createPodWithThem() { } @Test - public void whenServerAndClusterHasDuplicateInitContainers_createPodWithCombination() { + void whenServerAndClusterHasDuplicateInitContainers_createPodWithCombination() { getConfigurator() .withInitContainer( createContainer( @@ -701,7 +701,7 @@ public void whenServerAndClusterHasDuplicateInitContainers_createPodWithCombinat } @Test - public void whenDomainHasContainers_createPodWithThem() { + void whenDomainHasContainers_createPodWithThem() { getConfigurator() .withContainer( createContainer( @@ -716,7 +716,7 @@ public void whenDomainHasContainers_createPodWithThem() { } @Test - public void whenServerHasContainers_createPodWithThem() { + void whenServerHasContainers_createPodWithThem() { getConfigurator() .configureServer(SERVER_NAME) .withContainer( @@ -732,7 +732,7 @@ public void whenServerHasContainers_createPodWithThem() { } @Test - public void whenServerHasDuplicateContainers_createPodWithCombination() { + void whenServerHasDuplicateContainers_createPodWithCombination() { getConfigurator() .withContainer( createContainer( @@ -749,7 +749,7 @@ public void whenServerHasDuplicateContainers_createPodWithCombination() { } @Test - public void whenClusterHasContainers_createPodWithThem() { + void whenClusterHasContainers_createPodWithThem() { getConfigurator() .configureCluster(CLUSTER_NAME) .withContainer( @@ -766,7 +766,7 @@ public void whenClusterHasContainers_createPodWithThem() { } @Test - public void whenServerAndClusterHasDuplicateContainers_createPodWithCombination() { + void whenServerAndClusterHasDuplicateContainers_createPodWithCombination() { getConfigurator() .withContainer( createContainer( @@ -790,7 +790,7 @@ public void whenServerAndClusterHasDuplicateContainers_createPodWithCombination( } @Test - public void whenDomainHasLabels_createManagedPodWithThem() { + void whenDomainHasLabels_createManagedPodWithThem() { getConfigurator() .withPodLabel("label1", "domain-label-value1") .withPodLabel("label2", "domain-label-value2"); @@ -801,7 +801,7 @@ public void whenDomainHasLabels_createManagedPodWithThem() { } @Test - public void whenDomainHasAnnotations_createManagedPodWithThem() { + void whenDomainHasAnnotations_createManagedPodWithThem() { getConfigurator() .withPodAnnotation("annotation1", "domain-annotation-value1") .withPodAnnotation("annotation2", "domain-annotation-value2"); @@ -811,7 +811,7 @@ public void whenDomainHasAnnotations_createManagedPodWithThem() { } @Test - public void whenClusterHasLabels_createManagedPodWithThem() { + void whenClusterHasLabels_createManagedPodWithThem() { testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); getConfigurator() .configureCluster(CLUSTER_NAME) @@ -824,7 +824,7 @@ public void whenClusterHasLabels_createManagedPodWithThem() { } @Test - public void whenClusterHasRestartVersion_createManagedPodWithRestartVersionLabel() { + void whenClusterHasRestartVersion_createManagedPodWithRestartVersionLabel() { testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); getConfigurator().configureCluster(CLUSTER_NAME).withRestartVersion("clusterRestartV1"); @@ -835,7 +835,7 @@ public void whenClusterHasRestartVersion_createManagedPodWithRestartVersionLabel } @Test - public void whenDomainHasRestartVersion_createManagedPodWithRestartVersionLabel() { + void whenDomainHasRestartVersion_createManagedPodWithRestartVersionLabel() { testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); getConfigurator().withRestartVersion("domainRestartV1"); @@ -846,7 +846,7 @@ public void whenDomainHasRestartVersion_createManagedPodWithRestartVersionLabel( } @Test - public void whenClusterHasAnnotations_createManagedPodWithThem() { + void whenClusterHasAnnotations_createManagedPodWithThem() { testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); getConfigurator() .configureCluster(CLUSTER_NAME) @@ -859,7 +859,7 @@ public void whenClusterHasAnnotations_createManagedPodWithThem() { } @Test - public void whenServerHasLabels_createManagedPodWithThem() { + void whenServerHasLabels_createManagedPodWithThem() { configureServer(getConfigurator(), SERVER_NAME) .withPodLabel("label1", "server-label-value1") .withPodLabel("label2", "server-label-value2"); @@ -870,7 +870,7 @@ public void whenServerHasLabels_createManagedPodWithThem() { } @Test - public void whenServerHasAnnotations_createManagedPodWithThem() { + void whenServerHasAnnotations_createManagedPodWithThem() { configureServer(getConfigurator(), SERVER_NAME) .withPodAnnotation("annotation1", "server-annotation-value1") .withPodAnnotation("annotation2", "server-annotation-value2"); @@ -881,7 +881,7 @@ public void whenServerHasAnnotations_createManagedPodWithThem() { } @Test - public void whenPodHasDuplicateLabels_createManagedPodWithCombination() { + void whenPodHasDuplicateLabels_createManagedPodWithCombination() { getConfigurator() .withPodLabel("label1", "domain-label-value1") .withPodLabel("label2", "domain-label-value2") @@ -902,7 +902,7 @@ public void whenPodHasDuplicateLabels_createManagedPodWithCombination() { } @Test - public void whenPodHasDuplicateAnnotations_createManagedPodWithCombination() { + void whenPodHasDuplicateAnnotations_createManagedPodWithCombination() { getConfigurator() .withPodAnnotation("annotation1", "domain-annotation-value1") .withPodAnnotation("annotation2", "domain-annotation-value2") @@ -923,7 +923,7 @@ public void whenPodHasDuplicateAnnotations_createManagedPodWithCombination() { } @Test - public void whenPodHasCustomLabelConflictWithInternal_createManagedPodWithInternal() { + void whenPodHasCustomLabelConflictWithInternal_createManagedPodWithInternal() { getConfigurator() .configureServer((SERVER_NAME)) .withPodLabel(LabelConstants.CREATEDBYOPERATOR_LABEL, "server-label-value1"); @@ -933,7 +933,7 @@ public void whenPodHasCustomLabelConflictWithInternal_createManagedPodWithIntern } @Test - public void whenClusterHasAffinity_createPodWithIt() { + void whenClusterHasAffinity_createPodWithIt() { getConfigurator().configureCluster(CLUSTER_NAME).withAffinity(affinity); testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); @@ -941,7 +941,7 @@ public void whenClusterHasAffinity_createPodWithIt() { } @Test - public void whenClusterHasNodeSelector_createPodWithIt() { + void whenClusterHasNodeSelector_createPodWithIt() { getConfigurator() .configureCluster(CLUSTER_NAME) .withNodeSelector("os_arch", "x86_64"); @@ -953,7 +953,7 @@ public void whenClusterHasNodeSelector_createPodWithIt() { } @Test - public void whenClusterHasNodeName_createPodWithIt() { + void whenClusterHasNodeName_createPodWithIt() { getConfigurator() .configureCluster(CLUSTER_NAME) .withNodeName("kube-01"); @@ -965,7 +965,7 @@ public void whenClusterHasNodeName_createPodWithIt() { } @Test - public void whenClusterHasSchedulerName_createPodWithIt() { + void whenClusterHasSchedulerName_createPodWithIt() { getConfigurator() .configureCluster(CLUSTER_NAME) .withSchedulerName("my-scheduler"); @@ -977,7 +977,7 @@ public void whenClusterHasSchedulerName_createPodWithIt() { } @Test - public void whenClusterHasRuntimeClassName_createPodWithIt() { + void whenClusterHasRuntimeClassName_createPodWithIt() { getConfigurator() .configureCluster(CLUSTER_NAME) .withRuntimeClassName("RuntimeClassName"); @@ -989,7 +989,7 @@ public void whenClusterHasRuntimeClassName_createPodWithIt() { } @Test - public void whenClusterHasPriorityClassName_createPodWithIt() { + void whenClusterHasPriorityClassName_createPodWithIt() { getConfigurator() .configureCluster(CLUSTER_NAME) .withPriorityClassName("PriorityClassName"); @@ -1001,7 +1001,7 @@ public void whenClusterHasPriorityClassName_createPodWithIt() { } @Test - public void whenClusterHasRestartPolicy_createPodWithIt() { + void whenClusterHasRestartPolicy_createPodWithIt() { getConfigurator() .configureCluster(CLUSTER_NAME) .withRestartPolicy("Always"); @@ -1013,7 +1013,7 @@ public void whenClusterHasRestartPolicy_createPodWithIt() { } @Test - public void whenClusterHasPodSecurityContext_createPodWithIt() { + void whenClusterHasPodSecurityContext_createPodWithIt() { getConfigurator() .configureCluster(CLUSTER_NAME) .withPodSecurityContext(podSecurityContext); @@ -1025,7 +1025,7 @@ public void whenClusterHasPodSecurityContext_createPodWithIt() { } @Test - public void whenClusterHasContainerSecurityContext_createContainersWithIt() { + void whenClusterHasContainerSecurityContext_createContainersWithIt() { getConfigurator() .configureCluster(CLUSTER_NAME) .withContainerSecurityContext(containerSecurityContext); @@ -1038,7 +1038,7 @@ public void whenClusterHasContainerSecurityContext_createContainersWithIt() { } @Test - public void whenClusterHasResources_createContainersWithThem() { + void whenClusterHasResources_createContainersWithThem() { getConfigurator() .configureCluster(CLUSTER_NAME) .withLimitRequirement("cpu", "1Gi") @@ -1052,7 +1052,7 @@ public void whenClusterHasResources_createContainersWithThem() { } @Test - public void whenDomainAndClusterHaveAuxImages_createManagedPodsWithInitContainersInCorrectOrderAndVolumeMounts() { + void whenDomainAndClusterHaveAuxImages_createManagedPodsWithInitContainersInCorrectOrderAndVolumeMounts() { getConfigurator() .withAuxiliaryImageVolumes(getAuxiliaryImageVolume()) .withAuxiliaryImages(Collections.singletonList(getAuxiliaryImage("wdt-image:v1"))); @@ -1077,7 +1077,7 @@ public void whenDomainAndClusterHaveAuxImages_createManagedPodsWithInitContainer } @Test - public void whenClusterHasAuxiliaryImageAndVolumeHasMountPath_volumeMountsCreatedWithSpecifiedMountPath() { + void whenClusterHasAuxiliaryImageAndVolumeHasMountPath_volumeMountsCreatedWithSpecifiedMountPath() { getConfigurator() .withAuxiliaryImageVolumes(getAuxiliaryImageVolume(CUSTOM_MOUNT_PATH2)) .configureCluster(CLUSTER_NAME) @@ -1089,7 +1089,7 @@ public void whenClusterHasAuxiliaryImageAndVolumeHasMountPath_volumeMountsCreate } @Test - public void whenClusterHasAffinityWithVariables_createManagedPodWithSubstitutions() { + void whenClusterHasAffinityWithVariables_createManagedPodWithSubstitutions() { testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); getConfigurator() .configureCluster(CLUSTER_NAME) @@ -1123,7 +1123,7 @@ V1WeightedPodAffinityTerm createWeightedPodAffinityTerm(String key, String value } @Test - public void whenDomainAndClusterBothHaveAffinityWithVariables_createManagedPodWithSubstitutions() { + void whenDomainAndClusterBothHaveAffinityWithVariables_createManagedPodWithSubstitutions() { testSupport.addToPacket(ProcessingConstants.CLUSTER_NAME, CLUSTER_NAME); getConfigurator() .withAffinity( @@ -1248,7 +1248,7 @@ private static V1Pod createManagedServerPodModel(Packet packet) { } @Test - public void whenPodCreated_containerHasTwoPortsForSip() { + void whenPodCreated_containerHasTwoPortsForSip() { addSipPorts(); V1Container v1Container = getCreatedPodSpecContainer(); @@ -1269,7 +1269,7 @@ void addSipPorts() { } @Test - public void whenPodCreated_containerHasTwoPortsForSips() { + void whenPodCreated_containerHasTwoPortsForSips() { addSipPorts(); V1Container v1Container = getCreatedPodSpecContainer(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/ManagerServerServiceHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/ManagerServerServiceHelperTest.java index 2c86b52460f..188fddf2cf2 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/ManagerServerServiceHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/ManagerServerServiceHelperTest.java @@ -13,7 +13,7 @@ import static oracle.kubernetes.operator.logging.MessageKeys.MANAGED_SERVICE_REPLACED; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class ManagerServerServiceHelperTest extends ServiceHelperTest { +class ManagerServerServiceHelperTest extends ServiceHelperTest { public ManagerServerServiceHelperTest() { super(new ManagedServerTestFacade()); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/NamespaceHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/NamespaceHelperTest.java index caedbdd941c..364f7b99522 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/NamespaceHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/NamespaceHelperTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class NamespaceHelperTest { +class NamespaceHelperTest { private final KubernetesTestSupport testSupport = new KubernetesTestSupport(); private final List mementos = new ArrayList<>(); @@ -36,34 +36,34 @@ public void tearDown() { } @Test - public void whenGivenEmptyString_parseNamespaceReturnsDefault() { + void whenGivenEmptyString_parseNamespaceReturnsDefault() { assertThat(parseNamespaceList(""), contains(DEFAULT_NAMESPACE)); } @Test - public void whenGivenNonEmptyString_parseNamespaceDoesNotReturnDefault() { + void whenGivenNonEmptyString_parseNamespaceDoesNotReturnDefault() { assertThat(parseNamespaceList("dev-domain"), not(contains(DEFAULT_NAMESPACE))); } @Test - public void whenGivenSingleTarget_parseNamespaceReturnsIt() { + void whenGivenSingleTarget_parseNamespaceReturnsIt() { assertThat(parseNamespaceList("dev-domain"), contains("dev-domain")); } @Test - public void whenGivenMultipleTargets_parseNamespaceReturnsAll() { + void whenGivenMultipleTargets_parseNamespaceReturnsAll() { assertThat(parseNamespaceList("dev-domain,domain1,test-domain"), containsInAnyOrder("dev-domain", "domain1", "test-domain")); } @Test - public void whenStringContainsLeadingSpaces_removeThem() { + void whenStringContainsLeadingSpaces_removeThem() { assertThat(parseNamespaceList(" test-domain, dev-domain"), containsInAnyOrder("dev-domain", "test-domain")); } @Test - public void whenGivenTrailingSpaces_removeThem() { + void whenGivenTrailingSpaces_removeThem() { assertThat(parseNamespaceList("dev-domain ,test-domain "), containsInAnyOrder("dev-domain", "test-domain")); } diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/PatchUtilsTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/PatchUtilsTest.java index 398a70bbbfa..5a95ae62be6 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/PatchUtilsTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/PatchUtilsTest.java @@ -15,10 +15,10 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class PatchUtilsTest { +class PatchUtilsTest { @Test - public void convertJsonPatch_toKubernetesPatch() { + void convertJsonPatch_toKubernetesPatch() { JsonPatch build = Json.createPatchBuilder() .add("/metadata/labels/age", 27) diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/PodCompatibilityTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/PodCompatibilityTest.java index 8b78ccdf550..175a1ec43ef 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/PodCompatibilityTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/PodCompatibilityTest.java @@ -35,9 +35,9 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.stringContainsInOrder; -public class PodCompatibilityTest { +class PodCompatibilityTest { @Test - public void whenImagesDontMatch_createErrorMessage() { + void whenImagesDontMatch_createErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().image("abcde"), new V1Container().image("cdefg")); @@ -48,7 +48,7 @@ public void whenImagesDontMatch_createErrorMessage() { } @Test - public void whenLivenessProbesDontMatch_createErrorMessage() { + void whenLivenessProbesDontMatch_createErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container() @@ -64,7 +64,7 @@ public void whenLivenessProbesDontMatch_createErrorMessage() { } @Test - public void whenResourcesDontMatch_createErrorMessage() { + void whenResourcesDontMatch_createErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container() @@ -77,7 +77,7 @@ public void whenResourcesDontMatch_createErrorMessage() { } @Test - public void whenPortsDontMatch_createErrorMessage() { + void whenPortsDontMatch_createErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().addPortsItem(new V1ContainerPort().containerPort(1100)), @@ -89,7 +89,7 @@ public void whenPortsDontMatch_createErrorMessage() { } @Test - public void whenEnvVarsDontMatch_createErrorMessage() { + void whenEnvVarsDontMatch_createErrorMessage() { String name = "aa"; String value = "bb"; PodCompatibility.ContainerCompatibility compatibility = @@ -106,7 +106,7 @@ private V1EnvVar envVar(String name, String value) { } @Test - public void whenOnlyCertificateForEnvVarsDontMatch_dontCreateErrorMessage() { + void whenOnlyCertificateForEnvVarsDontMatch_dontCreateErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().name("test").addEnvItem(envVar(INTERNAL_OPERATOR_CERT_ENV, "bb")), @@ -116,7 +116,7 @@ public void whenOnlyCertificateForEnvVarsDontMatch_dontCreateErrorMessage() { } @Test - public void whenExpectedSubsetOfActual_reportCompatible() { + void whenExpectedSubsetOfActual_reportCompatible() { CompatibilityCheck check = new CompatibleSets<>("letters", ImmutableSet.of("a", "b"), ImmutableSet.of("b", "c", "a")); @@ -124,7 +124,7 @@ public void whenExpectedSubsetOfActual_reportCompatible() { } @Test - public void whenExpectedNotSubsetOfActual_reportNotCompatible() { + void whenExpectedNotSubsetOfActual_reportNotCompatible() { CompatibilityCheck check = new CompatibleSets<>( "letters", ImmutableSet.of("a", "b", "d"), ImmutableSet.of("b", "c", "a")); @@ -133,7 +133,7 @@ public void whenExpectedNotSubsetOfActual_reportNotCompatible() { } @Test - public void whenExpectedNotSubsetOfActual_reportMissingElements() { + void whenExpectedNotSubsetOfActual_reportMissingElements() { CompatibilityCheck check = new CompatibleSets<>( "letters", @@ -146,7 +146,7 @@ public void whenExpectedNotSubsetOfActual_reportMissingElements() { } @Test - public void whenCanBeMapsAndExpectedAndActualDifferentValues_reportChangedElements() { + void whenCanBeMapsAndExpectedAndActualDifferentValues_reportChangedElements() { CompatibilityCheck check = CheckFactory.create( "letters", @@ -158,7 +158,7 @@ public void whenCanBeMapsAndExpectedAndActualDifferentValues_reportChangedElemen } @Test - public void ignoreCertForComparisons() { + void ignoreCertForComparisons() { CompatibilityCheck check = CheckFactory.create( "envVars", @@ -174,7 +174,7 @@ private Object object(String name, int value) { } @Test - public void whenExpectedSubmapOfActual_reportCompatible() { + void whenExpectedSubmapOfActual_reportCompatible() { CompatibilityCheck check = new CompatibleMaps<>( "letters", ImmutableMap.of("a", 1, "b", 2), ImmutableMap.of("b", 2, "c", 3, "a", 1)); @@ -183,7 +183,7 @@ public void whenExpectedSubmapOfActual_reportCompatible() { } @Test - public void whenExpectedNotSubmapOfActual_reportNotCompatible() { + void whenExpectedNotSubmapOfActual_reportNotCompatible() { CompatibilityCheck check = new CompatibleMaps<>( "letters", @@ -194,7 +194,7 @@ public void whenExpectedNotSubmapOfActual_reportNotCompatible() { } @Test - public void whenExpectedNotSubmapOfActual_reportMissingElements() { + void whenExpectedNotSubmapOfActual_reportMissingElements() { CompatibilityCheck check = new CompatibleMaps<>( "letters", @@ -207,7 +207,7 @@ public void whenExpectedNotSubmapOfActual_reportMissingElements() { } @Test - public void whenActualKeysHaveDifferentValues_reportNotCompatible() { + void whenActualKeysHaveDifferentValues_reportNotCompatible() { CompatibilityCheck check = new CompatibleMaps<>( "letters", ImmutableMap.of("a", 1, "b", 2), ImmutableMap.of("b", 5, "c", 3, "a", 1)); @@ -216,7 +216,7 @@ public void whenActualKeysHaveDifferentValues_reportNotCompatible() { } @Test - public void whenActualKeysHaveDifferentValues_reportMissingElements() { + void whenActualKeysHaveDifferentValues_reportMissingElements() { CompatibilityCheck check = new CompatibleMaps<>( "letters", @@ -229,7 +229,7 @@ public void whenActualKeysHaveDifferentValues_reportMissingElements() { } @Test - public void whenImagesDontMatch_createDomainAndPodScopeErrorMessage() { + void whenImagesDontMatch_createDomainAndPodScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().image("abcde"), new V1Container().image("cdefg")); @@ -243,7 +243,7 @@ public void whenImagesDontMatch_createDomainAndPodScopeErrorMessage() { } @Test - public void whenImagesDontMatch_dontCreateUnknownScopeErrorMessage() { + void whenImagesDontMatch_dontCreateUnknownScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().image("abcde"), new V1Container().image("cdefg")); @@ -254,7 +254,7 @@ public void whenImagesDontMatch_dontCreateUnknownScopeErrorMessage() { @Test - public void whenImagePullPoliciesDontMatch_createDomainAndPodScopeErrorMessage() { + void whenImagePullPoliciesDontMatch_createDomainAndPodScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().imagePullPolicy("abcde"), new V1Container().imagePullPolicy("cdefg")); @@ -268,7 +268,7 @@ public void whenImagePullPoliciesDontMatch_createDomainAndPodScopeErrorMessage() } @Test - public void whenImagePullPoliciesDontMatch_dontCreateUnknownScopeErrorMessage() { + void whenImagePullPoliciesDontMatch_dontCreateUnknownScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().imagePullPolicy("abcde"), new V1Container().imagePullPolicy("cdefg")); @@ -279,7 +279,7 @@ public void whenImagePullPoliciesDontMatch_dontCreateUnknownScopeErrorMessage() @Test - public void whenVolumeMountsDontMatch_createUnknownAndPodScopeErrorMessage() { + void whenVolumeMountsDontMatch_createUnknownAndPodScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().name("c1").addVolumeMountsItem(new V1VolumeMount().name("V1").mountPath("abcde")), @@ -294,7 +294,7 @@ public void whenVolumeMountsDontMatch_createUnknownAndPodScopeErrorMessage() { } @Test - public void whenVolumeMountsDontMatch_dontCreateDomainScopeErrorMessage() { + void whenVolumeMountsDontMatch_dontCreateDomainScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().name("c1").addVolumeMountsItem(new V1VolumeMount().name("V1").mountPath("abcde")), @@ -305,7 +305,7 @@ public void whenVolumeMountsDontMatch_dontCreateDomainScopeErrorMessage() { } @Test - public void whenRestartVersionsDontMatch_createDomainAndPodScopeErrorMessage() { + void whenRestartVersionsDontMatch_createDomainAndPodScopeErrorMessage() { PodCompatibility.PodMetadataCompatibility compatibility = new PodCompatibility.PodMetadataCompatibility( new V1ObjectMeta().putLabelsItem(LabelConstants.DOMAINRESTARTVERSION_LABEL, "12345"), @@ -320,7 +320,7 @@ public void whenRestartVersionsDontMatch_createDomainAndPodScopeErrorMessage() { } @Test - public void whenRestartVersionsDontMatch_dontCreateUnknownScopeErrorMessage() { + void whenRestartVersionsDontMatch_dontCreateUnknownScopeErrorMessage() { PodCompatibility.PodMetadataCompatibility compatibility = new PodCompatibility.PodMetadataCompatibility( new V1ObjectMeta().putLabelsItem(LabelConstants.DOMAINRESTARTVERSION_LABEL, "12345"), @@ -331,7 +331,7 @@ public void whenRestartVersionsDontMatch_dontCreateUnknownScopeErrorMessage() { } @Test - public void whenLivenessProbesDontMatch_createDomainAndPodScopeErrorMessage() { + void whenLivenessProbesDontMatch_createDomainAndPodScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container() @@ -350,7 +350,7 @@ public void whenLivenessProbesDontMatch_createDomainAndPodScopeErrorMessage() { } @Test - public void whenLivenessProbesDontMatch_dontCreateUnknownScopeErrorMessage() { + void whenLivenessProbesDontMatch_dontCreateUnknownScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container() @@ -365,7 +365,7 @@ public void whenLivenessProbesDontMatch_dontCreateUnknownScopeErrorMessage() { } @Test - public void whenResourcesDontMatch_dontCreateDomainScopeErrorMessage() { + void whenResourcesDontMatch_dontCreateDomainScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container() @@ -377,7 +377,7 @@ public void whenResourcesDontMatch_dontCreateDomainScopeErrorMessage() { } @Test - public void whenResourcesDontMatch_createUnknownAndPodScopeScopeErrorMessage() { + void whenResourcesDontMatch_createUnknownAndPodScopeScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container() @@ -393,7 +393,7 @@ public void whenResourcesDontMatch_createUnknownAndPodScopeScopeErrorMessage() { } @Test - public void whenPortsDontMatch_dontCreateDomainScopeErrorMessage() { + void whenPortsDontMatch_dontCreateDomainScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().addPortsItem(new V1ContainerPort().containerPort(1100)), @@ -404,7 +404,7 @@ public void whenPortsDontMatch_dontCreateDomainScopeErrorMessage() { } @Test - public void whenPortsDontMatch_createUnknownAndPodScopeErrorMessage() { + void whenPortsDontMatch_createUnknownAndPodScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().addPortsItem(new V1ContainerPort().containerPort(1100)), @@ -419,7 +419,7 @@ public void whenPortsDontMatch_createUnknownAndPodScopeErrorMessage() { } @Test - public void whenEnvVarsDontMatch_dontCreateDomainScopeErrorMessage() { + void whenEnvVarsDontMatch_dontCreateDomainScopeErrorMessage() { String name = "aa"; String value = "bb"; PodCompatibility.ContainerCompatibility compatibility = @@ -432,7 +432,7 @@ public void whenEnvVarsDontMatch_dontCreateDomainScopeErrorMessage() { } @Test - public void whenEnvVarsDontMatch_createUnknownAndPodScopeErrorMessage() { + void whenEnvVarsDontMatch_createUnknownAndPodScopeErrorMessage() { String name = "aa"; String value = "bb"; PodCompatibility.ContainerCompatibility compatibility = @@ -447,7 +447,7 @@ public void whenEnvVarsDontMatch_createUnknownAndPodScopeErrorMessage() { } @Test - public void whenDomainHomeEnvVarsDontMatch_createDomainAndPodScopeErrorMessage() { + void whenDomainHomeEnvVarsDontMatch_createDomainAndPodScopeErrorMessage() { String name = DOMAIN_HOME; String value = "/myhome"; PodCompatibility.ContainerCompatibility compatibility = @@ -462,7 +462,7 @@ public void whenDomainHomeEnvVarsDontMatch_createDomainAndPodScopeErrorMessage() } @Test - public void whenDomainHomeEnvVarsDontMatch_dontCreateUnknownScopeErrorMessage() { + void whenDomainHomeEnvVarsDontMatch_dontCreateUnknownScopeErrorMessage() { String name = DOMAIN_HOME; String value = "/myhome"; PodCompatibility.ContainerCompatibility compatibility = @@ -475,7 +475,7 @@ public void whenDomainHomeEnvVarsDontMatch_dontCreateUnknownScopeErrorMessage() } @Test - public void whenLogHomeEnvVarsDontMatch_createDomainAndPodScopeErrorMessage() { + void whenLogHomeEnvVarsDontMatch_createDomainAndPodScopeErrorMessage() { String name = LOG_HOME; String value = "/myhome"; PodCompatibility.ContainerCompatibility compatibility = @@ -490,7 +490,7 @@ public void whenLogHomeEnvVarsDontMatch_createDomainAndPodScopeErrorMessage() { } @Test - public void whenLogHomeEnvVarsDontMatch_dontCreateUnknownScopeErrorMessage() { + void whenLogHomeEnvVarsDontMatch_dontCreateUnknownScopeErrorMessage() { String name = LOG_HOME; String value = "/myhome"; PodCompatibility.ContainerCompatibility compatibility = @@ -503,7 +503,7 @@ public void whenLogHomeEnvVarsDontMatch_dontCreateUnknownScopeErrorMessage() { } @Test - public void whenOnlyCertificateForEnvVarsDontMatch_dontCreateAnyScopeErrorMessage() { + void whenOnlyCertificateForEnvVarsDontMatch_dontCreateAnyScopeErrorMessage() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().name("test").addEnvItem(envVar(INTERNAL_OPERATOR_CERT_ENV, "bb")), @@ -515,7 +515,7 @@ public void whenOnlyCertificateForEnvVarsDontMatch_dontCreateAnyScopeErrorMessag } @Test - public void whenExpectedNotSubsetOfActual_dontReportDomainScopeMissingElements() { + void whenExpectedNotSubsetOfActual_dontReportDomainScopeMissingElements() { CompatibilityCheck check = new CompatibleSets<>( "letters", @@ -526,7 +526,7 @@ public void whenExpectedNotSubsetOfActual_dontReportDomainScopeMissingElements() } @Test - public void whenExpectedNotSubsetOfActual_reportUnknownAndPodScopeMissingElements() { + void whenExpectedNotSubsetOfActual_reportUnknownAndPodScopeMissingElements() { CompatibilityCheck check = new CompatibleSets<>( "letters", @@ -542,7 +542,7 @@ public void whenExpectedNotSubsetOfActual_reportUnknownAndPodScopeMissingElement } @Test - public void whenCanBeMapsAndExpectedAndActualDifferentValues_dontReportDomainScopeChangedElements() { + void whenCanBeMapsAndExpectedAndActualDifferentValues_dontReportDomainScopeChangedElements() { CompatibilityCheck check = CheckFactory.create( "letters", @@ -553,7 +553,7 @@ public void whenCanBeMapsAndExpectedAndActualDifferentValues_dontReportDomainSco } @Test - public void whenCanBeMapsAndExpectedAndActualDifferentValues_reportUnknownScopeChangedElements() { + void whenCanBeMapsAndExpectedAndActualDifferentValues_reportUnknownScopeChangedElements() { CompatibilityCheck check = CheckFactory.create( "letters", @@ -565,7 +565,7 @@ public void whenCanBeMapsAndExpectedAndActualDifferentValues_reportUnknownScopeC } @Test - public void ignoreAllScopeCertForComparisons() { + void ignoreAllScopeCertForComparisons() { CompatibilityCheck check = CheckFactory.create( "envVars", @@ -579,7 +579,7 @@ public void ignoreAllScopeCertForComparisons() { } @Test - public void whenExpectedNotSubmapOfActual_reportDomainScopeMissingElements() { + void whenExpectedNotSubmapOfActual_reportDomainScopeMissingElements() { CompatibilityCheck check = new CompatibleMaps<>( "env", @@ -592,7 +592,7 @@ public void whenExpectedNotSubmapOfActual_reportDomainScopeMissingElements() { } @Test - public void whenExpectedNonDomainScopedNotSubmapOfActual_dontReportDomainScopeMissingElements() { + void whenExpectedNonDomainScopedNotSubmapOfActual_dontReportDomainScopeMissingElements() { CompatibilityCheck check = new CompatibleMaps<>( "letters", @@ -605,7 +605,7 @@ public void whenExpectedNonDomainScopedNotSubmapOfActual_dontReportDomainScopeMi } @Test - public void whenExpectedNonDomainScopedNotSubmapOfActual_dontReportUnknownScopeMissingElements() { + void whenExpectedNonDomainScopedNotSubmapOfActual_dontReportUnknownScopeMissingElements() { CompatibilityCheck check = new CompatibleMaps<>( "letters", @@ -618,7 +618,7 @@ public void whenExpectedNonDomainScopedNotSubmapOfActual_dontReportUnknownScopeM } @Test - public void whenExpectedNotSubmapOfActual_reportUnknownAndPodScopeMissingElements() { + void whenExpectedNotSubmapOfActual_reportUnknownAndPodScopeMissingElements() { CompatibilityCheck check = new CompatibleMaps<>( "letters", @@ -634,7 +634,7 @@ public void whenExpectedNotSubmapOfActual_reportUnknownAndPodScopeMissingElement } @Test - public void whenActualKeysHaveDifferentValues_dontReportDomainScopeAdditionalElements() { + void whenActualKeysHaveDifferentValues_dontReportDomainScopeAdditionalElements() { CompatibilityCheck check = new CompatibleMaps<>( "letters", @@ -645,7 +645,7 @@ public void whenActualKeysHaveDifferentValues_dontReportDomainScopeAdditionalEle } @Test - public void whenActualKeysHaveDifferentValues_reportUnknownAndPodScopeMissingElements() { + void whenActualKeysHaveDifferentValues_reportUnknownAndPodScopeMissingElements() { CompatibilityCheck check = new CompatibleMaps<>( "letters", @@ -661,7 +661,7 @@ public void whenActualKeysHaveDifferentValues_reportUnknownAndPodScopeMissingEle } @Test - public void whenImagesDontMatch_andResourcesDontMatch_createDomainAScopeErrorMessageForImageOnly() { + void whenImagesDontMatch_andResourcesDontMatch_createDomainAScopeErrorMessageForImageOnly() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().image("abcde") @@ -677,7 +677,7 @@ public void whenImagesDontMatch_andResourcesDontMatch_createDomainAScopeErrorMes } @Test - public void whenImagesDontMatch_andResourcesDontMatch_createUnknownScopeErrorMessageForResourcesOnly() { + void whenImagesDontMatch_andResourcesDontMatch_createUnknownScopeErrorMessageForResourcesOnly() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().image("abcde") @@ -693,7 +693,7 @@ public void whenImagesDontMatch_andResourcesDontMatch_createUnknownScopeErrorMes } @Test - public void whenImagesDontMatch_andResourcesDontMatch_createPodScopeErrorMessageForBoth() { + void whenImagesDontMatch_andResourcesDontMatch_createPodScopeErrorMessageForBoth() { PodCompatibility.ContainerCompatibility compatibility = new PodCompatibility.ContainerCompatibility( new V1Container().image("abcde") diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/PodDisruptionBudgetHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/PodDisruptionBudgetHelperTest.java index eeffe489d5c..12a665fefae 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/PodDisruptionBudgetHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/PodDisruptionBudgetHelperTest.java @@ -53,7 +53,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; @SuppressWarnings("ConstantConditions") -public class PodDisruptionBudgetHelperTest { +class PodDisruptionBudgetHelperTest { static final String DOMAIN_NAME = "domain1"; static final String NS = "namespace"; @@ -131,7 +131,7 @@ private DomainSpec createDomainSpec() { } @Test - public void whenPdbCreated_createWithOwnerReference() { + void whenPdbCreated_createWithOwnerReference() { V1OwnerReference expectedReference = new V1OwnerReference() .apiVersion(KubernetesConstants.DOMAIN_GROUP + "/" + KubernetesConstants.DOMAIN_VERSION) .kind(KubernetesConstants.DOMAIN) @@ -144,7 +144,7 @@ public void whenPdbCreated_createWithOwnerReference() { } @Test - public void whenCreated_modelHasExpectedSelectors() { + void whenCreated_modelHasExpectedSelectors() { V1beta1PodDisruptionBudget model = createPDBModel(testSupport.getPacket()); Map labels = new HashMap<>(); @@ -156,7 +156,7 @@ public void whenCreated_modelHasExpectedSelectors() { } @Test - public void whenCreated_modelMetadataHasExpectedLabels() { + void whenCreated_modelMetadataHasExpectedLabels() { V1beta1PodDisruptionBudget model = createPDBModel(testSupport.getPacket()); assertThat( @@ -166,7 +166,7 @@ public void whenCreated_modelMetadataHasExpectedLabels() { } @Test - public void whenCreated_modelHasExpectedMinAvailableSpec() { + void whenCreated_modelHasExpectedMinAvailableSpec() { configureCluster(getTestCluster()).withReplicas(3).withMaxUnavailable(1); V1beta1PodDisruptionBudget model = createPDBModel(testSupport.getPacket()); @@ -175,14 +175,14 @@ public void whenCreated_modelHasExpectedMinAvailableSpec() { } @Test - public void onRunWithNoPodDisruptionBudget_logCreatedMessage() { + void onRunWithNoPodDisruptionBudget_logCreatedMessage() { runPodDisruptionBudgetHelper(); assertThat(logRecords, containsInfo(getPdbCreateLogMessage())); } @Test - public void onRunWithNoPodDisruptionBudget_createIt() { + void onRunWithNoPodDisruptionBudget_createIt() { consoleHandlerMemento.ignoreMessage(getPdbCreateLogMessage()); runPodDisruptionBudgetHelper(); @@ -193,7 +193,7 @@ public void onRunWithNoPodDisruptionBudget_createIt() { } @Test - public void onFailedRun_reportFailure() { + void onFailedRun_reportFailure() { testSupport.addRetryStrategy(retryStrategy); testSupport.failOnResource(PODDISRUPTIONBUDGET, getPdbName(), NS, 500); @@ -203,7 +203,7 @@ public void onFailedRun_reportFailure() { } @Test - public void whenPodDisruptionBudgetCreationFailsDueToUnprocessableEntityFailure_reportInDomainStatus() { + void whenPodDisruptionBudgetCreationFailsDueToUnprocessableEntityFailure_reportInDomainStatus() { testSupport.defineResources(domainPresenceInfo.getDomain()); testSupport.failOnResource(PODDISRUPTIONBUDGET, getPdbName(), NS, new UnrecoverableErrorBuilderImpl() .withReason("FieldValueNotFound") @@ -217,7 +217,7 @@ public void whenPodDisruptionBudgetCreationFailsDueToUnprocessableEntityFailure_ } @Test - public void whenPodDisruptionBudgetCreationFailsDueToUnprocessableEntityFailure_abortFiber() { + void whenPodDisruptionBudgetCreationFailsDueToUnprocessableEntityFailure_abortFiber() { testSupport.defineResources(domainPresenceInfo.getDomain()); testSupport.failOnResource(PODDISRUPTIONBUDGET, getPdbName(), NS, new UnrecoverableErrorBuilderImpl() .withReason("FieldValueNotFound") @@ -263,7 +263,7 @@ private Domain getDomain() { } @Test - public void whenMatchingPodDisruptionBudgetRecordedInDomainPresence_logPdbExists() { + void whenMatchingPodDisruptionBudgetRecordedInDomainPresence_logPdbExists() { V1beta1PodDisruptionBudget originalPdb = createPDBModel(testSupport.getPacket()); recordPodDisruptionBudget(domainPresenceInfo, originalPdb); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/PodHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/PodHelperTest.java index 18e9b8f191d..5a781f53c70 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/PodHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/PodHelperTest.java @@ -30,7 +30,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.sameInstance; -public class PodHelperTest { +class PodHelperTest { private static final String UID = "uid1"; private static final String SERVER_NAME = "server1"; private static final String POD_NAME = LegalNames.toPodName(UID, SERVER_NAME); @@ -65,7 +65,7 @@ public void tearDown() throws Exception { } @Test - public void afterAddingFactoryToPacket_canRetrieveIt() { + void afterAddingFactoryToPacket_canRetrieveIt() { Packet packet = new Packet(); PodAwaiterStepFactory factory = createStub(PodAwaiterStepFactory.class); PodHelper.addToPacket(packet, factory); @@ -78,7 +78,7 @@ public void afterAddingFactoryToPacket_canRetrieveIt() { // from the pod (if any) in the SKO. @Test - public void afterDeletePodStepRun_markedForDeleteInSko() { + void afterDeletePodStepRun_markedForDeleteInSko() { testSupport.defineResources(pod); domainPresenceInfo.setServerPod(SERVER_NAME, pod); @@ -89,7 +89,7 @@ public void afterDeletePodStepRun_markedForDeleteInSko() { } @Test - public void whenDeleteFails_reportCompletionFailure() { + void whenDeleteFails_reportCompletionFailure() { testSupport.failOnResource(POD, POD_NAME, NS, HTTP_BAD_REQUEST); domainPresenceInfo.setServerPod(SERVER_NAME, pod); @@ -99,26 +99,26 @@ public void whenDeleteFails_reportCompletionFailure() { } @Test - public void whenDeletePodStepRunWithNoPod_doNotSendDeleteCall() { + void whenDeletePodStepRunWithNoPod_doNotSendDeleteCall() { testSupport.runSteps(PodHelper.deletePodStep(SERVER_NAME, terminalStep)); MatcherAssert.assertThat(domainPresenceInfo.getServerPod(SERVER_NAME), nullValue()); } @Test - public void afterDeletePodStepRun_runSpecifiedNextStep() { + void afterDeletePodStepRun_runSpecifiedNextStep() { testSupport.runSteps(PodHelper.deletePodStep(SERVER_NAME, terminalStep)); MatcherAssert.assertThat(terminalStep.wasRun(), is(true)); } @Test - public void whenPodHasNoStatus_isNotReady() { + void whenPodHasNoStatus_isNotReady() { assertThat(PodHelper.getReadyStatus(new V1Pod()), is(false)); } @Test - public void whenPodPhaseNotRunning_isNotReady() { + void whenPodPhaseNotRunning_isNotReady() { V1Pod pod = new V1Pod() .status(new V1PodStatus() .phase("Pending") @@ -128,7 +128,7 @@ public void whenPodPhaseNotRunning_isNotReady() { } @Test - public void whenPodRunningWithOnlyNonReadyConditions_isNotReady() { + void whenPodRunningWithOnlyNonReadyConditions_isNotReady() { V1Pod pod = new V1Pod() .status(new V1PodStatus() .phase("Running") @@ -138,7 +138,7 @@ public void whenPodRunningWithOnlyNonReadyConditions_isNotReady() { } @Test - public void whenPodRunningWithOnlyReadyConditionNotTrue_isNotReady() { + void whenPodRunningWithOnlyReadyConditionNotTrue_isNotReady() { V1Pod pod = new V1Pod() .status(new V1PodStatus() .phase("Running") @@ -148,7 +148,7 @@ public void whenPodRunningWithOnlyReadyConditionNotTrue_isNotReady() { } @Test - public void whenPodRunningWithOnlyReadyConditionTrue_isReady() { + void whenPodRunningWithOnlyReadyConditionTrue_isReady() { V1Pod pod = new V1Pod() .status(new V1PodStatus() .phase("Running") diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/PodHelperTestBase.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/PodHelperTestBase.java index 25ca3b7dd19..4668f7bcbbe 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/PodHelperTestBase.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/PodHelperTestBase.java @@ -352,7 +352,7 @@ WlsServerConfig getServerTopology() { } @Test - public void whenPodCreatedWithoutExportConfiguration_hasPrometheusAnnotations() { + void whenPodCreatedWithoutExportConfiguration_hasPrometheusAnnotations() { assertThat( getCreatedPod().getMetadata().getAnnotations(), allOf( @@ -362,7 +362,7 @@ public void whenPodCreatedWithoutExportConfiguration_hasPrometheusAnnotations() } @Test - public void whenPodCreatedWithAdminNap_prometheusAnnotationsSpecifyPlainTextPort() { + void whenPodCreatedWithAdminNap_prometheusAnnotationsSpecifyPlainTextPort() { getServerTopology().addNetworkAccessPoint(new NetworkAccessPoint("test", "admin", 8001, 8001)); getServerTopology().setListenPort(7001); getServerTopology().setSslListenPort(7002); @@ -381,7 +381,7 @@ protected DomainConfigurator defineExporterConfiguration() { } @Test - public void whenDomainHasMonitoringExporterConfiguration_hasPrometheusAnnotations() { + void whenDomainHasMonitoringExporterConfiguration_hasPrometheusAnnotations() { defineExporterConfiguration(); assertThat( @@ -509,7 +509,7 @@ List getCreatedPodSpecInitContainers() { } @Test - public void whenNoPod_createIt() { + void whenNoPod_createIt() { testSupport.runSteps(getStepFactory(), terminalStep); assertThat(testSupport.getResources(KubernetesTestSupport.POD), notNullValue()); @@ -517,12 +517,12 @@ public void whenNoPod_createIt() { } @Test - public void whenPodCreated_specHasOneContainer() { + void whenPodCreated_specHasOneContainer() { assertThat(getCreatedPod().getSpec().getContainers(), hasSize(1)); } @Test - public void whenPodCreated_hasSha256HashAnnotationForRecipe() { + void whenPodCreated_hasSha256HashAnnotationForRecipe() { assertThat(getCreatedPod().getMetadata().getAnnotations(), hasKey(SHA256_ANNOTATION)); } @@ -542,7 +542,7 @@ public void whenPodCreated_hasSha256HashAnnotationForRecipe() { abstract String getReferenceMiiPodYaml(); @Test - public void afterUpgradingPlainPortPodFrom30_patchIt() { + void afterUpgradingPlainPortPodFrom30_patchIt() { useProductionHash(); initializeExistingPod(loadPodModel(getReferencePlainPortPodYaml_3_0())); @@ -554,7 +554,7 @@ public void afterUpgradingPlainPortPodFrom30_patchIt() { } @Test - public void afterUpgradingPlainPortPodFrom31_patchIt() { + void afterUpgradingPlainPortPodFrom31_patchIt() { useProductionHash(); initializeExistingPod(loadPodModel(getReferencePlainPortPodYaml_3_1())); @@ -566,7 +566,7 @@ public void afterUpgradingPlainPortPodFrom31_patchIt() { } @Test - public void afterUpgradingSslPortPodFrom30_patchIt() { + void afterUpgradingSslPortPodFrom30_patchIt() { useProductionHash(); getServerTopology().setSslListenPort(7002); initializeExistingPod(loadPodModel(getReferenceSslPortPodYaml_3_0())); @@ -579,7 +579,7 @@ public void afterUpgradingSslPortPodFrom30_patchIt() { } @Test - public void afterUpgradingSslPortPodFrom31_patchIt() { + void afterUpgradingSslPortPodFrom31_patchIt() { useProductionHash(); getServerTopology().setSslListenPort(7002); initializeExistingPod(loadPodModel(getReferenceSslPortPodYaml_3_1())); @@ -596,7 +596,7 @@ void useProductionHash() { } @Test - public void afterUpgradingMiiPodFrom31_patchIt() { + void afterUpgradingMiiPodFrom31_patchIt() { useProductionHash(); testSupport.addToPacket(SECRETS_MD_5, "originalSecret"); testSupport.addToPacket(DOMAINZIP_HASH, "originalSecret"); @@ -615,7 +615,7 @@ private V1Pod loadPodModel(String podYaml) { } @Test - public void whenPodCreatedWithLatestImage_useAlwaysPullPolicy() { + void whenPodCreatedWithLatestImage_useAlwaysPullPolicy() { defineDomainImage(LATEST_IMAGE); V1Container v1Container = getCreatedPodSpecContainer(); @@ -626,7 +626,7 @@ public void whenPodCreatedWithLatestImage_useAlwaysPullPolicy() { } @Test - public void whenPodCreatedWithVersionedImage_useIfNotPresentPolicy() { + void whenPodCreatedWithVersionedImage_useIfNotPresentPolicy() { defineDomainImage(VERSIONED_IMAGE); V1Container v1Container = getCreatedPodSpecContainer(); @@ -636,12 +636,12 @@ public void whenPodCreatedWithVersionedImage_useIfNotPresentPolicy() { } @Test - public void whenPodCreatedWithoutPullSecret_doNotAddToPod() { + void whenPodCreatedWithoutPullSecret_doNotAddToPod() { assertThat(getCreatedPod().getSpec().getImagePullSecrets(), empty()); } @Test - public void whenPodCreatedWithPullSecret_addToPod() { + void whenPodCreatedWithPullSecret_addToPod() { V1LocalObjectReference imagePullSecret = new V1LocalObjectReference().name("secret"); configureDomain().withDefaultImagePullSecrets(imagePullSecret); @@ -649,7 +649,7 @@ public void whenPodCreatedWithPullSecret_addToPod() { } @Test - public void whenPodCreated_withNoPvc_image_containerHasExpectedVolumeMounts() { + void whenPodCreated_withNoPvc_image_containerHasExpectedVolumeMounts() { configurator.withDomainHomeSourceType(DomainSourceType.Image); assertThat( getCreatedPodSpecContainer().getVolumeMounts(), @@ -661,7 +661,7 @@ public void whenPodCreated_withNoPvc_image_containerHasExpectedVolumeMounts() { } @Test - public void whenPodCreated_withNoPvc_fromModel_containerHasExpectedVolumeMounts() { + void whenPodCreated_withNoPvc_fromModel_containerHasExpectedVolumeMounts() { reportInspectionWasRun(); configurator.withDomainHomeSourceType(DomainSourceType.FromModel) .withRuntimeEncryptionSecret("my-runtime-encryption-secret"); @@ -677,7 +677,7 @@ public void whenPodCreated_withNoPvc_fromModel_containerHasExpectedVolumeMounts( } @Test - public void whenDomainHasAuxiliaryImage_createPodsWithInitContainerEmptyDirVolumeAndVolumeMounts() { + void whenDomainHasAuxiliaryImage_createPodsWithInitContainerEmptyDirVolumeAndVolumeMounts() { getConfigurator() .withAuxiliaryImageVolumes(getAuxiliaryImageVolume(DEFAULT_AUXILIARY_IMAGE_PATH)) .withAuxiliaryImages(Collections.singletonList(getAuxiliaryImage("wdt-image:v1"))); @@ -704,7 +704,7 @@ protected String getAuxiliaryImageVolumeName(String testVolumeName) { } @Test - public void whenDomainHasAuxiliaryImageAndVolumeWithCustomMountPath_createPodsWithVolumeMountHavingCustomMountPath() { + void whenDomainHasAuxiliaryImageAndVolumeWithCustomMountPath_createPodsWithVolumeMountHavingCustomMountPath() { getConfigurator() .withAuxiliaryImageVolumes(getAuxiliaryImageVolume(CUSTOM_MOUNT_PATH)) .withAuxiliaryImages(getAuxiliaryImages("wdt-image:v1")); @@ -714,7 +714,7 @@ public void whenDomainHasAuxiliaryImageAndVolumeWithCustomMountPath_createPodsWi } @Test - public void whenDomainHasAuxiliaryImageVolumeWithMedium_createPodsWithVolumeHavingSpecifiedMedium() { + void whenDomainHasAuxiliaryImageVolumeWithMedium_createPodsWithVolumeHavingSpecifiedMedium() { getConfigurator() .withAuxiliaryImageVolumes(Collections.singletonList( new AuxiliaryImageVolume().name(TEST_VOLUME_NAME).medium("Memory"))) @@ -726,7 +726,7 @@ public void whenDomainHasAuxiliaryImageVolumeWithMedium_createPodsWithVolumeHavi } @Test - public void whenDomainHasAuxiliaryImageVolumeWithSizeLimit_createPodsWithVolumeHavingSpecifiedSizeLimit() { + void whenDomainHasAuxiliaryImageVolumeWithSizeLimit_createPodsWithVolumeHavingSpecifiedSizeLimit() { getConfigurator() .withAuxiliaryImageVolumes(Collections.singletonList( new AuxiliaryImageVolume().name(TEST_VOLUME_NAME).sizeLimit("100G"))) @@ -738,7 +738,7 @@ public void whenDomainHasAuxiliaryImageVolumeWithSizeLimit_createPodsWithVolumeH } @Test - public void whenDomainHasAuxiliaryImagesWithImagePullPolicy_createPodsWithAIInitContainerHavingImagePullPolicy() { + void whenDomainHasAuxiliaryImagesWithImagePullPolicy_createPodsWithAIInitContainerHavingImagePullPolicy() { getConfigurator() .withAuxiliaryImageVolumes(getAuxiliaryImageVolume(DEFAULT_AUXILIARY_IMAGE_PATH)) .withAuxiliaryImages(Collections.singletonList(getAuxiliaryImage("wdt-image:v1") @@ -751,7 +751,7 @@ public void whenDomainHasAuxiliaryImagesWithImagePullPolicy_createPodsWithAIInit } @Test - public void whenDomainHasAuxImagesWithCustomCommand_createPodsWithAuxImageInitContainerHavingCustomCommand() { + void whenDomainHasAuxImagesWithCustomCommand_createPodsWithAuxImageInitContainerHavingCustomCommand() { getConfigurator() .withAuxiliaryImageVolumes(Collections.singletonList( new AuxiliaryImageVolume().mountPath(DEFAULT_AUXILIARY_IMAGE_PATH).name(TEST_VOLUME_NAME))) @@ -764,7 +764,7 @@ public void whenDomainHasAuxImagesWithCustomCommand_createPodsWithAuxImageInitCo } @Test - public void whenDomainHasMultipleAuxiliaryImages_createPodsWithAuxiliaryImageInitContainersInCorrectOrder() { + void whenDomainHasMultipleAuxiliaryImages_createPodsWithAuxiliaryImageInitContainersInCorrectOrder() { getConfigurator() .withAuxiliaryImageVolumes(Collections.singletonList( new AuxiliaryImageVolume().mountPath(DEFAULT_AUXILIARY_IMAGE_PATH).name(TEST_VOLUME_NAME))) @@ -803,7 +803,7 @@ public static AuxiliaryImage getAuxiliaryImage(String image) { } @Test - public void whenIntrospectionCreatesMultipleConfigMaps_createCorrespondingVolumeMounts() { + void whenIntrospectionCreatesMultipleConfigMaps_createCorrespondingVolumeMounts() { testSupport.addToPacket(NUM_CONFIG_MAPS, "3"); assertThat( @@ -831,42 +831,42 @@ public boolean wasInspectionRun() { } @Test - public void whenPodCreated_lifecyclePreStopHasStopServerCommand() { + void whenPodCreated_lifecyclePreStopHasStopServerCommand() { assertThat( getCreatedPodSpecContainer().getLifecycle().getPreStop().getExec().getCommand(), contains("/weblogic-operator/scripts/stopServer.sh")); } @Test - public void whenPodCreated_livenessProbeHasLivenessCommand() { + void whenPodCreated_livenessProbeHasLivenessCommand() { assertThat( getCreatedPodSpecContainer().getLivenessProbe().getExec().getCommand(), contains("/weblogic-operator/scripts/livenessProbe.sh")); } @Test - public void whenPodCreated_livenessProbeHasDefinedTuning() { + void whenPodCreated_livenessProbeHasDefinedTuning() { assertThat( getCreatedPodSpecContainer().getLivenessProbe(), hasExpectedTuning(LIVENESS_INITIAL_DELAY, LIVENESS_TIMEOUT, LIVENESS_PERIOD)); } @Test - public void whenPodCreated_readinessProbeHasReadinessCommand() { + void whenPodCreated_readinessProbeHasReadinessCommand() { V1HTTPGetAction getAction = getCreatedPodSpecContainer().getReadinessProbe().getHttpGet(); assertThat(getAction.getPath(), equalTo("/weblogic/ready")); assertThat(getAction.getPort().getIntValue(), equalTo(listenPort)); } @Test - public void whenPodCreated_readinessProbeHasDefinedTuning() { + void whenPodCreated_readinessProbeHasDefinedTuning() { assertThat( getCreatedPodSpecContainer().getReadinessProbe(), hasExpectedTuning(READINESS_INITIAL_DELAY, READINESS_TIMEOUT, READINESS_PERIOD)); } @Test - public void whenPodCreatedWithAdminPortEnabled_readinessProbeHasReadinessCommand() { + void whenPodCreatedWithAdminPortEnabled_readinessProbeHasReadinessCommand() { final Integer adminPort = 9002; domainTopology.getServerConfig(serverName).setAdminPort(adminPort); V1HTTPGetAction getAction = getCreatedPodSpecContainer().getReadinessProbe().getHttpGet(); @@ -876,28 +876,28 @@ public void whenPodCreatedWithAdminPortEnabled_readinessProbeHasReadinessCommand } @Test - public void whenPodCreatedWithAdminPortEnabled_adminPortSecureEnvVarIsTrue() { + void whenPodCreatedWithAdminPortEnabled_adminPortSecureEnvVarIsTrue() { final Integer adminPort = 9002; domainTopology.getServerConfig(serverName).setAdminPort(adminPort); assertThat(getCreatedPodSpecContainer().getEnv(), hasEnvVar("ADMIN_PORT_SECURE", "true")); } @Test - public void whenPodCreatedWithOnRestartDistribution_dontAddDynamicUpdateEnvVar() { + void whenPodCreatedWithOnRestartDistribution_dontAddDynamicUpdateEnvVar() { configureDomain().withConfigOverrideDistributionStrategy(OverrideDistributionStrategy.ON_RESTART); assertThat(getCreatedPodSpecContainer().getEnv(), not(hasEnvVar("DYNAMIC_CONFIG_OVERRIDE"))); } @Test - public void whenPodCreatedWithDynamicDistribution_addDynamicUpdateEnvVar() { + void whenPodCreatedWithDynamicDistribution_addDynamicUpdateEnvVar() { configureDomain().withConfigOverrideDistributionStrategy(OverrideDistributionStrategy.DYNAMIC); assertThat(getCreatedPodSpecContainer().getEnv(), hasEnvVar("DYNAMIC_CONFIG_OVERRIDE")); } @Test - public void whenDistributionStrategyModified_dontReplacePod() { + void whenDistributionStrategyModified_dontReplacePod() { configureDomain().withConfigOverrideDistributionStrategy(OverrideDistributionStrategy.DYNAMIC); initializeExistingPod(); @@ -906,7 +906,7 @@ public void whenDistributionStrategyModified_dontReplacePod() { } @Test - public void whenPodCreatedWithDomainV2Settings_livenessProbeHasConfiguredTuning() { + void whenPodCreatedWithDomainV2Settings_livenessProbeHasConfiguredTuning() { configureServer() .withLivenessProbeSettings(CONFIGURED_DELAY, CONFIGURED_TIMEOUT, CONFIGURED_PERIOD); assertThat( @@ -915,7 +915,7 @@ public void whenPodCreatedWithDomainV2Settings_livenessProbeHasConfiguredTuning( } @Test - public void whenPodCreated_readinessProbeHasConfiguredTuning() { + void whenPodCreated_readinessProbeHasConfiguredTuning() { configureServer() .withReadinessProbeSettings(CONFIGURED_DELAY, CONFIGURED_TIMEOUT, CONFIGURED_PERIOD); assertThat( @@ -937,7 +937,7 @@ public void whenPodCreationFailsDueToUnprocessableEntityFailure_reportInDomainSt } @Test - public void whenPodCreationFailsDueToUnprocessableEntityFailure_abortFiber() { + void whenPodCreationFailsDueToUnprocessableEntityFailure_abortFiber() { testSupport.failOnResource(POD, getPodName(), NS, new UnrecoverableErrorBuilderImpl() .withReason("FieldValueNotFound") .withMessage("Test this failure") @@ -949,7 +949,7 @@ public void whenPodCreationFailsDueToUnprocessableEntityFailure_abortFiber() { } @Test - public void whenPodCreationFailsDueToQuotaExceeded_reportInDomainStatus() { + void whenPodCreationFailsDueToQuotaExceeded_reportInDomainStatus() { testSupport.failOnResource(POD, getPodName(), NS, createQuotaExceededException()); testSupport.runSteps(getStepFactory(), terminalStep); @@ -967,7 +967,7 @@ private String getQuotaExceededMessage() { } @Test - public void whenPodCreationFailsDueToQuotaExceeded_abortFiber() { + void whenPodCreationFailsDueToQuotaExceeded_abortFiber() { testSupport.failOnResource(POD, getPodName(), NS, createQuotaExceededException()); testSupport.runSteps(getStepFactory(), terminalStep); @@ -1019,7 +1019,7 @@ private V1Pod getPatchedPod() { @SuppressWarnings("unchecked") @Test - public void whenPodCreated_hasPredefinedEnvVariables() { + void whenPodCreated_hasPredefinedEnvVariables() { assertThat( getCreatedPodSpecContainer().getEnv(), allOf( @@ -1047,7 +1047,7 @@ void whenPodCreated_hasProductVersion() throws NoSuchFieldException { } @Test - public void whenPodCreated_withLogHomeSpecified_hasLogHomeEnvVariable() { + void whenPodCreated_withLogHomeSpecified_hasLogHomeEnvVariable() { final String myLogHome = "/shared/mylogs/"; domainPresenceInfo.getDomain().getSpec().setLogHomeEnabled(true); domainPresenceInfo.getDomain().getSpec().setLogHome("/shared/mylogs/"); @@ -1055,14 +1055,14 @@ public void whenPodCreated_withLogHomeSpecified_hasLogHomeEnvVariable() { } @Test - public void whenPodCreated_withoutLogHomeSpecified_hasDefaultLogHomeEnvVariable() { + void whenPodCreated_withoutLogHomeSpecified_hasDefaultLogHomeEnvVariable() { domainPresenceInfo.getDomain().getSpec().setLogHomeEnabled(true); domainPresenceInfo.getDomain().getSpec().setLogHome(null); assertThat(getCreatedPodSpecContainer().getEnv(), hasEnvVar("LOG_HOME", LOG_HOME + "/" + UID)); } @Test - public void whenPodCreated_withLivenessCustomScriptSpecified_hasEnvVariable() { + void whenPodCreated_withLivenessCustomScriptSpecified_hasEnvVariable() { final String customScript = "/u01/customLiveness.sh"; domainPresenceInfo.getDomain().getSpec().setLivenessProbeCustomScript(customScript); assertThat(getCreatedPodSpecContainer().getEnv(), hasEnvVar("LIVENESS_PROBE_CUSTOM_SCRIPT", customScript)); @@ -1072,7 +1072,7 @@ public void whenPodCreated_withLivenessCustomScriptSpecified_hasEnvVariable() { private static final String OVERRIDE_DATA_HOME = OVERRIDE_DATA_DIR + File.separator + UID; @Test - public void whenPodCreated_withDataHomeSpecified_verifyDataHomeEnvDefined() { + void whenPodCreated_withDataHomeSpecified_verifyDataHomeEnvDefined() { domainPresenceInfo.getDomain().getSpec().setDataHome(OVERRIDE_DATA_DIR); assertThat(getCreatedPodSpecContainer().getEnv(), hasEnvVar(ServerEnvVars.DATA_HOME, OVERRIDE_DATA_HOME)); } @@ -1080,12 +1080,12 @@ public void whenPodCreated_withDataHomeSpecified_verifyDataHomeEnvDefined() { private static final String EMPTY_DATA_HOME = ""; @Test - public void whenPodCreated_withDataHomeNotSpecified_verifyDataHomeEnvNotDefined() { + void whenPodCreated_withDataHomeNotSpecified_verifyDataHomeEnvNotDefined() { assertThat(getCreatedPodSpecContainer().getEnv(), not(hasEnvVar(ServerEnvVars.DATA_HOME, EMPTY_DATA_HOME))); } @Test - public void whenPodCreated_withEmptyDataHomeSpecified_verifyDataHomeEnvNotDefined() { + void whenPodCreated_withEmptyDataHomeSpecified_verifyDataHomeEnvNotDefined() { domainPresenceInfo.getDomain().getSpec().setDataHome(EMPTY_DATA_HOME); assertThat(getCreatedPodSpecContainer().getEnv(), not(hasEnvVar(ServerEnvVars.DATA_HOME, EMPTY_DATA_HOME))); } @@ -1093,18 +1093,18 @@ public void whenPodCreated_withEmptyDataHomeSpecified_verifyDataHomeEnvNotDefine private static final String NULL_DATA_HOME = null; @Test - public void whenPodCreated_withNullDataHomeSpecified_verifyDataHomeEnvNotDefined() { + void whenPodCreated_withNullDataHomeSpecified_verifyDataHomeEnvNotDefined() { domainPresenceInfo.getDomain().getSpec().setDataHome(NULL_DATA_HOME); assertThat(getCreatedPodSpecContainer().getEnv(), not(hasEnvVar(ServerEnvVars.DATA_HOME, NULL_DATA_HOME))); } @Test - public void whenDomainPresenceLacksClaims_adminPodSpecHasNoDomainStorageVolume() { + void whenDomainPresenceLacksClaims_adminPodSpecHasNoDomainStorageVolume() { assertThat(getVolumeWithName(getCreatedPod(), STORAGE_VOLUME_NAME), nullValue()); } @Test - public void createdPod_hasConfigMapVolume() { + void createdPod_hasConfigMapVolume() { V1Volume credentialsVolume = getVolumeWithName(getCreatedPod(), CONFIGMAP_VOLUME_NAME); assertThat(credentialsVolume.getConfigMap().getName(), equalTo(SCRIPT_CONFIG_MAP_NAME)); @@ -1121,7 +1121,7 @@ private V1Volume getVolumeWithName(V1Pod pod, String volumeName) { } @Test - public void whenPodCreated_hasExpectedLabels() { + void whenPodCreated_hasExpectedLabels() { assertThat( getCreatedPod().getMetadata().getLabels(), allOf( @@ -1132,7 +1132,7 @@ public void whenPodCreated_hasExpectedLabels() { } @Test - public void whenPodCreated_containerUsesListenPort() { + void whenPodCreated_containerUsesListenPort() { final V1ContainerPort plainPort = getContainerPort("default"); assertThat(plainPort, notNullValue()); @@ -1146,7 +1146,7 @@ private V1ContainerPort getContainerPort(String portName) { } @Test - public void whenPodCreatedWithSslPort_containerUsesIt() { + void whenPodCreatedWithSslPort_containerUsesIt() { domainTopology.getServerConfig(serverName).setSslListenPort(SSL_PORT); final V1ContainerPort sslPort = getContainerPort("default-secure"); @@ -1156,7 +1156,7 @@ public void whenPodCreatedWithSslPort_containerUsesIt() { } @Test - public void whenPodCreatedWithAdminPortEnabled__containerUsesIt() { + void whenPodCreatedWithAdminPortEnabled__containerUsesIt() { final Integer adminPort = 9002; domainTopology.getServerConfig(serverName).setAdminPort(adminPort); final V1ContainerPort sslPort = getContainerPort("default-admin"); @@ -1178,12 +1178,12 @@ V1Pod getCreatedPod() { } @Test - public void whenPodHasUnknownCustomerLabel_ignoreIt() { + void whenPodHasUnknownCustomerLabel_ignoreIt() { verifyPodNotReplacedWhen(pod -> pod.getMetadata().putLabelsItem("customer.label", "value")); } @Test - public void whenPodLacksExpectedCustomerLabel_addIt() { + void whenPodLacksExpectedCustomerLabel_addIt() { initializeExistingPod(); configurator.withPodLabel("customer.label", "value"); @@ -1193,7 +1193,7 @@ public void whenPodLacksExpectedCustomerLabel_addIt() { } @Test - public void whenPodLacksExpectedCustomerAnnotations_addIt() { + void whenPodLacksExpectedCustomerAnnotations_addIt() { initializeExistingPod(); configurator.withPodAnnotation("customer.annotation", "value"); @@ -1203,7 +1203,7 @@ public void whenPodLacksExpectedCustomerAnnotations_addIt() { } @Test - public void whenPodCustomerLabelHasBadValue_replaceIt() { + void whenPodCustomerLabelHasBadValue_replaceIt() { configurator.withPodLabel("customer.label", "value"); misconfigurePod(pod -> pod.getMetadata().putLabelsItem("customer.label", "badvalue")); @@ -1213,7 +1213,7 @@ public void whenPodCustomerLabelHasBadValue_replaceIt() { } @Test - public void whenPodCustomerAnnotationHasBadValue_replaceIt() { + void whenPodCustomerAnnotationHasBadValue_replaceIt() { configurator.withPodAnnotation("customer.annotation", "value"); misconfigurePod(pod -> pod.getMetadata().putAnnotationsItem("customer.annotation", "badvalue")); @@ -1223,7 +1223,7 @@ public void whenPodCustomerAnnotationHasBadValue_replaceIt() { } @Test - public void whenPodLacksExpectedCustomerLabelAndRequestRequirement_replaceIt() { + void whenPodLacksExpectedCustomerLabelAndRequestRequirement_replaceIt() { initializeExistingPod(); configurator.withPodLabel("expected.label", "value").withRequestRequirement("widgets", "10"); @@ -1259,12 +1259,12 @@ private V1Pod createPodModel() { } @Test - public void whenPodHasUnknownCustomerAnnotations_ignoreIt() { + void whenPodHasUnknownCustomerAnnotations_ignoreIt() { verifyPodNotReplacedWhen(pod -> pod.getMetadata().putAnnotationsItem("annotation", "value")); } @Test - public void whenConfigurationModifiesPodSecurityContext_replacePod() { + void whenConfigurationModifiesPodSecurityContext_replacePod() { initializeExistingPod(); configurator.withPodSecurityContext(new V1PodSecurityContext().runAsGroup(12345L)); @@ -1273,7 +1273,7 @@ public void whenConfigurationModifiesPodSecurityContext_replacePod() { } @Test - public void whenConfigurationAddsNodeSelector_replacePod() { + void whenConfigurationAddsNodeSelector_replacePod() { initializeExistingPod(); configurator.withNodeSelector("key", "value"); @@ -1282,12 +1282,12 @@ public void whenConfigurationAddsNodeSelector_replacePod() { } @Test - public void whenNullVsEmptyNodeSelector_dontReplaceIt() { + void whenNullVsEmptyNodeSelector_dontReplaceIt() { verifyPodNotReplacedWhen(pod -> pod.getSpec().setNodeSelector(null)); } @Test - public void whenConfigurationModifiesContainerSecurityContext_replacePod() { + void whenConfigurationModifiesContainerSecurityContext_replacePod() { initializeExistingPod(); configurator.withContainerSecurityContext(new V1SecurityContext().runAsGroup(9876L)); @@ -1296,7 +1296,7 @@ public void whenConfigurationModifiesContainerSecurityContext_replacePod() { } @Test - public void whenPodLivenessProbeSettingsChanged_replacePod() { + void whenPodLivenessProbeSettingsChanged_replacePod() { initializeExistingPod(); configurator.withDefaultLivenessProbeSettings(8, 7, 6); @@ -1305,7 +1305,7 @@ public void whenPodLivenessProbeSettingsChanged_replacePod() { } @Test - public void whenPodReadinessProbeSettingsChanged_replacePod() { + void whenPodReadinessProbeSettingsChanged_replacePod() { initializeExistingPod(); configurator.withDefaultReadinessProbeSettings(5, 4, 3); @@ -1314,7 +1314,7 @@ public void whenPodReadinessProbeSettingsChanged_replacePod() { } @Test - public void whenPodRequestRequirementChanged_replacePod() { + void whenPodRequestRequirementChanged_replacePod() { initializeExistingPod(); configurator.withRequestRequirement("resource", "5"); @@ -1323,12 +1323,12 @@ public void whenPodRequestRequirementChanged_replacePod() { } @Test - public void whenPodRequestRequirementsEmptyVsNull_dontReplaceIt() { + void whenPodRequestRequirementsEmptyVsNull_dontReplaceIt() { verifyPodNotReplacedWhen(pod -> pod.getSpec().getContainers().get(0).resources(null)); } @Test - public void whenPodLimitRequirementChanged_replacePod() { + void whenPodLimitRequirementChanged_replacePod() { initializeExistingPod(); configurator.withLimitRequirement("limit", "7"); @@ -1341,7 +1341,7 @@ private V1Container getSpecContainer(V1Pod pod) { } @Test - public void whenExistingPodSpecHasK8sVolume_ignoreIt() { + void whenExistingPodSpecHasK8sVolume_ignoreIt() { verifyPodNotReplacedWhen( (pod) -> { pod.getSpec().addVolumesItem(new V1Volume().name("k8s")); @@ -1354,7 +1354,7 @@ public void whenExistingPodSpecHasK8sVolume_ignoreIt() { } @Test - public void whenExistingPodSpecHasK8sVolumeMount_ignoreIt() { + void whenExistingPodSpecHasK8sVolumeMount_ignoreIt() { verifyPodNotReplacedWhen( (pod) -> getSpecContainer(pod) @@ -1365,7 +1365,7 @@ public void whenExistingPodSpecHasK8sVolumeMount_ignoreIt() { } @Test - public void whenPodConfigurationAddsVolume_replacePod() { + void whenPodConfigurationAddsVolume_replacePod() { initializeExistingPod(); configureServer().withAdditionalVolume("dummy", "/dummy"); @@ -1374,7 +1374,7 @@ public void whenPodConfigurationAddsVolume_replacePod() { } @Test - public void whenPodConfigurationAddsImagePullSecret_replacePod() { + void whenPodConfigurationAddsImagePullSecret_replacePod() { initializeExistingPod(); configureDomain().withDefaultImagePullSecrets(new V1LocalObjectReference().name("secret")); @@ -1383,7 +1383,7 @@ public void whenPodConfigurationAddsImagePullSecret_replacePod() { } @Test - public void whenPodConfigurationAddsVolumeMount_replacePod() { + void whenPodConfigurationAddsVolumeMount_replacePod() { initializeExistingPod(); configureServer().withAdditionalVolumeMount("dummy", "/dummy"); @@ -1392,7 +1392,7 @@ public void whenPodConfigurationAddsVolumeMount_replacePod() { } @Test - public void whenPodConfigurationChangesImageName_replacePod() { + void whenPodConfigurationChangesImageName_replacePod() { initializeExistingPod(); configureDomain().withDefaultImage(VERSIONED_IMAGE); @@ -1401,7 +1401,7 @@ public void whenPodConfigurationChangesImageName_replacePod() { } @Test - public void whenPodConfigurationChangesImagePullPolicy_replacePod() { + void whenPodConfigurationChangesImagePullPolicy_replacePod() { initializeExistingPod(); configureDomain().withDefaultImagePullPolicy("NONE"); @@ -1410,7 +1410,7 @@ public void whenPodConfigurationChangesImagePullPolicy_replacePod() { } @Test - public void whenDomainConfigurationAddsRestartVersion_replacePod() { + void whenDomainConfigurationAddsRestartVersion_replacePod() { initializeExistingPod(); configureDomain().withRestartVersion("123"); @@ -1419,7 +1419,7 @@ public void whenDomainConfigurationAddsRestartVersion_replacePod() { } @Test - public void whenServerConfigurationAddsRestartVersion_replacePod() { + void whenServerConfigurationAddsRestartVersion_replacePod() { initializeExistingPod(); configureServer().withRestartVersion("123"); @@ -1428,7 +1428,7 @@ public void whenServerConfigurationAddsRestartVersion_replacePod() { } @Test - public void whenServerConfigurationAddsIntrospectionVersion_patchPod() { + void whenServerConfigurationAddsIntrospectionVersion_patchPod() { initializeExistingPod(); configurator.withIntrospectVersion("123"); @@ -1440,7 +1440,7 @@ public void whenServerConfigurationAddsIntrospectionVersion_patchPod() { } @Test - public void whenServerConfigurationIntrospectionVersionTheSame_dontPatchPod() { + void whenServerConfigurationIntrospectionVersionTheSame_dontPatchPod() { initializeExistingPodWithIntrospectVersion("123"); configurator.withIntrospectVersion("123"); @@ -1449,7 +1449,7 @@ public void whenServerConfigurationIntrospectionVersionTheSame_dontPatchPod() { } @Test - public void whenServerListenPortChanged_replacePod() { + void whenServerListenPortChanged_replacePod() { initializeExistingPod(); setServerPort(12345); @@ -1458,7 +1458,7 @@ public void whenServerListenPortChanged_replacePod() { } @Test - public void whenServerAddsNap_replacePod() { + void whenServerAddsNap_replacePod() { initializeExistingPod(); getServerTopology().addNetworkAccessPoint(new NetworkAccessPoint("nap1", "TCP", 1234, 9001)); @@ -1467,7 +1467,7 @@ public void whenServerAddsNap_replacePod() { } @Test - public void whenMiiSecretsHashChanged_replacePod() { + void whenMiiSecretsHashChanged_replacePod() { testSupport.addToPacket(SECRETS_MD_5, "originalSecret"); initializeExistingPod(); @@ -1477,7 +1477,7 @@ public void whenMiiSecretsHashChanged_replacePod() { } @Test - public void whenMiiDomainZipHashChanged_replacePod() { + void whenMiiDomainZipHashChanged_replacePod() { testSupport.addToPacket(DOMAINZIP_HASH, "originalSecret"); initializeExistingPod(); @@ -1487,14 +1487,14 @@ public void whenMiiDomainZipHashChanged_replacePod() { } @Test - public void whenMiiDynamicUpdateDynamicChangesOnlyButOnlineUpdateDisabled_replacePod() { + void whenMiiDynamicUpdateDynamicChangesOnlyButOnlineUpdateDisabled_replacePod() { initializeMiiUpdateTest(MII_DYNAMIC_UPDATE_SUCCESS); verifyPodReplaced(); } @Test - public void whenMiiDynamicUpdateDynamicChangesOnly_dontReplacePod() { + void whenMiiDynamicUpdateDynamicChangesOnly_dontReplacePod() { configureDomain().withMIIOnlineUpdate(); initializeMiiUpdateTest(MII_DYNAMIC_UPDATE_SUCCESS); @@ -1517,7 +1517,7 @@ private void disableAutoIntrospectOnNewMiiPods() { } @Test - public void whenMiiDynamicUpdateDynamicChangesOnly_updateDomainZipHash() { + void whenMiiDynamicUpdateDynamicChangesOnly_updateDomainZipHash() { configureDomain().withMIIOnlineUpdate(); initializeMiiUpdateTest(MII_DYNAMIC_UPDATE_SUCCESS); @@ -1527,7 +1527,7 @@ public void whenMiiDynamicUpdateDynamicChangesOnly_updateDomainZipHash() { } @Test - public void whenMiiOnlineUpdateSettingEnabled_dontReplacePod() { + void whenMiiOnlineUpdateSettingEnabled_dontReplacePod() { testSupport.addToPacket(DOMAINZIP_HASH, "originalZip"); disableAutoIntrospectOnNewMiiPods(); initializeExistingPod(); @@ -1541,7 +1541,7 @@ private String getPodLabel(String labelName) { } @Test - public void whenMiiNonDynamicUpdateDynamicChangesCommitOnly_dontReplacePod() { + void whenMiiNonDynamicUpdateDynamicChangesCommitOnly_dontReplacePod() { configureDomain().withMIIOnlineUpdate(); initializeMiiUpdateTest(MII_DYNAMIC_UPDATE_RESTART_REQUIRED); @@ -1549,7 +1549,7 @@ public void whenMiiNonDynamicUpdateDynamicChangesCommitOnly_dontReplacePod() { } @Test - public void whenMiiNonDynamicUpdateDynamicChangesCommitOnly_addRestartRequiredLabel() { + void whenMiiNonDynamicUpdateDynamicChangesCommitOnly_addRestartRequiredLabel() { configureDomain().withMIIOnlineUpdate(); initializeMiiUpdateTest(MII_DYNAMIC_UPDATE_RESTART_REQUIRED); @@ -1557,7 +1557,7 @@ public void whenMiiNonDynamicUpdateDynamicChangesCommitOnly_addRestartRequiredLa } @Test - public void whenMiiNonDynamicUpdateDynamicChangesCommitAndRoll_replacePod() { + void whenMiiNonDynamicUpdateDynamicChangesCommitAndRoll_replacePod() { configureDomain().withMIIOnlineUpdateOnDynamicChangesUpdateAndRoll(); initializeMiiUpdateTest(MII_DYNAMIC_UPDATE_RESTART_REQUIRED); @@ -1569,7 +1569,7 @@ private String paddedZipHash(String hash) { } @Test - public void whenNoPod_onFiveHundred() { + void whenNoPod_onFiveHundred() { testSupport.addRetryStrategy(retryStrategy); testSupport.failOnCreate(KubernetesTestSupport.POD, getPodName(), NS, 500); @@ -1582,7 +1582,7 @@ public void whenNoPod_onFiveHundred() { } @Test - public void whenCompliantPodExists_logIt() { + void whenCompliantPodExists_logIt() { initializeExistingPod(); testSupport.runSteps(getStepFactory(), terminalStep); @@ -1741,14 +1741,14 @@ static V1EnvVar createSecretKeyRefEnvVar(String name, String secretName, String abstract List createStartCommand(); @Test - public void whenDomainPresenceInfoLacksImageName_createdPodUsesDefaultImage() { + void whenDomainPresenceInfoLacksImageName_createdPodUsesDefaultImage() { configureDomain().withDefaultImage(null); assertThat(getCreatedPodSpecContainer().getImage(), equalTo(DEFAULT_IMAGE)); } @Test - public void verifyStandardVolumes() { + void verifyStandardVolumes() { assertThat( getCreatedPod().getSpec().getVolumes(), allOf(hasItem(volume(INTROSPECTOR_VOLUME, UID + INTROSPECTOR_CONFIG_MAP_NAME_SUFFIX)), @@ -1757,7 +1757,7 @@ public void verifyStandardVolumes() { } @Test - public void whenIntrospectionCreatesMultipleConfigMaps_createCorrespondingVolumes() { + void whenIntrospectionCreatesMultipleConfigMaps_createCorrespondingVolumes() { testSupport.addToPacket(NUM_CONFIG_MAPS, "3"); assertThat( @@ -1768,7 +1768,7 @@ public void whenIntrospectionCreatesMultipleConfigMaps_createCorrespondingVolume } @Test - public void whenDomainHasAdditionalVolumes_createPodWithThem() { + void whenDomainHasAdditionalVolumes_createPodWithThem() { getConfigurator() .withAdditionalVolume("volume1", "/source-path1") .withAdditionalVolume("volume2", "/source-path2"); @@ -1779,7 +1779,7 @@ public void whenDomainHasAdditionalVolumes_createPodWithThem() { } @Test - public void whenDomainHasAdditionalPvClaimVolume_createPodWithIt() { + void whenDomainHasAdditionalPvClaimVolume_createPodWithIt() { getConfigurator() .withAdditionalPvClaimVolume("volume1", "myPersistentVolumeClaim"); @@ -1789,7 +1789,7 @@ public void whenDomainHasAdditionalPvClaimVolume_createPodWithIt() { } @Test - public void whenDomainHasAdditionalVolumeMounts_createAdminPodWithThem() { + void whenDomainHasAdditionalVolumeMounts_createAdminPodWithThem() { getConfigurator() .withAdditionalVolumeMount("volume1", "/destination-path1") .withAdditionalVolumeMount("volume2", "/destination-path2"); @@ -1801,7 +1801,7 @@ public void whenDomainHasAdditionalVolumeMounts_createAdminPodWithThem() { } @Test - public void whenDomainHasAffinity_createPodWithIt() { + void whenDomainHasAffinity_createPodWithIt() { getConfigurator() .withAffinity(affinity); @@ -1811,7 +1811,7 @@ public void whenDomainHasAffinity_createPodWithIt() { } @Test - public void whenServerHasAffinity_createPodWithIt() { + void whenServerHasAffinity_createPodWithIt() { configureServer() .withAffinity(affinity); @@ -1821,7 +1821,7 @@ public void whenServerHasAffinity_createPodWithIt() { } @Test - public void whenDomainHasNodeSelector_createPodWithIt() { + void whenDomainHasNodeSelector_createPodWithIt() { getConfigurator() .withNodeSelector("os_arch", "x86_64"); @@ -1831,7 +1831,7 @@ public void whenDomainHasNodeSelector_createPodWithIt() { } @Test - public void whenServerHasNodeSelector_createPodWithIt() { + void whenServerHasNodeSelector_createPodWithIt() { configureServer() .withNodeSelector("os_arch", "x86_64"); @@ -1841,7 +1841,7 @@ public void whenServerHasNodeSelector_createPodWithIt() { } @Test - public void whenDomainHasNodeName_createPodWithIt() { + void whenDomainHasNodeName_createPodWithIt() { getConfigurator() .withNodeName("kube-01"); @@ -1851,7 +1851,7 @@ public void whenDomainHasNodeName_createPodWithIt() { } @Test - public void whenServerHasNodeName_createPodWithIt() { + void whenServerHasNodeName_createPodWithIt() { configureServer() .withNodeName("kube-01"); @@ -1861,7 +1861,7 @@ public void whenServerHasNodeName_createPodWithIt() { } @Test - public void whenDomainHasSchedulerName_createPodWithIt() { + void whenDomainHasSchedulerName_createPodWithIt() { getConfigurator() .withSchedulerName("my-scheduler"); @@ -1871,7 +1871,7 @@ public void whenDomainHasSchedulerName_createPodWithIt() { } @Test - public void whenServerHasSchedulerName_createPodWithIt() { + void whenServerHasSchedulerName_createPodWithIt() { configureServer() .withSchedulerName("my-scheduler"); @@ -1881,7 +1881,7 @@ public void whenServerHasSchedulerName_createPodWithIt() { } @Test - public void whenDomainHasRuntimeClassName_createPodWithIt() { + void whenDomainHasRuntimeClassName_createPodWithIt() { getConfigurator() .withRuntimeClassName("RuntimeClassName"); @@ -1891,7 +1891,7 @@ public void whenDomainHasRuntimeClassName_createPodWithIt() { } @Test - public void whenServerHasRuntimeClassName_createPodWithIt() { + void whenServerHasRuntimeClassName_createPodWithIt() { configureServer() .withRuntimeClassName("RuntimeClassName"); @@ -1901,7 +1901,7 @@ public void whenServerHasRuntimeClassName_createPodWithIt() { } @Test - public void whenDomainHasPriorityClassName_createPodWithIt() { + void whenDomainHasPriorityClassName_createPodWithIt() { getConfigurator() .withPriorityClassName("PriorityClassName"); @@ -1911,7 +1911,7 @@ public void whenDomainHasPriorityClassName_createPodWithIt() { } @Test - public void whenServerHasPriorityClassName_createPodWithIt() { + void whenServerHasPriorityClassName_createPodWithIt() { configureServer() .withPriorityClassName("PriorityClassName"); @@ -1921,7 +1921,7 @@ public void whenServerHasPriorityClassName_createPodWithIt() { } @Test - public void whenDomainHasRestartPolicy_createPodWithIt() { + void whenDomainHasRestartPolicy_createPodWithIt() { getConfigurator() .withRestartPolicy("Always"); @@ -1931,7 +1931,7 @@ public void whenDomainHasRestartPolicy_createPodWithIt() { } @Test - public void whenServerHasRestartPolicy_createPodWithIt() { + void whenServerHasRestartPolicy_createPodWithIt() { configureServer() .withRestartPolicy("Always"); @@ -1941,7 +1941,7 @@ public void whenServerHasRestartPolicy_createPodWithIt() { } @Test - public void whenDomainHasPodSecurityContext_createPodWithIt() { + void whenDomainHasPodSecurityContext_createPodWithIt() { getConfigurator() .withPodSecurityContext(podSecurityContext); @@ -1951,7 +1951,7 @@ public void whenDomainHasPodSecurityContext_createPodWithIt() { } @Test - public void whenServerHasPodSecurityContext_createPodWithIt() { + void whenServerHasPodSecurityContext_createPodWithIt() { configureServer() .withPodSecurityContext(podSecurityContext); @@ -1961,7 +1961,7 @@ public void whenServerHasPodSecurityContext_createPodWithIt() { } @Test - public void whenDomainHasContainerSecurityContext_createContainersWithIt() { + void whenDomainHasContainerSecurityContext_createContainersWithIt() { getConfigurator() .withContainerSecurityContext(containerSecurityContext); @@ -1972,7 +1972,7 @@ public void whenDomainHasContainerSecurityContext_createContainersWithIt() { } @Test - public void whenServerHasContainerSecurityContext_createContainersWithIt() { + void whenServerHasContainerSecurityContext_createContainersWithIt() { configureServer() .withContainerSecurityContext(containerSecurityContext); @@ -1983,7 +1983,7 @@ public void whenServerHasContainerSecurityContext_createContainersWithIt() { } @Test - public void whenServerHasResources_createContainersWithThem() { + void whenServerHasResources_createContainersWithThem() { configureServer() .withLimitRequirement("cpu", "1Gi") .withRequestRequirement("memory", "250m"); @@ -1995,7 +1995,7 @@ public void whenServerHasResources_createContainersWithThem() { } @Test - public void whenDomainHasResources_createContainersWithThem() { + void whenDomainHasResources_createContainersWithThem() { getConfigurator() .withLimitRequirement("cpu", "1Gi") .withRequestRequirement("memory", "250m"); @@ -2007,7 +2007,7 @@ public void whenDomainHasResources_createContainersWithThem() { } @Test - public void whenPodCreated_createPodWithOwnerReference() { + void whenPodCreated_createPodWithOwnerReference() { V1OwnerReference expectedReference = new V1OwnerReference() .apiVersion(KubernetesConstants.DOMAIN_GROUP + "/" + KubernetesConstants.DOMAIN_VERSION) .kind(KubernetesConstants.DOMAIN) @@ -2020,7 +2020,7 @@ public void whenPodCreated_createPodWithOwnerReference() { @Test - public void whenDomainHomeChanged_domainRollStartEventCreatedWithCorrectMessage() + void whenDomainHomeChanged_domainRollStartEventCreatedWithCorrectMessage() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { initializeExistingPod(); getConfiguredDomainSpec().setDomainHome("adfgg"); @@ -2035,7 +2035,7 @@ public void whenDomainHomeChanged_domainRollStartEventCreatedWithCorrectMessage( } @Test - public void whenDomainHomeChanged_domainRollStartEventCreatedWithCorrectNS() + void whenDomainHomeChanged_domainRollStartEventCreatedWithCorrectNS() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { initializeExistingPod(); getConfiguredDomainSpec().setDomainHome("adfgg"); @@ -2047,7 +2047,7 @@ public void whenDomainHomeChanged_domainRollStartEventCreatedWithCorrectNS() } @Test - public void whenDomainHomeChanged_butEventAlreadyGenerated_dontCreateDomainRollStartEvent() + void whenDomainHomeChanged_butEventAlreadyGenerated_dontCreateDomainRollStartEvent() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { initializeExistingPod(); testSupport.addToPacket(DOMAIN_ROLL_START_EVENT_GENERATED, "true"); @@ -2062,7 +2062,7 @@ public void whenDomainHomeChanged_butEventAlreadyGenerated_dontCreateDomainRollS } @Test - public void whenImageChanged_domainRollStartEventCreatedWithCorrectMessage() + void whenImageChanged_domainRollStartEventCreatedWithCorrectMessage() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { initializeExistingPod(); getConfiguredDomainSpec().setImage("adfgg"); @@ -2077,7 +2077,7 @@ public void whenImageChanged_domainRollStartEventCreatedWithCorrectMessage() } @Test - public void whenImageChanged_expectedLogMessageFound() + void whenImageChanged_expectedLogMessageFound() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { consoleHandlerMemento.collectLogMessages(logRecords, getDomainRollStartingKey()); initializeExistingPod(); @@ -2090,7 +2090,7 @@ public void whenImageChanged_expectedLogMessageFound() } @Test - public void whenInitContainerLivenessProbeChanged_domainRollStartEventCreatedWithCorrectMessage() { + void whenInitContainerLivenessProbeChanged_domainRollStartEventCreatedWithCorrectMessage() { initializeExistingPod(); getConfigurator() .withContainer(new V1Container().livenessProbe(new V1Probe().periodSeconds(123))); @@ -2105,7 +2105,7 @@ public void whenInitContainerLivenessProbeChanged_domainRollStartEventCreatedWit } @Test - public void whenDefaultReadinessProbeChanged_domainRollStartEventCreatedWithCorrectMessage() { + void whenDefaultReadinessProbeChanged_domainRollStartEventCreatedWithCorrectMessage() { initializeExistingPod(); getConfigurator() .withDefaultReadinessProbeSettings(12, 23, 45); @@ -2121,7 +2121,7 @@ public void whenDefaultReadinessProbeChanged_domainRollStartEventCreatedWithCorr } @Test - public void whenDefaultLivenessProbeChanged_domainRollStartEventCreatedWithCorrectMessage() { + void whenDefaultLivenessProbeChanged_domainRollStartEventCreatedWithCorrectMessage() { initializeExistingPod(); getConfigurator() .withDefaultLivenessProbeSettings(12, 23, 45); @@ -2137,7 +2137,7 @@ public void whenDefaultLivenessProbeChanged_domainRollStartEventCreatedWithCorre } @Test - public void whenDomainZipHashChanged_domainRollStartEventCreatedWithCorrectMessage() { + void whenDomainZipHashChanged_domainRollStartEventCreatedWithCorrectMessage() { initializeExistingPod(); disableAutoIntrospectOnNewMiiPods(); testSupport.addToPacket(DOMAINZIP_HASH, "1234"); @@ -2152,7 +2152,7 @@ public void whenDomainZipHashChanged_domainRollStartEventCreatedWithCorrectMessa } @Test - public void whenDomainZipHashChanged_butIsMIIDynamicUpdate_dontCreateDomainRollStartEvent() { + void whenDomainZipHashChanged_butIsMIIDynamicUpdate_dontCreateDomainRollStartEvent() { initializeExistingPod(); disableAutoIntrospectOnNewMiiPods(); testSupport.addToPacket(DOMAINZIP_HASH, "1234"); @@ -2169,7 +2169,7 @@ public void whenDomainZipHashChanged_butIsMIIDynamicUpdate_dontCreateDomainRollS } @Test - public void whenImageDomainHomeAndRestartVersionChanged_expectedLogMessageFound() + void whenImageDomainHomeAndRestartVersionChanged_expectedLogMessageFound() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { consoleHandlerMemento.collectLogMessages(logRecords, getDomainRollStartingKey()); initializeExistingPod(); @@ -2184,7 +2184,7 @@ public void whenImageDomainHomeAndRestartVersionChanged_expectedLogMessageFound( } @Test - public void whenImageDomainHomeAndRestartVersionChanged_domainRollStartEventCreatedWithCorrectMessage() + void whenImageDomainHomeAndRestartVersionChanged_domainRollStartEventCreatedWithCorrectMessage() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { consoleHandlerMemento.collectLogMessages(logRecords, getDomainRollStartingKey()); initializeExistingPod(); @@ -2211,7 +2211,7 @@ public void whenImageDomainHomeAndRestartVersionChanged_domainRollStartEventCrea } @Test - public void whenImageDomainHomeAndWebLogicZipHashChanged_domainRollStartEventCreatedWithCorrectMessage() + void whenImageDomainHomeAndWebLogicZipHashChanged_domainRollStartEventCreatedWithCorrectMessage() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { consoleHandlerMemento.collectLogMessages(logRecords, getDomainRollStartingKey()); initializeExistingPod(); @@ -2240,7 +2240,7 @@ public void whenImageDomainHomeAndWebLogicZipHashChanged_domainRollStartEventCre } @Test - public void whenInitContainerLivenessProbeAndWebLogicZipHashChanged_domainRollStartEventCreatedWithCorrectMessage() { + void whenInitContainerLivenessProbeAndWebLogicZipHashChanged_domainRollStartEventCreatedWithCorrectMessage() { initializeExistingPod(); getConfigurator() .withContainer(new V1Container().livenessProbe(new V1Probe().periodSeconds(123))); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/PodPresenceTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/PodPresenceTest.java index 36b268f6b66..99405cd71de 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/PodPresenceTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/PodPresenceTest.java @@ -54,7 +54,7 @@ import static org.hamcrest.Matchers.sameInstance; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class PodPresenceTest { +class PodPresenceTest { private static final String CLUSTER = "cluster1"; private static final String SERVER = "server1"; @@ -119,26 +119,26 @@ public void tearDown() { } @Test - public void whenPodHasNoStatus_reportNotReady() { + void whenPodHasNoStatus_reportNotReady() { MatcherAssert.assertThat(PodHelper.isReady(pod), is(false)); } @Test - public void whenPodPhaseNotRunning_reportNotReady() { + void whenPodPhaseNotRunning_reportNotReady() { pod.status(new V1PodStatus()); MatcherAssert.assertThat(PodHelper.isReady(pod), is(false)); } @Test - public void whenPodRunningButNoConditionsDefined_reportNotReady() { + void whenPodRunningButNoConditionsDefined_reportNotReady() { pod.status(new V1PodStatus().phase("Running")); MatcherAssert.assertThat(PodHelper.isReady(pod), is(false)); } @Test - public void whenPodRunningButNoReadyConditionsDefined_reportNotReady() { + void whenPodRunningButNoReadyConditionsDefined_reportNotReady() { List conditions = Collections.singletonList(new V1PodCondition().type("Huge")); pod.status(new V1PodStatus().phase("Running").conditions(conditions)); @@ -146,7 +146,7 @@ public void whenPodRunningButNoReadyConditionsDefined_reportNotReady() { } @Test - public void whenPodRunningButReadyConditionIsNotTrue_reportNotReady() { + void whenPodRunningButReadyConditionIsNotTrue_reportNotReady() { List conditions = Collections.singletonList(new V1PodCondition().type("Ready").status("False")); pod.status(new V1PodStatus().phase("Running").conditions(conditions)); @@ -155,7 +155,7 @@ public void whenPodRunningButReadyConditionIsNotTrue_reportNotReady() { } @Test - public void whenPodRunningAndReadyConditionIsTrue_reportReady() { + void whenPodRunningAndReadyConditionIsTrue_reportReady() { makePodReady(pod); MatcherAssert.assertThat(PodHelper.isReady(pod), is(true)); @@ -168,19 +168,19 @@ private void makePodReady(V1Pod pod) { } @Test - public void whenPodHasNoStatus_reportNotFailed() { + void whenPodHasNoStatus_reportNotFailed() { MatcherAssert.assertThat(PodHelper.isFailed(pod), is(false)); } @Test - public void whenPodPhaseNotFailed_reportNotFailed() { + void whenPodPhaseNotFailed_reportNotFailed() { pod.status(new V1PodStatus().phase("Running")); MatcherAssert.assertThat(PodHelper.isFailed(pod), is(false)); } @Test - public void whenPodPhaseIsFailed_reportFailed() { + void whenPodPhaseIsFailed_reportFailed() { pod.status(new V1PodStatus().phase("Failed")); MatcherAssert.assertThat(PodHelper.isFailed(pod), is(true)); @@ -188,27 +188,27 @@ public void whenPodPhaseIsFailed_reportFailed() { @SuppressWarnings("ConstantConditions") @Test - public void whenPodHasNoDomainUid_returnNull() { + void whenPodHasNoDomainUid_returnNull() { pod.getMetadata().getLabels().remove(DOMAINUID_LABEL); MatcherAssert.assertThat(PodHelper.getPodDomainUid(pod), nullValue()); } @SuppressWarnings("ConstantConditions") @Test - public void whenPodHasDomainUid_returnIt() { + void whenPodHasDomainUid_returnIt() { pod.getMetadata().labels(ImmutableMap.of(DOMAINUID_LABEL, "domain1")); MatcherAssert.assertThat(PodHelper.getPodDomainUid(pod), equalTo("domain1")); } @Test - public void whenPodHasNoServerName_returnNull() { + void whenPodHasNoServerName_returnNull() { MatcherAssert.assertThat(PodHelper.getPodServerName(pod), nullValue()); } @SuppressWarnings("ConstantConditions") @Test - public void whenPodHasServerName_returnIt() { + void whenPodHasServerName_returnIt() { pod.getMetadata().labels(ImmutableMap.of(SERVERNAME_LABEL, "myserver")); MatcherAssert.assertThat(PodHelper.getPodServerName(pod), equalTo("myserver")); @@ -219,7 +219,7 @@ public void whenPodHasServerName_returnIt() { // the timestamps for services increment with each creation @Test - public void onAddEventWithNoRecordedServerPod_addIt() { + void onAddEventWithNoRecordedServerPod_addIt() { V1Pod newPod = createServerPod(); Watch.Response event = WatchEvent.createAddedEvent(newPod).toWatchResponse(); @@ -229,7 +229,7 @@ public void onAddEventWithNoRecordedServerPod_addIt() { } @Test - public void onAddEventWithNewerServerPod_replaceCurrentValue() { + void onAddEventWithNewerServerPod_replaceCurrentValue() { V1Pod currentPod = createServerPod(); V1Pod newerPod = createServerPod(); info.setServerPod(SERVER, currentPod); @@ -241,7 +241,7 @@ public void onAddEventWithNewerServerPod_replaceCurrentValue() { } @Test - public void onAddEventWithOlderServerPod_keepCurrentValue() { + void onAddEventWithOlderServerPod_keepCurrentValue() { V1Pod olderPod = createServerPod(); V1Pod currentPod = createServerPod(); info.setServerPod(SERVER, currentPod); @@ -253,7 +253,7 @@ public void onAddEventWithOlderServerPod_keepCurrentValue() { } @Test - public void onModifyEventWithNoRecordedServerPod_addIt() { + void onModifyEventWithNoRecordedServerPod_addIt() { V1Pod pod = createServerPod(); Watch.Response event = WatchEvent.createModifiedEvent(pod).toWatchResponse(); @@ -263,7 +263,7 @@ public void onModifyEventWithNoRecordedServerPod_addIt() { } @Test - public void onModifyEventWithNewerServerPod_replaceCurrentValue() { + void onModifyEventWithNewerServerPod_replaceCurrentValue() { V1Pod currentPod = createServerPod(); V1Pod newPod = createServerPod(); info.setServerPod(SERVER, currentPod); @@ -275,7 +275,7 @@ public void onModifyEventWithNewerServerPod_replaceCurrentValue() { } @Test - public void onModifyEventWithOlderServerPod_keepCurrentValue() { + void onModifyEventWithOlderServerPod_keepCurrentValue() { V1Pod olderPod = createServerPod(); V1Pod currentPod = createServerPod(); info.setServerPod(SERVER, currentPod); @@ -287,7 +287,7 @@ public void onModifyEventWithOlderServerPod_keepCurrentValue() { } @Test - public void onModifyEventWithPodNotReadyAndOldStatusRunning_setLastKnownStatusNull() { + void onModifyEventWithPodNotReadyAndOldStatusRunning_setLastKnownStatusNull() { V1Pod eventPod = createServerPod(); V1Pod currentPod = createServerPod(); info.updateLastKnownServerStatus(SERVER, RUNNING_STATE); @@ -300,7 +300,7 @@ public void onModifyEventWithPodNotReadyAndOldStatusRunning_setLastKnownStatusNu } @Test - public void onModifyEventWithPodNotReadyAndOldStatusNotRunning_dontChangeIt() { + void onModifyEventWithPodNotReadyAndOldStatusNotRunning_dontChangeIt() { V1Pod eventPod = createServerPod(); V1Pod currentPod = createServerPod(); info.updateLastKnownServerStatus(SERVER, SUSPENDING_STATE); @@ -313,7 +313,7 @@ public void onModifyEventWithPodNotReadyAndOldStatusNotRunning_dontChangeIt() { } @Test - public void onModifyEventWithPodReady_setLastKnownStatusRunning() { + void onModifyEventWithPodReady_setLastKnownStatusRunning() { V1Pod eventPod = createServerPod(); V1Pod currentPod = createServerPod(); makePodReady(eventPod); @@ -326,7 +326,7 @@ public void onModifyEventWithPodReady_setLastKnownStatusRunning() { } @Test - public void onDeleteEventWithNoRecordedServerPod_ignoreIt() { + void onDeleteEventWithNoRecordedServerPod_ignoreIt() { V1Pod service = createServerPod(); Watch.Response event = WatchEvent.createDeletedEvent(service).toWatchResponse(); @@ -336,7 +336,7 @@ public void onDeleteEventWithNoRecordedServerPod_ignoreIt() { } @Test - public void onDeleteEventWithOlderServerPod_keepCurrentValue() { + void onDeleteEventWithOlderServerPod_keepCurrentValue() { V1Pod oldPod = createServerPod(); V1Pod currentPod = createServerPod(); info.setServerPod(SERVER, currentPod); @@ -348,7 +348,7 @@ public void onDeleteEventWithOlderServerPod_keepCurrentValue() { } @Test - public void onDeleteEventWithSameServerPod_removeIt() { + void onDeleteEventWithSameServerPod_removeIt() { V1Pod currentPod = createServerPod(); info.setServerPod(SERVER, currentPod); Watch.Response event = WatchEvent.createDeletedEvent(currentPod).toWatchResponse(); @@ -359,7 +359,7 @@ public void onDeleteEventWithSameServerPod_removeIt() { } @Test - public void onDeleteEventWithNewerServerPod_removeIt() { + void onDeleteEventWithNewerServerPod_removeIt() { V1Pod currentPod = createServerPod(); V1Pod newerPod = createServerPod(); info.setServerPod(SERVER, currentPod); @@ -371,7 +371,7 @@ public void onDeleteEventWithNewerServerPod_removeIt() { } @Test - public void afterDeleteEvent_setLastKnownStatus_Shutdown() { + void afterDeleteEvent_setLastKnownStatus_Shutdown() { V1Pod currentPod = createServerPod(); V1Pod newerPod = createServerPod(); info.setServerPod(SERVER, currentPod); @@ -383,7 +383,7 @@ public void afterDeleteEvent_setLastKnownStatus_Shutdown() { } @Test - public void afterDeleteEvent_restoreRequiredPod() { + void afterDeleteEvent_restoreRequiredPod() { enableDomainProcessing(); V1Pod currentPod = createServerPod(); V1Pod newerPod = createServerPod(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/ResourceVersionTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/ResourceVersionTest.java index 9485e8d75d2..02b3789e5e7 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/ResourceVersionTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/ResourceVersionTest.java @@ -17,10 +17,10 @@ import static org.junit.Assert.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -public class ResourceVersionTest { +class ResourceVersionTest { @Test - public void whenWellFormed_createIt() { + void whenWellFormed_createIt() { new ResourceVersion("v1"); new ResourceVersion("v3"); new ResourceVersion("v27"); @@ -37,14 +37,14 @@ public void whenWellFormed_createIt() { } @Test - public void whenNotWellFormedButLegal_createIt() { + void whenNotWellFormedButLegal_createIt() { new ResourceVersion("token20"); new ResourceVersion("r100"); new ResourceVersion("prefix3"); } @Test - public void whenParsed_verifyVersions() { + void whenParsed_verifyVersions() { ResourceVersion rv; rv = new ResourceVersion("v1"); assertThat(rv.getVersion(), equalTo(1)); @@ -57,7 +57,7 @@ public void whenParsed_verifyVersions() { } @Test - public void whenNotWellFormedButLegalParsed_verifyVersions() { + void whenNotWellFormedButLegalParsed_verifyVersions() { ResourceVersion rv; rv = new ResourceVersion("token20"); assertThat(rv.getVersion(), equalTo(20)); @@ -70,7 +70,7 @@ public void whenNotWellFormedButLegalParsed_verifyVersions() { } @Test - public void whenParsed_verifyWellFormed() { + void whenParsed_verifyWellFormed() { ResourceVersion rv; rv = new ResourceVersion("v1"); assert (rv.isWellFormed()); @@ -92,7 +92,7 @@ public void whenParsed_verifyWellFormed() { } @Test - public void whenParsed_verifyPrefix() { + void whenParsed_verifyPrefix() { ResourceVersion rv; rv = new ResourceVersion("v1"); assertThat(rv.getPrefix(), equalTo("v")); @@ -108,7 +108,7 @@ public void whenParsed_verifyPrefix() { } @Test - public void whenParsed_verifyPrerelease() { + void whenParsed_verifyPrerelease() { ResourceVersion rv; rv = new ResourceVersion("v1"); assertNull(rv.getPrerelease()); @@ -118,7 +118,7 @@ public void whenParsed_verifyPrerelease() { } @Test - public void whenParsed_verifyPrereleaseVersion() { + void whenParsed_verifyPrereleaseVersion() { ResourceVersion rv; rv = new ResourceVersion("v1"); assertNull(rv.getPrereleaseVersion()); @@ -128,37 +128,37 @@ public void whenParsed_verifyPrereleaseVersion() { } @Test - public void whenNoDigits_throwIllegalArgument() { + void whenNoDigits_throwIllegalArgument() { assertThrows(IllegalArgumentException.class, () -> new ResourceVersion("nonumber")); } @Test - public void whenOnlyNumber_throwIllegalArgument() { + void whenOnlyNumber_throwIllegalArgument() { assertThrows(IllegalArgumentException.class, () -> new ResourceVersion("3")); } @Test - public void whenNumberFirst_throwIllegalArgument() { + void whenNumberFirst_throwIllegalArgument() { assertThrows(IllegalArgumentException.class, () -> new ResourceVersion("555v")); } @Test - public void whenIllegalPrerelease_throwIllegalArgument() { + void whenIllegalPrerelease_throwIllegalArgument() { assertThrows(IllegalArgumentException.class, () -> new ResourceVersion("v10gamma12")); } @Test - public void whenExtraTokenAlpha_throwIllegalArgument() { + void whenExtraTokenAlpha_throwIllegalArgument() { assertThrows(IllegalArgumentException.class, () -> new ResourceVersion("v5alpha7t")); } @Test - public void whenExtraTokenBeta_throwIllegalArgument() { + void whenExtraTokenBeta_throwIllegalArgument() { assertThrows(IllegalArgumentException.class, () -> new ResourceVersion("v3beta1alpha")); } @Test - public void whenMultipleValues_sort() { + void whenMultipleValues_sort() { List values = Arrays.asList( "v11beta2", @@ -194,7 +194,7 @@ public void whenMultipleValues_sort() { } @Test - public void whenUsedInMap_findCorrectValue() { + void whenUsedInMap_findCorrectValue() { Map map = new HashMap<>(); map.put(new ResourceVersion("v1"), "value"); map.put(new ResourceVersion("v2"), "value2"); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/RollingHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/RollingHelperTest.java index 96774cde4cf..2496a9d7670 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/RollingHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/RollingHelperTest.java @@ -61,7 +61,7 @@ import static org.hamcrest.Matchers.stringContainsInOrder; import static org.hamcrest.collection.IsEmptyCollection.empty; -public class RollingHelperTest { +class RollingHelperTest { private static final String ADMIN_SERVER = "ADMIN_SERVER"; private static final Integer ADMIN_PORT = 7001; @@ -196,7 +196,7 @@ private void initializeExistingPod(String serverName) { } @Test - public void verifyThatManagedServerPodsAreReplacedInOrder() { + void verifyThatManagedServerPodsAreReplacedInOrder() { initializeExistingPods(); testSupport.addToPacket(SERVERS_TO_ROLL, rolling); SERVER_NAMES.forEach(s -> rolling.put(s, createRollingStepAndPacket(s))); @@ -212,7 +212,7 @@ public void verifyThatManagedServerPodsAreReplacedInOrder() { } @Test - public void verifyThatWhenRollingIsEmpty_NoManagedServerPodsAreReplaced() { + void verifyThatWhenRollingIsEmpty_NoManagedServerPodsAreReplaced() { initializeExistingPods(); testSupport.addToPacket(SERVERS_TO_ROLL, rolling); @@ -222,7 +222,7 @@ public void verifyThatWhenRollingIsEmpty_NoManagedServerPodsAreReplaced() { } @Test - public void afterRoll_domainRollCompletedEventCreated() { + void afterRoll_domainRollCompletedEventCreated() { initializeExistingPods(); testSupport.addToPacket(SERVERS_TO_ROLL, rolling); testSupport.addToPacket(DOMAIN_ROLL_START_EVENT_GENERATED, "true"); @@ -236,7 +236,7 @@ public void afterRoll_domainRollCompletedEventCreated() { } @Test - public void afterRoll_expectedLogMessageFound() { + void afterRoll_expectedLogMessageFound() { initializeExistingPods(); testSupport.addToPacket(SERVERS_TO_ROLL, rolling); testSupport.addToPacket(DOMAIN_ROLL_START_EVENT_GENERATED, "true"); @@ -255,7 +255,7 @@ public void afterRoll_expectedLogMessageFound() { } @Test - public void whenRolling_podCycleEventCreatedWithCorrectMessage() { + void whenRolling_podCycleEventCreatedWithCorrectMessage() { initializeExistingPods(); testSupport.addToPacket(SERVERS_TO_ROLL, rolling); testSupport.addToPacket(DOMAIN_ROLL_START_EVENT_GENERATED, "true"); @@ -272,7 +272,7 @@ public void whenRolling_podCycleEventCreatedWithCorrectMessage() { } @Test - public void whenDomainHomeAndRestartVersionChanged_podCycleEventCreatedWithCorrectMessage() { + void whenDomainHomeAndRestartVersionChanged_podCycleEventCreatedWithCorrectMessage() { initializeExistingPods(); testSupport.addToPacket(SERVERS_TO_ROLL, rolling); testSupport.addToPacket(DOMAIN_ROLL_START_EVENT_GENERATED, "true"); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/SecretHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/SecretHelperTest.java index 448aa8de69d..10686ba5f02 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/SecretHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/SecretHelperTest.java @@ -31,7 +31,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class SecretHelperTest { +class SecretHelperTest { private static final String USERNAME = "itsMe"; private static final String PASSWORD = "shhh"; diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/SemanticVersionTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/SemanticVersionTest.java index 17ce8e99872..d1c22f04bc0 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/SemanticVersionTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/SemanticVersionTest.java @@ -10,10 +10,10 @@ import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.lessThan; -public class SemanticVersionTest { +class SemanticVersionTest { @Test - public void whenVersionsSame_compareReportsZero() { + void whenVersionsSame_compareReportsZero() { SemanticVersion first = new SemanticVersion("5.6.7"); SemanticVersion second = new SemanticVersion("5.6.7"); @@ -21,7 +21,7 @@ public void whenVersionsSame_compareReportsZero() { } @Test - public void whenVersionsSameWithDefaultRevisionZero_compareReportsZero() { + void whenVersionsSameWithDefaultRevisionZero_compareReportsZero() { SemanticVersion first = new SemanticVersion("5.6"); SemanticVersion second = new SemanticVersion("5.6.0"); @@ -29,7 +29,7 @@ public void whenVersionsSameWithDefaultRevisionZero_compareReportsZero() { } @Test - public void whenMajorVersionIsLower_compareReportsLower() { + void whenMajorVersionIsLower_compareReportsLower() { SemanticVersion first = new SemanticVersion("5.6.7"); SemanticVersion second = new SemanticVersion("10.3.4"); @@ -37,7 +37,7 @@ public void whenMajorVersionIsLower_compareReportsLower() { } @Test - public void whenMajorVersionIsGreater_compareReportsGreater() { + void whenMajorVersionIsGreater_compareReportsGreater() { SemanticVersion first = new SemanticVersion("5.6.7"); SemanticVersion second = new SemanticVersion("2.8.9"); @@ -45,7 +45,7 @@ public void whenMajorVersionIsGreater_compareReportsGreater() { } @Test - public void whenMinorVersionIsLower_compareReportsLower() { + void whenMinorVersionIsLower_compareReportsLower() { SemanticVersion first = new SemanticVersion("5.6.7"); SemanticVersion second = new SemanticVersion("5.7.2"); @@ -53,7 +53,7 @@ public void whenMinorVersionIsLower_compareReportsLower() { } @Test - public void whenMinorVersionIsGreater_compareReportsGreater() { + void whenMinorVersionIsGreater_compareReportsGreater() { SemanticVersion first = new SemanticVersion("5.6.7"); SemanticVersion second = new SemanticVersion("5.5.9"); @@ -61,7 +61,7 @@ public void whenMinorVersionIsGreater_compareReportsGreater() { } @Test - public void whenRevisionVersionIsLower_compareReportsLower() { + void whenRevisionVersionIsLower_compareReportsLower() { SemanticVersion first = new SemanticVersion("5.6.7"); SemanticVersion second = new SemanticVersion("5.6.8"); @@ -69,7 +69,7 @@ public void whenRevisionVersionIsLower_compareReportsLower() { } @Test - public void whenRevisionVersionIsGreater_compareReportsGreater() { + void whenRevisionVersionIsGreater_compareReportsGreater() { SemanticVersion first = new SemanticVersion("5.6.7"); SemanticVersion second = new SemanticVersion("5.6.6"); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/ServiceHelperDeletionTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/ServiceHelperDeletionTest.java index 1f54b04bc8a..035ab73803a 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/ServiceHelperDeletionTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/ServiceHelperDeletionTest.java @@ -18,7 +18,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class ServiceHelperDeletionTest extends ServiceHelperTestBase { +class ServiceHelperDeletionTest extends ServiceHelperTestBase { private static final String UID = "uid1"; private static final String SERVER_NAME = "server1"; private static final String SERVICE_NAME = LegalNames.toServerServiceName(UID, SERVER_NAME); @@ -40,7 +40,7 @@ public void setUpDeletionTest() { } @Test - public void afterDeleteServiceStepRun_serviceRemovedFromKubernetes() { + void afterDeleteServiceStepRun_serviceRemovedFromKubernetes() { testSupport.defineResources(service); testSupport.runSteps(ServiceHelper.deleteServicesStep(SERVER_NAME, null)); @@ -49,7 +49,7 @@ public void afterDeleteServiceStepRun_serviceRemovedFromKubernetes() { } @Test - public void afterDeleteServiceStepRun_removeServiceFromSko() { + void afterDeleteServiceStepRun_removeServiceFromSko() { testSupport.defineResources(service); testSupport.runSteps(ServiceHelper.deleteServicesStep(SERVER_NAME, null)); @@ -58,14 +58,14 @@ public void afterDeleteServiceStepRun_removeServiceFromSko() { } @Test - public void whenServiceNotFound_removeServiceFromSko() { + void whenServiceNotFound_removeServiceFromSko() { testSupport.runSteps(ServiceHelper.deleteServicesStep(SERVER_NAME, null)); assertThat(domainPresenceInfo.getServerService(SERVER_NAME), nullValue()); } @Test - public void whenDeleteFails_reportCompletionFailure() { + void whenDeleteFails_reportCompletionFailure() { testSupport.failOnResource(SERVICE, SERVICE_NAME, NS, HTTP_BAD_REQUEST); testSupport.runSteps(ServiceHelper.deleteServicesStep(SERVER_NAME, null)); @@ -74,14 +74,14 @@ public void whenDeleteFails_reportCompletionFailure() { } @Test - public void whenDeleteServiceStepRunWithNoService_doNotSendDeleteCall() { + void whenDeleteServiceStepRunWithNoService_doNotSendDeleteCall() { testSupport.runSteps(ServiceHelper.deleteServicesStep(SERVER_NAME, null)); assertThat(domainPresenceInfo.getServerService(SERVER_NAME), nullValue()); } @Test - public void afterDeleteServiceStepRun_runSpecifiedNextStep() { + void afterDeleteServiceStepRun_runSpecifiedNextStep() { TerminalStep terminalStep = new TerminalStep(); testSupport.runSteps(ServiceHelper.deleteServicesStep(SERVER_NAME, terminalStep)); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/ServiceHelperTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/ServiceHelperTest.java index 6274f366fca..e3b3d8db51e 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/ServiceHelperTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/ServiceHelperTest.java @@ -240,7 +240,7 @@ protected WlsServerConfig getServerConfig() { } @Test - public void whenCreated_createWithOwnerReference() { + void whenCreated_createWithOwnerReference() { V1OwnerReference expectedReference = new V1OwnerReference() .apiVersion(KubernetesConstants.DOMAIN_GROUP + "/" + KubernetesConstants.DOMAIN_VERSION) .kind(KubernetesConstants.DOMAIN) @@ -257,7 +257,7 @@ V1Service createService() { } @Test - public void whenCreated_modelHasServiceType() { + void whenCreated_modelHasServiceType() { V1Service model = createService(); assertThat(getServiceType(model), equalTo(testFacade.getExpectedServiceType().toString())); @@ -268,14 +268,14 @@ private String getServiceType(V1Service service) { } @Test - public void whenCreated_modelKubernetesTypeIsCorrect() { + void whenCreated_modelKubernetesTypeIsCorrect() { V1Service model = createService(); assertThat(OperatorServiceType.getType(model), equalTo(testFacade.getType())); } @Test - public void whenCreated_modelHasExpectedSelectors() { + void whenCreated_modelHasExpectedSelectors() { V1Service model = createService(); assertThat( @@ -287,7 +287,7 @@ public void whenCreated_modelHasExpectedSelectors() { } @Test - public void whenCreated_modelIncludesExpectedNapPorts() { + void whenCreated_modelIncludesExpectedNapPorts() { V1Service model = createService(); for (Map.Entry entry : testFacade.getExpectedNapPorts().entrySet()) { @@ -300,7 +300,7 @@ private String getExpectedProtocol(String portName) { } @Test - public void whenCreated_modelIncludesStandardListenPorts() { + void whenCreated_modelIncludesStandardListenPorts() { V1Service model = createService(); assertThat(model, containsPort("default", testFacade.getExpectedListenPort())); @@ -309,7 +309,7 @@ public void whenCreated_modelIncludesStandardListenPorts() { } @Test - public void whenCreated_modelIncludesExpectedNodePorts() { + void whenCreated_modelIncludesExpectedNodePorts() { V1Service model = createService(); assertThat( @@ -329,7 +329,7 @@ private List> toMatchers(Map nod } @Test - public void onRunWithNoService_logCreatedMessage() { + void onRunWithNoService_logCreatedMessage() { runServiceHelper(); assertThat(logRecords, containsInfo(testFacade.getServiceCreateLogMessage())); @@ -340,7 +340,7 @@ private void runServiceHelper() { } @Test - public void onRunWithNoService_createIt() { + void onRunWithNoService_createIt() { consoleHandlerMemento.ignoreMessage(testFacade.getServiceCreateLogMessage()); runServiceHelper(); @@ -351,7 +351,7 @@ public void onRunWithNoService_createIt() { } @Test - public void afterRun_createdServiceHasNoDuplicatePorts() { + void afterRun_createdServiceHasNoDuplicatePorts() { consoleHandlerMemento.ignoreMessage(testFacade.getServiceCreateLogMessage()); runServiceHelper(); @@ -360,7 +360,7 @@ public void afterRun_createdServiceHasNoDuplicatePorts() { } @Test - public void onFailedRun_reportFailure() { + void onFailedRun_reportFailure() { testSupport.addRetryStrategy(retryStrategy); testSupport.failOnResource(SERVICE, testFacade.getServiceName(), NS, 500); @@ -370,7 +370,7 @@ public void onFailedRun_reportFailure() { } @Test - public void whenServiceCreationFailsDueToUnprocessableEntityFailure_reportInDomainStatus() { + void whenServiceCreationFailsDueToUnprocessableEntityFailure_reportInDomainStatus() { testSupport.defineResources(domainPresenceInfo.getDomain()); testSupport.failOnResource(SERVICE, testFacade.getServiceName(), NS, new UnrecoverableErrorBuilderImpl() .withReason("FieldValueNotFound") @@ -384,7 +384,7 @@ public void whenServiceCreationFailsDueToUnprocessableEntityFailure_reportInDoma } @Test - public void whenServiceCreationFailsDueToUnprocessableEntityFailure_abortFiber() { + void whenServiceCreationFailsDueToUnprocessableEntityFailure_abortFiber() { testSupport.defineResources(domainPresenceInfo.getDomain()); testSupport.failOnResource(SERVICE, testFacade.getServiceName(), NS, new UnrecoverableErrorBuilderImpl() .withReason("FieldValueNotFound") @@ -401,7 +401,7 @@ private Domain getDomain() { } @Test - public void whenMatchingServiceRecordedInDomainPresence_logServiceExists() { + void whenMatchingServiceRecordedInDomainPresence_logServiceExists() { V1Service originalService = createService(); testFacade.recordService(domainPresenceInfo, originalService); @@ -411,32 +411,32 @@ public void whenMatchingServiceRecordedInDomainPresence_logServiceExists() { } @Test - public void whenConfiguredLabelAdded_replaceService() { + void whenConfiguredLabelAdded_replaceService() { verifyServiceReplaced(this::configureNewLabel); } @Test - public void whenConfiguredLabelChanged_replaceService() { + void whenConfiguredLabelChanged_replaceService() { verifyServiceReplaced(this::changeConfiguredLabel); } @Test - public void whenConfiguredAnnotationAdded_replaceService() { + void whenConfiguredAnnotationAdded_replaceService() { verifyServiceReplaced(this::configureNewAnnotation); } @Test - public void whenConfiguredAnnotationChanged_replaceService() { + void whenConfiguredAnnotationChanged_replaceService() { verifyServiceReplaced(this::changeConfiguredAnnotation); } @Test - public void whenConfiguredListenPortChanged_replaceService() { + void whenConfiguredListenPortChanged_replaceService() { verifyServiceReplaced(this::changeConfiguredListenPort); } @Test - public void whenConfiguredSslListenPortChanged_replaceService() { + void whenConfiguredSslListenPortChanged_replaceService() { verifyServiceReplaced(this::changeConfiguredSslListenPort); } @@ -499,27 +499,27 @@ private void recordStrandedService() { } @Test - public void whenServiceLabelAdded_dontReplaceService() { + void whenServiceLabelAdded_dontReplaceService() { verifyServiceNotReplaced(this::addNewLabel); } @Test - public void whenServiceLabelChanged_dontReplaceService() { + void whenServiceLabelChanged_dontReplaceService() { verifyServiceNotReplaced(this::changeLabel); } @Test - public void whenServiceAnnotationAdded_dontReplaceService() { + void whenServiceAnnotationAdded_dontReplaceService() { verifyServiceNotReplaced(this::addNewAnnotation); } @Test - public void whenServiceAnnotationChanged_dontReplaceService() { + void whenServiceAnnotationChanged_dontReplaceService() { verifyServiceNotReplaced(this::changeAnnotation); } @Test - public void whenServiceListenPortChanged_dontReplaceService() { + void whenServiceListenPortChanged_dontReplaceService() { verifyServiceNotReplaced(this::changeListenPort); } diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/ServicePresenceTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/ServicePresenceTest.java index 8d900330c38..989d651b30b 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/ServicePresenceTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/ServicePresenceTest.java @@ -47,7 +47,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; @SuppressWarnings("SameParameterValue") -public class ServicePresenceTest { +class ServicePresenceTest { private static final String NS = "namespace"; private static final String UID = "domain1"; @@ -98,14 +98,14 @@ public void tearDown() { } @Test - public void whenServiceHasNoDomainUid_returnNull() { + void whenServiceHasNoDomainUid_returnNull() { V1Service service = new V1Service().metadata(new V1ObjectMeta()); assertThat(ServiceHelper.getServiceDomainUid(service), nullValue()); } @Test - public void whenServiceHasDomainUid_returnIt() { + void whenServiceHasDomainUid_returnIt() { V1Service service = new V1Service() .metadata(new V1ObjectMeta().labels(ImmutableMap.of(DOMAINUID_LABEL, "domain1"))); @@ -114,14 +114,14 @@ public void whenServiceHasDomainUid_returnIt() { } @Test - public void whenServiceHasNoServerName_returnNull() { + void whenServiceHasNoServerName_returnNull() { V1Service service = new V1Service().metadata(new V1ObjectMeta()); assertThat(ServiceHelper.getServerName(service), nullValue()); } @Test - public void whenServiceHasServerName_returnIt() { + void whenServiceHasServerName_returnIt() { V1Service service = new V1Service() .metadata(new V1ObjectMeta().labels(ImmutableMap.of(SERVERNAME_LABEL, "myserver"))); @@ -134,7 +134,7 @@ public void whenServiceHasServerName_returnIt() { // the timestamps for services increment with each creation @Test - public void onAddEventWithNoRecordedClusterService_addIt() { + void onAddEventWithNoRecordedClusterService_addIt() { V1Service newService = createClusterService(); Watch.Response event = WatchEvent.createAddedEvent(newService).toWatchResponse(); @@ -144,7 +144,7 @@ public void onAddEventWithNoRecordedClusterService_addIt() { } @Test - public void onAddEventWithNewerClusterService_replaceCurrentValue() { + void onAddEventWithNewerClusterService_replaceCurrentValue() { V1Service currentService = createClusterService(); V1Service newerService = createClusterService(); info.setClusterService(CLUSTER, currentService); @@ -156,7 +156,7 @@ public void onAddEventWithNewerClusterService_replaceCurrentValue() { } @Test - public void onAddEventWithOlderClusterService_keepCurrentValue() { + void onAddEventWithOlderClusterService_keepCurrentValue() { V1Service olderService = createClusterService(); V1Service currentService = createClusterService(); info.setClusterService(CLUSTER, currentService); @@ -168,7 +168,7 @@ public void onAddEventWithOlderClusterService_keepCurrentValue() { } @Test - public void onModifyEventWithNoRecordedClusterService_addIt() { + void onModifyEventWithNoRecordedClusterService_addIt() { V1Service service1 = createClusterService(); Watch.Response event = WatchEvent.createModifiedEvent(service1).toWatchResponse(); @@ -178,7 +178,7 @@ public void onModifyEventWithNoRecordedClusterService_addIt() { } @Test - public void onModifyEventWithNewerClusterService_replaceCurrentValue() { + void onModifyEventWithNewerClusterService_replaceCurrentValue() { V1Service currentService = createClusterService(); V1Service newService = createClusterService(); info.setClusterService(CLUSTER, currentService); @@ -190,7 +190,7 @@ public void onModifyEventWithNewerClusterService_replaceCurrentValue() { } @Test - public void onModifyEventWithOlderClusterService_keepCurrentValue() { + void onModifyEventWithOlderClusterService_keepCurrentValue() { V1Service oldService = createClusterService(); V1Service currentService = createClusterService(); info.setClusterService(CLUSTER, currentService); @@ -202,7 +202,7 @@ public void onModifyEventWithOlderClusterService_keepCurrentValue() { } @Test - public void onDeleteEventWithNoRecordedClusterService_ignoreIt() { + void onDeleteEventWithNoRecordedClusterService_ignoreIt() { V1Service service = createClusterService(); Watch.Response event = WatchEvent.createDeletedEvent(service).toWatchResponse(); @@ -212,7 +212,7 @@ public void onDeleteEventWithNoRecordedClusterService_ignoreIt() { } @Test - public void onDeleteEventWithOlderClusterService_keepCurrentValue() { + void onDeleteEventWithOlderClusterService_keepCurrentValue() { V1Service oldService = createClusterService(); V1Service currentService = createClusterService(); info.setClusterService(CLUSTER, currentService); @@ -224,7 +224,7 @@ public void onDeleteEventWithOlderClusterService_keepCurrentValue() { } @Test - public void onDeleteEventWithSameClusterService_removeIt() { + void onDeleteEventWithSameClusterService_removeIt() { V1Service currentService = createClusterService(); info.setClusterService(CLUSTER, currentService); Watch.Response event = @@ -236,7 +236,7 @@ public void onDeleteEventWithSameClusterService_removeIt() { } @Test - public void onDeleteEventWithNewerClusterService_removeIt() { + void onDeleteEventWithNewerClusterService_removeIt() { V1Service currentService = createClusterService(); V1Service newerService = createClusterService(); info.setClusterService(CLUSTER, currentService); @@ -248,7 +248,7 @@ public void onDeleteEventWithNewerClusterService_removeIt() { } @Test - public void whenEventContainsServiceWithClusterNameAndNoTypeLabel_addAsClusterService() { + void whenEventContainsServiceWithClusterNameAndNoTypeLabel_addAsClusterService() { V1Service service = new V1Service() .metadata( @@ -263,7 +263,7 @@ public void whenEventContainsServiceWithClusterNameAndNoTypeLabel_addAsClusterSe } @Test - public void onAddEventWithNoRecordedServerService_addIt() { + void onAddEventWithNoRecordedServerService_addIt() { V1Service newService = createServerService(); Watch.Response event = WatchEvent.createAddedEvent(newService).toWatchResponse(); @@ -273,7 +273,7 @@ public void onAddEventWithNoRecordedServerService_addIt() { } @Test - public void onAddEventWithNewerServerService_replaceCurrentValue() { + void onAddEventWithNewerServerService_replaceCurrentValue() { V1Service currentService = createServerService(); V1Service newerService = createServerService(); info.setServerService(SERVER, currentService); @@ -285,7 +285,7 @@ public void onAddEventWithNewerServerService_replaceCurrentValue() { } @Test - public void onAddEventWithOlderServerService_keepCurrentValue() { + void onAddEventWithOlderServerService_keepCurrentValue() { V1Service olderService = createServerService(); V1Service currentService = createServerService(); info.setServerService(SERVER, currentService); @@ -297,7 +297,7 @@ public void onAddEventWithOlderServerService_keepCurrentValue() { } @Test - public void onModifyEventWithNoRecordedServerService_addIt() { + void onModifyEventWithNoRecordedServerService_addIt() { V1Service service1 = createServerService(); Watch.Response event = WatchEvent.createModifiedEvent(service1).toWatchResponse(); @@ -307,7 +307,7 @@ public void onModifyEventWithNoRecordedServerService_addIt() { } @Test - public void onModifyEventWithNewerServerService_replaceCurrentValue() { + void onModifyEventWithNewerServerService_replaceCurrentValue() { V1Service currentService = createServerService(); V1Service newService = createServerService(); info.setServerService(SERVER, currentService); @@ -319,7 +319,7 @@ public void onModifyEventWithNewerServerService_replaceCurrentValue() { } @Test - public void onModifyEventWithOlderServerService_keepCurrentValue() { + void onModifyEventWithOlderServerService_keepCurrentValue() { V1Service oldService = createServerService(); V1Service currentService = createServerService(); info.setServerService(SERVER, currentService); @@ -331,7 +331,7 @@ public void onModifyEventWithOlderServerService_keepCurrentValue() { } @Test - public void onDeleteEventWithNoRecordedServerService_ignoreIt() { + void onDeleteEventWithNoRecordedServerService_ignoreIt() { V1Service service = createServerService(); Watch.Response event = WatchEvent.createDeletedEvent(service).toWatchResponse(); @@ -341,7 +341,7 @@ public void onDeleteEventWithNoRecordedServerService_ignoreIt() { } @Test - public void onDeleteEventWithOlderServerService_keepCurrentValue() { + void onDeleteEventWithOlderServerService_keepCurrentValue() { V1Service oldService = createServerService(); V1Service currentService = createServerService(); info.setServerService(SERVER, currentService); @@ -353,7 +353,7 @@ public void onDeleteEventWithOlderServerService_keepCurrentValue() { } @Test - public void onDeleteEventWithSameServerService_removeIt() { + void onDeleteEventWithSameServerService_removeIt() { V1Service currentService = createServerService(); info.setServerService(SERVER, currentService); Watch.Response event = @@ -365,7 +365,7 @@ public void onDeleteEventWithSameServerService_removeIt() { } @Test - public void onDeleteEventWithNewerServerService_removeIt() { + void onDeleteEventWithNewerServerService_removeIt() { V1Service currentService = createServerService(); V1Service newerService = createServerService(); info.setServerService(SERVER, currentService); @@ -377,7 +377,7 @@ public void onDeleteEventWithNewerServerService_removeIt() { } @Test - public void whenEventContainsServiceWithServerNameAndNoTypeLabel_addAsServerService() { + void whenEventContainsServiceWithServerNameAndNoTypeLabel_addAsServerService() { V1Service service = new V1Service() .metadata( @@ -393,7 +393,7 @@ public void whenEventContainsServiceWithServerNameAndNoTypeLabel_addAsServerServ } @Test - public void onAddEventWithNoRecordedExternalService_addIt() { + void onAddEventWithNoRecordedExternalService_addIt() { V1Service newService = createExternalService(); Watch.Response event = WatchEvent.createAddedEvent(newService).toWatchResponse(); @@ -403,7 +403,7 @@ public void onAddEventWithNoRecordedExternalService_addIt() { } @Test - public void onAddEventWithNewerExternalService_replaceCurrentValue() { + void onAddEventWithNewerExternalService_replaceCurrentValue() { V1Service currentService = createExternalService(); V1Service newerService = createExternalService(); info.setExternalService(SERVER, currentService); @@ -415,7 +415,7 @@ public void onAddEventWithNewerExternalService_replaceCurrentValue() { } @Test - public void onAddEventWithOlderExternalService_keepCurrentValue() { + void onAddEventWithOlderExternalService_keepCurrentValue() { V1Service olderService = createExternalService(); V1Service currentService = createExternalService(); info.setExternalService(SERVER, currentService); @@ -427,7 +427,7 @@ public void onAddEventWithOlderExternalService_keepCurrentValue() { } @Test - public void onModifyEventWithNoRecordedExternalService_addIt() { + void onModifyEventWithNoRecordedExternalService_addIt() { V1Service service1 = createExternalService(); Watch.Response event = WatchEvent.createModifiedEvent(service1).toWatchResponse(); @@ -437,7 +437,7 @@ public void onModifyEventWithNoRecordedExternalService_addIt() { } @Test - public void onModifyEventWithNewerExternalService_replaceCurrentValue() { + void onModifyEventWithNewerExternalService_replaceCurrentValue() { V1Service currentService = createExternalService(); V1Service newService = createExternalService(); info.setExternalService(SERVER, currentService); @@ -449,7 +449,7 @@ public void onModifyEventWithNewerExternalService_replaceCurrentValue() { } @Test - public void onModifyEventWithOlderExternalService_keepCurrentValue() { + void onModifyEventWithOlderExternalService_keepCurrentValue() { V1Service oldService = createExternalService(); V1Service currentService = createExternalService(); info.setExternalService(SERVER, currentService); @@ -461,7 +461,7 @@ public void onModifyEventWithOlderExternalService_keepCurrentValue() { } @Test - public void onDeleteEventWithNoRecordedExternalService_ignoreIt() { + void onDeleteEventWithNoRecordedExternalService_ignoreIt() { V1Service service = createExternalService(); Watch.Response event = WatchEvent.createDeletedEvent(service).toWatchResponse(); @@ -471,7 +471,7 @@ public void onDeleteEventWithNoRecordedExternalService_ignoreIt() { } @Test - public void onDeleteEventWithOlderExternalService_keepCurrentValue() { + void onDeleteEventWithOlderExternalService_keepCurrentValue() { V1Service oldService = createExternalService(); V1Service currentService = createExternalService(); info.setExternalService(SERVER, currentService); @@ -483,7 +483,7 @@ public void onDeleteEventWithOlderExternalService_keepCurrentValue() { } @Test - public void onDeleteEventWithSameExternalService_removeIt() { + void onDeleteEventWithSameExternalService_removeIt() { V1Service currentService = createExternalService(); info.setExternalService(SERVER, currentService); Watch.Response event = @@ -495,7 +495,7 @@ public void onDeleteEventWithSameExternalService_removeIt() { } @Test - public void onDeleteEventWithNewerExternalService_removeIt() { + void onDeleteEventWithNewerExternalService_removeIt() { V1Service currentService = createExternalService(); V1Service newerService = createExternalService(); info.setExternalService(SERVER, currentService); @@ -507,7 +507,7 @@ public void onDeleteEventWithNewerExternalService_removeIt() { } @Test - public void whenEventContainsServiceWithNodePortAndNoTypeLabel_addAsExternalService() { + void whenEventContainsServiceWithNodePortAndNoTypeLabel_addAsExternalService() { V1Service service = new V1Service() .metadata( @@ -553,7 +553,7 @@ private V1ObjectMeta createMetadata() { } @Test - public void whenClusterServiceAdded_recordforCluster() { + void whenClusterServiceAdded_recordforCluster() { V1Service clusterService = createClusterService(); ServiceHelper.addToPresence(info, clusterService); @@ -562,7 +562,7 @@ public void whenClusterServiceAdded_recordforCluster() { } @Test - public void whenServerServiceAdded_recordforServer() { + void whenServerServiceAdded_recordforServer() { V1Service serverService = createServerService(); ServiceHelper.addToPresence(info, serverService); @@ -571,7 +571,7 @@ public void whenServerServiceAdded_recordforServer() { } @Test - public void whenExternalServiceAdded_recordforServer() { + void whenExternalServiceAdded_recordforServer() { V1Service externalService = createExternalService(); ServiceHelper.addToPresence(info, externalService); diff --git a/operator/src/test/java/oracle/kubernetes/operator/helpers/VersionCheckTest.java b/operator/src/test/java/oracle/kubernetes/operator/helpers/VersionCheckTest.java index 1ea0487f9eb..069d51e6233 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/helpers/VersionCheckTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/helpers/VersionCheckTest.java @@ -30,7 +30,7 @@ import static oracle.kubernetes.utils.LogMatcher.containsWarning; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class VersionCheckTest { +class VersionCheckTest { // The log messages to be checked during this test private static final String[] LOG_KEYS = { @@ -94,7 +94,7 @@ public void tearDown() { @ParameterizedTest @MethodSource("getTestParams") - public void test(TestType testType, + void test(TestType testType, String majorVersion, String minorVersion, String revision, diff --git a/operator/src/test/java/oracle/kubernetes/operator/http/HttpAsyncRequestStepTest.java b/operator/src/test/java/oracle/kubernetes/operator/http/HttpAsyncRequestStepTest.java index e9acfffb1df..cfd39e7fdbd 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/http/HttpAsyncRequestStepTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/http/HttpAsyncRequestStepTest.java @@ -43,7 +43,7 @@ /** * Tests async processing of http requests during step processing. */ -public class HttpAsyncRequestStepTest { +class HttpAsyncRequestStepTest { private final HttpResponseStepImpl responseStep = new HttpResponseStepImpl(null); private final Packet packet = new Packet(); @@ -73,12 +73,12 @@ public void tearDown() { } @Test - public void classImplementsStep() { + void classImplementsStep() { assertThat(HttpAsyncRequestStep.class, typeCompatibleWith(Step.class)); } @Test - public void constructorReturnsInstanceLinkedToResponse() { + void constructorReturnsInstanceLinkedToResponse() { assertThat(requestStep.getNext(), sameInstance(responseStep)); } @@ -88,7 +88,7 @@ private HttpAsyncRequestStep createStep() { } @Test - public void whenRequestMade_suspendProcessing() { + void whenRequestMade_suspendProcessing() { NextAction action = requestStep.apply(packet); assertThat(FiberTestSupport.isSuspendRequested(action), is(true)); @@ -98,7 +98,7 @@ public void whenRequestMade_suspendProcessing() { // Note: in the following tests, the call to doOnExit simulates the behavior of the fiber // when it receives a doSuspend() @Test - public void whenResponseReceived_resumeFiber() { + void whenResponseReceived_resumeFiber() { final NextAction nextAction = requestStep.apply(packet); receiveResponseBeforeTimeout(nextAction, response); @@ -118,7 +118,7 @@ private void completeWithThrowableBeforeTimeout(NextAction nextAction, Throwable @Test - public void whenErrorResponseReceived_logMessage() { + void whenErrorResponseReceived_logMessage() { final NextAction nextAction = requestStep.apply(packet); receiveResponseBeforeTimeout(nextAction, createStub(HttpResponseStub.class, 500)); @@ -127,7 +127,7 @@ public void whenErrorResponseReceived_logMessage() { } @Test - public void whenThrowableResponseReceived_logMessage() { + void whenThrowableResponseReceived_logMessage() { consoleMemento .collectLogMessages(logRecords, HTTP_REQUEST_GOT_THROWABLE) .withLogLevel(Level.WARNING); @@ -139,7 +139,7 @@ public void whenThrowableResponseReceived_logMessage() { } @Test - public void whenResponseReceived_populatePacket() { + void whenResponseReceived_populatePacket() { NextAction nextAction = requestStep.apply(packet); receiveResponseBeforeTimeout(nextAction, response); @@ -148,7 +148,7 @@ public void whenResponseReceived_populatePacket() { } @Test - public void whenResponseTimesOut_resumeFiber() { + void whenResponseTimesOut_resumeFiber() { consoleMemento.ignoreMessage(HTTP_REQUEST_TIMED_OUT); NextAction nextAction = requestStep.apply(packet); @@ -158,7 +158,7 @@ public void whenResponseTimesOut_resumeFiber() { } @Test - public void whenResponseTimesOut_packetHasNoResponse() { + void whenResponseTimesOut_packetHasNoResponse() { consoleMemento.ignoreMessage(HTTP_REQUEST_TIMED_OUT); HttpResponseStep.addToPacket(packet, response); NextAction nextAction = requestStep.apply(packet); @@ -169,7 +169,7 @@ public void whenResponseTimesOut_packetHasNoResponse() { } @Test - public void whenResponseTimesOut_logWarning() { + void whenResponseTimesOut_logWarning() { HttpResponseStep.addToPacket(packet, response); NextAction nextAction = requestStep.apply(packet); @@ -179,7 +179,7 @@ public void whenResponseTimesOut_logWarning() { } @Test - public void whenTestSupportEnabled_retrieveCannedResult() throws NoSuchFieldException { + void whenTestSupportEnabled_retrieveCannedResult() throws NoSuchFieldException { HttpRequest request = HttpRequest.newBuilder().uri(URI.create("http://nowhere")).build(); HttpAsyncTestSupport httpSupport = new HttpAsyncTestSupport(); httpSupport.install(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/http/HttpAsyncTestSupportTest.java b/operator/src/test/java/oracle/kubernetes/operator/http/HttpAsyncTestSupportTest.java index 528db5b5398..6f1268244f2 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/http/HttpAsyncTestSupportTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/http/HttpAsyncTestSupportTest.java @@ -16,11 +16,11 @@ import static org.hamcrest.Matchers.sameInstance; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class HttpAsyncTestSupportTest { +class HttpAsyncTestSupportTest { private final HttpAsyncTestSupport support = new HttpAsyncTestSupport(); @Test - public void whenNoDefinedResponse_returnNotFoundResponse() { + void whenNoDefinedResponse_returnNotFoundResponse() { assertThat(getResponse(createGetRequest("http://nowhere")).statusCode(), equalTo(HttpURLConnection.HTTP_NOT_FOUND)); } @@ -44,7 +44,7 @@ void afterRequestHandled_mayRetrieveFromTestSupport() { } @Test - public void whenOneGetResponseDefined_selectIt() { + void whenOneGetResponseDefined_selectIt() { support.defineResponse(createGetRequest("http://known"), createStub(HttpResponseStub.class, 200, "It works")); assertThat(getResponse(createGetRequest("http://known")).statusCode(), equalTo(200)); @@ -52,7 +52,7 @@ public void whenOneGetResponseDefined_selectIt() { } @Test - public void whenGetAndPostRequestDefined_selectGet() { + void whenGetAndPostRequestDefined_selectGet() { support.defineResponse(createPostRequest("http://this", "abc"), createStub(HttpResponseStub.class, 200, "Got it")); support.defineResponse(createGetRequest("http://this"), createStub(HttpResponseStub.class, 200, "It works")); @@ -60,7 +60,7 @@ public void whenGetAndPostRequestDefined_selectGet() { } @Test - public void whenGetAndPostRequestDefined_selectPost() { + void whenGetAndPostRequestDefined_selectPost() { support.defineResponse(createPostRequest("http://this", "abc"), createStub(HttpResponseStub.class, 200, "Got it")); support.defineResponse(createGetRequest("http://this"), createStub(HttpResponseStub.class, 200, "It works")); @@ -68,7 +68,7 @@ public void whenGetAndPostRequestDefined_selectPost() { } @Test - public void whenMultipleUrlsDefined_selectMatch() { + void whenMultipleUrlsDefined_selectMatch() { support.defineResponse(createGetRequest("http://that"), createStub(HttpResponseStub.class, 200, "Wrong")); support.defineResponse(createGetRequest("http://this"), createStub(HttpResponseStub.class, 200, "Got it")); @@ -94,7 +94,7 @@ private HttpRequest createPostRequest(String urlString, String body) { } @Test - public void matchingFuture_markedComplete() { + void matchingFuture_markedComplete() { support.defineResponse(createGetRequest("http://known"), createStub(HttpResponseStub.class, 200, "It works")); assertThat(support.getFuture(createGetRequest("http://known")).isDone(), is(true)); diff --git a/operator/src/test/java/oracle/kubernetes/operator/http/HttpResponseStepTest.java b/operator/src/test/java/oracle/kubernetes/operator/http/HttpResponseStepTest.java index c516ff43bda..d6af0c769d6 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/http/HttpResponseStepTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/http/HttpResponseStepTest.java @@ -21,42 +21,42 @@ import static org.hamcrest.Matchers.typeCompatibleWith; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class HttpResponseStepTest { +class HttpResponseStepTest { private final TerminalStep terminalStep = new TerminalStep(); private final HttpResponseStepImpl responseStep = new HttpResponseStepImpl(terminalStep); @Test - public void classImplementsStep() { + void classImplementsStep() { assertThat(HttpResponseStep.class, typeCompatibleWith(Step.class)); } @Test - public void classIsAbstract() { + void classIsAbstract() { assertThat(Modifier.isAbstract(HttpResponseStep.class.getModifiers()), is(true)); } @Test - public void constructorSetsNextStep() { + void constructorSetsNextStep() { assertThat(responseStep.getNext(), sameInstance(terminalStep)); } @Test - public void classHasOnSuccessMethod() throws NoSuchMethodException { + void classHasOnSuccessMethod() throws NoSuchMethodException { assertThat( HttpResponseStep.class.getDeclaredMethod("onSuccess", Packet.class, HttpResponse.class), notNullValue()); } @Test - public void classHasOnFailureMethod() throws NoSuchMethodException { + void classHasOnFailureMethod() throws NoSuchMethodException { assertThat( HttpResponseStep.class.getDeclaredMethod("onFailure", Packet.class, HttpResponse.class), notNullValue()); } @Test - public void whenResponseIsSuccess_invokeOnSuccess() { + void whenResponseIsSuccess_invokeOnSuccess() { Packet packet = new Packet(); HttpResponseStep.addToPacket(packet, createStub(HttpResponseStub.class, HttpURLConnection.HTTP_OK)); @@ -67,7 +67,7 @@ public void whenResponseIsSuccess_invokeOnSuccess() { } @Test - public void whenResponseIsFailure_invokeOnFailure() { + void whenResponseIsFailure_invokeOnFailure() { Packet packet = new Packet(); HttpResponseStep.addToPacket(packet, createStub(HttpResponseStub.class, HttpURLConnection.HTTP_FORBIDDEN)); @@ -78,7 +78,7 @@ public void whenResponseIsFailure_invokeOnFailure() { } @Test - public void whenNoResponseProvided_skipProcessing() { + void whenNoResponseProvided_skipProcessing() { NextAction nextAction = responseStep.apply(new Packet()); assertThat(responseStep.getSuccessResponse(), nullValue()); diff --git a/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFacadeTest.java b/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFacadeTest.java index 77513d3be8d..7f9d511505c 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFacadeTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFacadeTest.java @@ -12,7 +12,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -public class LoggingFacadeTest { +class LoggingFacadeTest { MockLogger mockLogger; LoggingFacade loggingFacade; @@ -24,14 +24,14 @@ public void setup() { } @Test - public void verifyInfoMessageLoggedIfLoggingFilterIsNull() { + void verifyInfoMessageLoggedIfLoggingFilterIsNull() { loggingFacade.info((LoggingFilter) null, "msg"); assertThat(mockLogger.isLogpCalled(), is(true)); } @Test - public void verifyInfoMessageLoggedIfLoggingFilterAllows() { + void verifyInfoMessageLoggedIfLoggingFilterAllows() { final String message = "info message"; loggingFacade.info(MockLoggingFilter.createWithReturnValue(true), message); @@ -41,21 +41,21 @@ public void verifyInfoMessageLoggedIfLoggingFilterAllows() { } @Test - public void verifyInfoMessageNotLoggedIfLoggingFilterDenies() { + void verifyInfoMessageNotLoggedIfLoggingFilterDenies() { loggingFacade.info(MockLoggingFilter.createWithReturnValue(false), "msg"); assertThat(mockLogger.isLogpCalled(), is(false)); } @Test - public void verifyWarningMessageLoggedIfLoggingFilterIsNull() { + void verifyWarningMessageLoggedIfLoggingFilterIsNull() { loggingFacade.warning((LoggingFilter) null, "msg"); assertThat(mockLogger.isLogpCalled(), is(true)); } @Test - public void verifyWarningMessageLoggedIfLoggingFilterAllows() { + void verifyWarningMessageLoggedIfLoggingFilterAllows() { final String message = "warning message"; loggingFacade.warning(MockLoggingFilter.createWithReturnValue(true), message); @@ -65,21 +65,21 @@ public void verifyWarningMessageLoggedIfLoggingFilterAllows() { } @Test - public void verifyWarningMessageNotLoggedIfLoggingFilterDenies() { + void verifyWarningMessageNotLoggedIfLoggingFilterDenies() { loggingFacade.warning(MockLoggingFilter.createWithReturnValue(false), "msg"); assertThat(mockLogger.isLogpCalled(), is(false)); } @Test - public void verifySevereMessageLoggedIfLoggingFilterIsNull() { + void verifySevereMessageLoggedIfLoggingFilterIsNull() { loggingFacade.severe((LoggingFilter) null, "msg"); assertThat(mockLogger.isLogpCalled(), is(true)); } @Test - public void verifySevereMessageLoggedIfLoggingFilterAllows() { + void verifySevereMessageLoggedIfLoggingFilterAllows() { final String message = "severe message"; loggingFacade.severe(MockLoggingFilter.createWithReturnValue(true), message); @@ -89,21 +89,21 @@ public void verifySevereMessageLoggedIfLoggingFilterAllows() { } @Test - public void verifySevereMessageNotLoggedIfLoggingFilterDenies() { + void verifySevereMessageNotLoggedIfLoggingFilterDenies() { loggingFacade.severe(MockLoggingFilter.createWithReturnValue(false), "msg"); assertThat(mockLogger.isLogpCalled(), is(false)); } @Test - public void verifySevereMessageWithThrowableLoggedIfLoggingFilterIsNull() { + void verifySevereMessageWithThrowableLoggedIfLoggingFilterIsNull() { loggingFacade.severe(null, "msg", new Throwable()); assertThat(mockLogger.isLogpCalled(), is(true)); } @Test - public void verifySevereMessageWithThrowableLoggedIfLoggingFilterAllows() { + void verifySevereMessageWithThrowableLoggedIfLoggingFilterAllows() { final String message = "severe message"; final Throwable throwable = new Throwable("throwable"); loggingFacade.severe(MockLoggingFilter.createWithReturnValue(true), message, throwable); @@ -115,20 +115,20 @@ public void verifySevereMessageWithThrowableLoggedIfLoggingFilterAllows() { } @Test - public void verifySevereMessageWithThrowableNotLoggedIfLoggingFilterDenies() { + void verifySevereMessageWithThrowableNotLoggedIfLoggingFilterDenies() { loggingFacade.severe(MockLoggingFilter.createWithReturnValue(false), "msg", new Throwable()); assertThat(mockLogger.isLogpCalled(), is(false)); } @Test - public void verifyGetFormattedMessage_withArgs_returnsFormattedMessage() { + void verifyGetFormattedMessage_withArgs_returnsFormattedMessage() { assertThat(loggingFacade.formatMessage(MessageKeys.CYCLING_SERVERS, "domain1", "list1"), is("Cycling of servers for Domain with UID domain1 in the list list1 now")); } @Test - public void verifyGetFormattedMessage_withNoArgs_returnsFormattedMessage() { + void verifyGetFormattedMessage_withNoArgs_returnsFormattedMessage() { assertThat(loggingFacade.formatMessage(MessageKeys.RESOURCE_BUNDLE_NOT_FOUND), is("Could not find the resource bundle")); } diff --git a/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFilterTest.java b/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFilterTest.java index 0771802945d..f80a120cffd 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFilterTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFilterTest.java @@ -8,23 +8,23 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -public class LoggingFilterTest { +class LoggingFilterTest { @Test - public void verifyCanLogWithoutLoggingFilterReturnsTrue() { + void verifyCanLogWithoutLoggingFilterReturnsTrue() { LoggingFilter loggingFilter = null; assertThat(LoggingFilter.canLog(loggingFilter, "message"), is(true)); } @Test - public void verifyCanLogReturnsTrueValueFromLoggingFilter() { + void verifyCanLogReturnsTrueValueFromLoggingFilter() { LoggingFilter returnTrueLoggingFilter = MockLoggingFilter.createWithReturnValue(true); assertThat(LoggingFilter.canLog(returnTrueLoggingFilter, "message"), is(true)); } @Test - public void verifyCanLogReturnsFalseValueFromLoggingFilter() { + void verifyCanLogReturnsFalseValueFromLoggingFilter() { LoggingFilter returnFalseLoggingFilter = MockLoggingFilter.createWithReturnValue(false); assertThat(LoggingFilter.canLog(returnFalseLoggingFilter, "message"), is(false)); } diff --git a/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFormatterTest.java b/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFormatterTest.java index 79c468b393e..6c905aa62be 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFormatterTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/logging/LoggingFormatterTest.java @@ -24,14 +24,14 @@ import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class LoggingFormatterTest { +class LoggingFormatterTest { private final LogRecord logRecord = new LogRecord(Level.INFO, "A simple one"); private final LoggingFormatter formatter = new LoggingFormatter(); private final FiberTestSupport testSupport = new FiberTestSupport(); @Test - public void formatLogRecordWithParameters() throws JsonProcessingException { + void formatLogRecordWithParameters() throws JsonProcessingException { logRecord.setMessage("Insert {0} and {1}"); logRecord.setParameters(new Object[]{"here", "there"}); @@ -45,7 +45,7 @@ private Map getFormattedMessage() throws JsonProcessingException } @Test - public void extractLogLevel() throws JsonProcessingException { + void extractLogLevel() throws JsonProcessingException { logRecord.setLevel(Level.FINER); assertThat(getFormattedMessage().get("level"), equalTo("FINER")); @@ -54,7 +54,7 @@ public void extractLogLevel() throws JsonProcessingException { } @Test - public void extractSourceIndicators() throws JsonProcessingException { + void extractSourceIndicators() throws JsonProcessingException { logRecord.setSourceClassName("theClass"); logRecord.setSourceMethodName("itsMethod"); @@ -63,47 +63,47 @@ public void extractSourceIndicators() throws JsonProcessingException { } @Test - public void whenThrowableNotApiException_extractItsName() throws JsonProcessingException { + void whenThrowableNotApiException_extractItsName() throws JsonProcessingException { logRecord.setThrown(new RuntimeException("in the test")); assertThat(getFormattedMessage().get("exception"), containsString("java.lang.RuntimeException: in the test")); } @Test - public void whenThrowableIsApiException_extractAttributes() throws JsonProcessingException { + void whenThrowableIsApiException_extractAttributes() throws JsonProcessingException { logRecord.setThrown(new ApiException(420, Collections.emptyMap(), "a response")); assertThat(getFormattedMessage(), allOf(hasEntry("code", "420"), hasEntry("body", "a response"))); } @Test - public void whenPacketLacksDomainPresence_domainUidIsEmpty() { + void whenPacketLacksDomainPresence_domainUidIsEmpty() { assertThat(getFormattedMessageInFiber().get("domainUID"), equalTo("")); } @Test - public void whenPacketContainsDomainPresence_retrieveDomainUid() { + void whenPacketContainsDomainPresence_retrieveDomainUid() { testSupport.addDomainPresenceInfo(new DomainPresenceInfo("test-ns", "test-uid")); assertThat(getFormattedMessageInFiber().get("domainUID"), equalTo("test-uid")); } @Test - public void whenPacketContainsLoggingContext_retrieveDomainUid() { + void whenPacketContainsLoggingContext_retrieveDomainUid() { testSupport.addLoggingContext(new LoggingContext().domainUid("test-lc-uid")); assertThat(getFormattedMessageInFiber().get("domainUID"), equalTo("test-lc-uid")); } @Test - public void whenNotInFiber_retrieveDomainUidFromThread() throws JsonProcessingException { + void whenNotInFiber_retrieveDomainUidFromThread() throws JsonProcessingException { try (LoggingContext stack = LoggingContext.setThreadContext().domainUid("test-uid")) { assertThat(getFormattedMessage().get("domainUID"), equalTo("test-uid")); } } @Test - public void whenPacketContainsDomainPresenceAndLoggingContext_retrieveDomainUidFromDomainPresence() { + void whenPacketContainsDomainPresenceAndLoggingContext_retrieveDomainUidFromDomainPresence() { testSupport.addDomainPresenceInfo(new DomainPresenceInfo("test-ns", "test-uid")); testSupport.addLoggingContext(new LoggingContext().namespace("test-lc-ns").domainUid("test-lc-uid")); @@ -111,7 +111,7 @@ public void whenPacketContainsDomainPresenceAndLoggingContext_retrieveDomainUidF } @Test - public void whenPacketContainsLoggingContextAndThreadLocalIsDefined_retrieveDomainUidFromLoggingContext() { + void whenPacketContainsLoggingContextAndThreadLocalIsDefined_retrieveDomainUidFromLoggingContext() { testSupport.addLoggingContext(new LoggingContext().domainUid("test-lc-uid1")); try (LoggingContext stack = LoggingContext.setThreadContext().namespace("test-lc-tl-uid")) { assertThat(getFormattedMessageInFiber().get("domainUID"), equalTo("test-lc-uid1")); @@ -119,14 +119,14 @@ public void whenPacketContainsLoggingContextAndThreadLocalIsDefined_retrieveDoma } @Test - public void whenThreadLocalDefinedAndPacketContainsNoDomainPresenceOrLoggingContext_retrieveDomainUidFromThread() { + void whenThreadLocalDefinedAndPacketContainsNoDomainPresenceOrLoggingContext_retrieveDomainUidFromThread() { try (LoggingContext stack = LoggingContext.setThreadContext().domainUid("test-lc-tl-uid1")) { assertThat(getFormattedMessageInFiber().get("domainUID"), equalTo("test-lc-tl-uid1")); } } @Test - public void whenThreadLocalDefinedAndPacketNoDomainPresenceAndLoggingContextNoDUid_retrieveDomainUidFromThread() { + void whenThreadLocalDefinedAndPacketNoDomainPresenceAndLoggingContextNoDUid_retrieveDomainUidFromThread() { testSupport.addLoggingContext(new LoggingContext().namespace("test-lc-namespace")); try (LoggingContext stack = LoggingContext.setThreadContext().domainUid("test-lc-tl-uid1")) { assertThat(getFormattedMessageInFiber().get("domainUID"), equalTo("test-lc-tl-uid1")); @@ -134,19 +134,19 @@ public void whenThreadLocalDefinedAndPacketNoDomainPresenceAndLoggingContextNoDU } @Test - public void whenPacketLacksDomainPresence_domainNamespaceIsEmpty() { + void whenPacketLacksDomainPresence_domainNamespaceIsEmpty() { assertThat(getFormattedMessageInFiber().get("namespace"), equalTo("")); } @Test - public void whenPacketContainsDomainPresence_retrieveDomainNamespace() { + void whenPacketContainsDomainPresence_retrieveDomainNamespace() { testSupport.addDomainPresenceInfo(new DomainPresenceInfo("test-ns", "test-uid")); assertThat(getFormattedMessageInFiber().get("namespace"), equalTo("test-ns")); } @Test - public void whenPacketContainsDomainPresenceAndLoggingContext_retrieveDomainNamespaceFromDomainPresence() { + void whenPacketContainsDomainPresenceAndLoggingContext_retrieveDomainNamespaceFromDomainPresence() { testSupport.addDomainPresenceInfo(new DomainPresenceInfo("test-ns", "test-uid")); testSupport.addLoggingContext(new LoggingContext().namespace("test-lc-ns")); @@ -154,14 +154,14 @@ public void whenPacketContainsDomainPresenceAndLoggingContext_retrieveDomainName } @Test - public void whenPacketContainsLoggingContext_retrieveDomainNamespace() { + void whenPacketContainsLoggingContext_retrieveDomainNamespace() { testSupport.addLoggingContext(new LoggingContext().namespace("test-lc-ns")); assertThat(getFormattedMessageInFiber().get("namespace"), equalTo("test-lc-ns")); } @Test - public void whenPacketContainsLoggingContextAndThreadLocalIsDefined_retrieveNamespaceFromLoggingContext() { + void whenPacketContainsLoggingContextAndThreadLocalIsDefined_retrieveNamespaceFromLoggingContext() { testSupport.addLoggingContext(new LoggingContext().namespace("test-lc-ns1")); try (LoggingContext stack = LoggingContext.setThreadContext().namespace("test-lc-tl-ns")) { assertThat(getFormattedMessageInFiber().get("namespace"), equalTo("test-lc-ns1")); @@ -169,14 +169,14 @@ public void whenPacketContainsLoggingContextAndThreadLocalIsDefined_retrieveName } @Test - public void whenThreadLocalDefinedAndPacketContainsNoDomainPresenceOrLoggingContext_retrieveNamespaceFromThread() { + void whenThreadLocalDefinedAndPacketContainsNoDomainPresenceOrLoggingContext_retrieveNamespaceFromThread() { try (LoggingContext stack = LoggingContext.setThreadContext().namespace("test-lc-tl-ns1")) { assertThat(getFormattedMessageInFiber().get("namespace"), equalTo("test-lc-tl-ns1")); } } @Test - public void whenNotInFiber_retrieveNamespaceFromThread() throws JsonProcessingException { + void whenNotInFiber_retrieveNamespaceFromThread() throws JsonProcessingException { try (LoggingContext stack = LoggingContext.setThreadContext().namespace("test-lc-tl-ns1")) { assertThat(getFormattedMessage().get("namespace"), equalTo("test-lc-tl-ns1")); } diff --git a/operator/src/test/java/oracle/kubernetes/operator/logging/OncePerMessageLoggingFilterTest.java b/operator/src/test/java/oracle/kubernetes/operator/logging/OncePerMessageLoggingFilterTest.java index 3ef833c6520..280ee2929bf 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/logging/OncePerMessageLoggingFilterTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/logging/OncePerMessageLoggingFilterTest.java @@ -8,10 +8,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -public class OncePerMessageLoggingFilterTest { +class OncePerMessageLoggingFilterTest { @Test - public void verifyCanLogReturnsFalseForRepeatedMessage() { + void verifyCanLogReturnsFalseForRepeatedMessage() { final String message = "some log message"; OncePerMessageLoggingFilter loggingFilter = new OncePerMessageLoggingFilter(); loggingFilter.setFiltering(true); @@ -21,7 +21,7 @@ public void verifyCanLogReturnsFalseForRepeatedMessage() { } @Test - public void verifyCanLogReturnsFalseForRepeatedNullMessage() { + void verifyCanLogReturnsFalseForRepeatedNullMessage() { final String message = null; OncePerMessageLoggingFilter loggingFilter = new OncePerMessageLoggingFilter(); loggingFilter.setFiltering(true); @@ -31,7 +31,7 @@ public void verifyCanLogReturnsFalseForRepeatedNullMessage() { } @Test - public void verifyCanLogReturnsTrueForRepeatedMessageWithoutFiltering() { + void verifyCanLogReturnsTrueForRepeatedMessageWithoutFiltering() { final String message = "some log message"; OncePerMessageLoggingFilter loggingFilter = new OncePerMessageLoggingFilter(); @@ -40,7 +40,7 @@ public void verifyCanLogReturnsTrueForRepeatedMessageWithoutFiltering() { } @Test - public void verifyCanLogReturnsTrueForDifferentMessage() { + void verifyCanLogReturnsTrueForDifferentMessage() { final String message = "some log message"; final String message2 = "another log message"; OncePerMessageLoggingFilter loggingFilter = new OncePerMessageLoggingFilter(); @@ -51,7 +51,7 @@ public void verifyCanLogReturnsTrueForDifferentMessage() { } @Test - public void verifyMessageHistoryKeptBeforeFilteringIsOn() { + void verifyMessageHistoryKeptBeforeFilteringIsOn() { final String message = "some log message"; OncePerMessageLoggingFilter loggingFilter = new OncePerMessageLoggingFilter(); @@ -63,7 +63,7 @@ public void verifyMessageHistoryKeptBeforeFilteringIsOn() { } @Test - public void verifyResetHistoryClearsLogHistory() { + void verifyResetHistoryClearsLogHistory() { final String message = "some log message"; OncePerMessageLoggingFilter loggingFilter = new OncePerMessageLoggingFilter(); @@ -75,7 +75,7 @@ public void verifyResetHistoryClearsLogHistory() { } @Test - public void verifyCanLogReturnsTrueOnceAfterReenablingFilteringAfterOffAndReset() { + void verifyCanLogReturnsTrueOnceAfterReenablingFilteringAfterOffAndReset() { final String message = "some log message"; OncePerMessageLoggingFilter loggingFilter = new OncePerMessageLoggingFilter(); @@ -91,7 +91,7 @@ public void verifyCanLogReturnsTrueOnceAfterReenablingFilteringAfterOffAndReset( } @Test - public void verifyCanLogReturnsFalseAfterReenablingFilteringAfterOffWithoutReset() { + void verifyCanLogReturnsFalseAfterReenablingFilteringAfterOffWithoutReset() { final String message = "some log message"; OncePerMessageLoggingFilter loggingFilter = new OncePerMessageLoggingFilter(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/rest/RestBackendImplTest.java b/operator/src/test/java/oracle/kubernetes/operator/rest/RestBackendImplTest.java index 629164d5d7a..7572a391bf1 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/rest/RestBackendImplTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/rest/RestBackendImplTest.java @@ -57,7 +57,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; @SuppressWarnings("SameParameterValue") -public class RestBackendImplTest { +class RestBackendImplTest { private static final int REPLICA_LIMIT = 4; private static final String NS = "namespace1"; @@ -128,7 +128,7 @@ public void tearDown() { // functionality needed for Domains resource @Test - public void retrieveRegisteredDomainIds() { + void retrieveRegisteredDomainIds() { createNamespaceWithDomains("ns2", DOMAIN3, DOMAIN4); namespaces.add("ns2"); @@ -145,29 +145,29 @@ private void createNamespaceWithDomains(String ns, String... domainNames) { // functionality needed for Domain resource @Test - public void validateKnownUid() { + void validateKnownUid() { assertThat(restBackend.isDomainUid(DOMAIN2), is(true)); } @Test - public void rejectUnknownUid() { + void rejectUnknownUid() { assertThat(restBackend.isDomainUid("no_such_uid"), is(false)); } @Test - public void whenUnknownDomain_throwException() { + void whenUnknownDomain_throwException() { assertThrows(WebApplicationException.class, () -> restBackend.performDomainAction("no_such_uid", new DomainAction(DomainActionType.INTROSPECT))); } @Test - public void whenUnknownDomainUpdateCommand_throwException() { + void whenUnknownDomainUpdateCommand_throwException() { assertThrows(WebApplicationException.class, () -> restBackend.performDomainAction(DOMAIN1, new DomainAction(null))); } @Test - public void whenIntrospectionRequestedWhileNoIntrospectVersionDefined_setIntrospectVersion() { + void whenIntrospectionRequestedWhileNoIntrospectVersionDefined_setIntrospectVersion() { restBackend.performDomainAction(DOMAIN1, createIntrospectRequest()); assertThat(getUpdatedIntrospectVersion(), equalTo(INITIAL_VERSION)); @@ -195,7 +195,7 @@ private boolean isDomain1Meta(V1ObjectMeta meta) { } @Test - public void whenIntrospectionRequestedWhileIntrospectVersionNonNumeric_setNumericVersion() { + void whenIntrospectionRequestedWhileIntrospectVersionNonNumeric_setNumericVersion() { configurator.withIntrospectVersion("zork"); restBackend.performDomainAction(DOMAIN1, createIntrospectRequest()); @@ -204,7 +204,7 @@ public void whenIntrospectionRequestedWhileIntrospectVersionNonNumeric_setNumeri } @Test - public void whenIntrospectionRequestedWhileIntrospectVersionDefined_incrementIntrospectVersion() { + void whenIntrospectionRequestedWhileIntrospectVersionDefined_incrementIntrospectVersion() { configurator.withIntrospectVersion("17"); restBackend.performDomainAction(DOMAIN1, createIntrospectRequest()); @@ -213,7 +213,7 @@ public void whenIntrospectionRequestedWhileIntrospectVersionDefined_incrementInt } @Test - public void whenClusterRestartRequestedWhileNoRestartVersionDefined_setRestartVersion() { + void whenClusterRestartRequestedWhileNoRestartVersionDefined_setRestartVersion() { restBackend.performDomainAction(DOMAIN1, createDomainRestartRequest()); assertThat(getUpdatedRestartVersion(), equalTo(INITIAL_VERSION)); @@ -228,7 +228,7 @@ private String getUpdatedRestartVersion() { } @Test - public void whenRestartRequestedWhileRestartVersionDefined_incrementIntrospectVersion() { + void whenRestartRequestedWhileRestartVersionDefined_incrementIntrospectVersion() { configurator.withRestartVersion("23"); restBackend.performDomainAction(DOMAIN1, createDomainRestartRequest()); @@ -239,7 +239,7 @@ public void whenRestartRequestedWhileRestartVersionDefined_incrementIntrospectVe // functionality needed for clusters resource @Test - public void retrieveDefinedClusters() { + void retrieveDefinedClusters() { domain1ConfigSupport.addWlsCluster("cluster1", "ms1", "ms2", "ms3"); domain1ConfigSupport.addWlsCluster("cluster2", "ms4", "ms5", "ms6"); setupScanCache(); @@ -250,7 +250,7 @@ public void retrieveDefinedClusters() { // functionality needed for cluster resource @Test - public void acceptDefinedClusterName() { + void acceptDefinedClusterName() { domain1ConfigSupport.addWlsCluster("cluster1", "ms1", "ms2", "ms3"); domain1ConfigSupport.addWlsCluster("cluster2", "ms4", "ms5", "ms6"); setupScanCache(); @@ -259,7 +259,7 @@ public void acceptDefinedClusterName() { } @Test - public void rejectUndefinedClusterName() { + void rejectUndefinedClusterName() { domain1ConfigSupport.addWlsCluster("cluster1", "ms1", "ms2", "ms3"); domain1ConfigSupport.addWlsCluster("cluster2", "ms4", "ms5", "ms6"); setupScanCache(); @@ -268,7 +268,7 @@ public void rejectUndefinedClusterName() { } @Test - public void whenDomainRestartRequestedWhileNoRestartVersionDefined_setRestartVersion() { + void whenDomainRestartRequestedWhileNoRestartVersionDefined_setRestartVersion() { restBackend.performDomainAction(DOMAIN1, createDomainRestartRequest()); assertThat(getUpdatedRestartVersion(), equalTo(INITIAL_VERSION)); @@ -277,13 +277,13 @@ public void whenDomainRestartRequestedWhileNoRestartVersionDefined_setRestartVer // functionality used for scale resource @Test - public void whenNegativeScaleSpecified_throwException() { + void whenNegativeScaleSpecified_throwException() { assertThrows(WebApplicationException.class, () -> restBackend.scaleCluster(DOMAIN1, "cluster1", -1)); } @Test - public void whenPerClusterReplicaSettingMatchesScaleRequest_doNothing() { + void whenPerClusterReplicaSettingMatchesScaleRequest_doNothing() { configureCluster("cluster1").withReplicas(5); restBackend.scaleCluster(DOMAIN1, "cluster1", 5); @@ -300,7 +300,7 @@ private ClusterConfigurator configureCluster(String clusterName) { } @Test - public void whenPerClusterReplicaSetting_scaleClusterUpdatesSetting() { + void whenPerClusterReplicaSetting_scaleClusterUpdatesSetting() { configureCluster("cluster1").withReplicas(1); restBackend.scaleCluster(DOMAIN1, "cluster1", 5); @@ -309,7 +309,7 @@ public void whenPerClusterReplicaSetting_scaleClusterUpdatesSetting() { } @Test - public void whenNoPerClusterReplicaSettingAndDefaultMatchesRequest_doNothing() { + void whenNoPerClusterReplicaSettingAndDefaultMatchesRequest_doNothing() { configureDomain().withDefaultReplicaCount(REPLICA_LIMIT); restBackend.scaleCluster(DOMAIN1, "cluster1", REPLICA_LIMIT); @@ -318,7 +318,7 @@ public void whenNoPerClusterReplicaSettingAndDefaultMatchesRequest_doNothing() { } @Test - public void whenReplaceDomainReturnsError_scaleClusterThrowsException() { + void whenReplaceDomainReturnsError_scaleClusterThrowsException() { testSupport.failOnResource(DOMAIN, DOMAIN2, NS, HTTP_CONFLICT); DomainConfiguratorFactory.forDomain(domain2).configureCluster("cluster1").withReplicas(2); @@ -328,14 +328,14 @@ public void whenReplaceDomainReturnsError_scaleClusterThrowsException() { } @Test - public void verify_getWlsDomainConfig_returnsWlsDomainConfig() { + void verify_getWlsDomainConfig_returnsWlsDomainConfig() { WlsDomainConfig wlsDomainConfig = ((RestBackendImpl) restBackend).getWlsDomainConfig(DOMAIN1); assertThat(wlsDomainConfig.getName(), equalTo(DOMAIN1)); } @Test - public void verify_getWlsDomainConfig_doesNotReturnNull_whenNoSuchDomainUid() { + void verify_getWlsDomainConfig_doesNotReturnNull_whenNoSuchDomainUid() { WlsDomainConfig wlsDomainConfig = ((RestBackendImpl) restBackend).getWlsDomainConfig("NoSuchDomainUID"); @@ -343,7 +343,7 @@ public void verify_getWlsDomainConfig_doesNotReturnNull_whenNoSuchDomainUid() { } @Test - public void verify_getWlsDomainConfig_doesNotReturnNull_whenScanIsNull() { + void verify_getWlsDomainConfig_doesNotReturnNull_whenScanIsNull() { config = null; WlsDomainConfig wlsDomainConfig = ((RestBackendImpl) restBackend).getWlsDomainConfig(DOMAIN1); @@ -352,20 +352,20 @@ public void verify_getWlsDomainConfig_doesNotReturnNull_whenScanIsNull() { } @Test - public void whenUsingAccessToken_userInfoIsNull() { + void whenUsingAccessToken_userInfoIsNull() { RestBackendImpl restBackend = new RestBackendImpl("", "", this::getDomainNamespaces); assertThat(restBackend.getUserInfo(), nullValue()); } @Test - public void whenUsingTokenReview_userInfoNotNull() { + void whenUsingTokenReview_userInfoNotNull() { TuningParameters.getInstance().put("tokenReviewAuthentication", "true"); RestBackendImpl restBackend = new RestBackendImpl("", "", this::getDomainNamespaces); assertThat(restBackend.getUserInfo(), notNullValue()); } @Test - public void whenUsingAccessToken_authorizationCheckNotCalled() { + void whenUsingAccessToken_authorizationCheckNotCalled() { AuthorizationProxyStub authorizationProxyStub = new AuthorizationProxyStub(); RestBackendImpl restBackendImpl = new RestBackendImpl("", "", this::getDomainNamespaces) .withAuthorizationProxy(authorizationProxyStub); @@ -374,7 +374,7 @@ public void whenUsingAccessToken_authorizationCheckNotCalled() { } @Test - public void whenUsingTokenReview_authorizationCheckCalled() { + void whenUsingTokenReview_authorizationCheckCalled() { TuningParameters.getInstance().put("tokenReviewAuthentication", "true"); AuthorizationProxyStub authorizationProxyStub = new AuthorizationProxyStub(); RestBackendImpl restBackend = new RestBackendImpl("", "", this::getDomainNamespaces) @@ -384,7 +384,7 @@ public void whenUsingTokenReview_authorizationCheckCalled() { } @Test - public void whenUsingAccessToken_configureApiClient() { + void whenUsingAccessToken_configureApiClient() { RestBackendImpl restBackend = new RestBackendImpl("", "1234", this::getDomainNamespaces); ApiClient apiClient = restBackend.getCallBuilder().getClientPool().take(); Authentication authentication = apiClient.getAuthentication("BearerToken"); @@ -394,7 +394,7 @@ public void whenUsingAccessToken_configureApiClient() { } @Test - public void whenUsingTokenReview_configureApiClient() { + void whenUsingTokenReview_configureApiClient() { TuningParameters.getInstance().put("tokenReviewAuthentication", "true"); RestBackendImpl restBackend = new RestBackendImpl("", "", this::getDomainNamespaces); ApiClient apiClient = restBackend.getCallBuilder().getClientPool().take(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/rest/RestTest.java b/operator/src/test/java/oracle/kubernetes/operator/rest/RestTest.java index 1ef806b729c..c4c2b176242 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/rest/RestTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/rest/RestTest.java @@ -46,7 +46,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; @SuppressWarnings("SameParameterValue") -public class RestTest extends JerseyTest { +class RestTest extends JerseyTest { private static final String V1 = "v1"; private static final String OPERATOR_HREF = "/operator"; private static final String V1_HREF = OPERATOR_HREF + "/" + V1; @@ -96,28 +96,28 @@ protected TestContainerFactory getTestContainerFactory() throws TestContainerExc } @Test - public void whenNoAuthenticationHeader_rejectRequest() { + void whenNoAuthenticationHeader_rejectRequest() { excludeAuthorizationHeader(); assertThat(createRequest(OPERATOR_HREF).get().getStatus(), equalTo(HTTP_UNAUTHORIZED)); } @Test - public void whenAuthenticationHeaderLacksBearerPrefix_rejectRequest() { + void whenAuthenticationHeaderLacksBearerPrefix_rejectRequest() { removeBearerPrefix(); assertThat(createRequest(OPERATOR_HREF).get().getStatus(), equalTo(HTTP_UNAUTHORIZED)); } @Test - public void whenAuthenticationHeaderLacksAccessToken_rejectRequest() { + void whenAuthenticationHeaderLacksAccessToken_rejectRequest() { removeAccessToken(); assertThat(createRequest(OPERATOR_HREF).get().getStatus(), equalTo(HTTP_UNAUTHORIZED)); } @Test - public void operatorEndPoint_returnsVersion() { + void operatorEndPoint_returnsVersion() { Map result = getJsonResponse(OPERATOR_HREF); assertThat(result, hasJsonPath("$.items[0].version", equalTo("v1"))); @@ -142,7 +142,7 @@ private Invocation.Builder createRequest(String href) { } @Test - public void v1EndPoint_returnsVersionAndLinks() { + void v1EndPoint_returnsVersionAndLinks() { Map result = getJsonResponse(V1_HREF); assertThat(result, hasJsonPath("$.version", equalTo("v1"))); @@ -153,7 +153,7 @@ public void v1EndPoint_returnsVersionAndLinks() { } @Test - public void latestVersionEndPoint_returnsVersionAndLinks() { + void latestVersionEndPoint_returnsVersionAndLinks() { Map result = getJsonResponse(LATEST_HREF); assertThat(result, hasJsonPath("$.version", equalTo("v1"))); @@ -163,12 +163,12 @@ public void latestVersionEndPoint_returnsVersionAndLinks() { } @Test - public void nonexistingVersionEndPoint_fails() { + void nonexistingVersionEndPoint_fails() { assertThat(getResponseStatus(OPERATOR_HREF + "/v99"), equalTo(HTTP_NOT_FOUND)); } @Test - public void swaggerEndPoint_returnsSwaggerFile() { + void swaggerEndPoint_returnsSwaggerFile() { Map result = getJsonResponse(SWAGGER_HREF); assertThat(result, hasJsonPath("$.swagger", equalTo("2.0"))); @@ -177,7 +177,7 @@ public void swaggerEndPoint_returnsSwaggerFile() { } @Test - public void domainsEndPoint_returnsListOfDomainsAndLinks() { + void domainsEndPoint_returnsListOfDomainsAndLinks() { defineDomains("uid1", "uid2"); Map result = getJsonResponse(DOMAINS_HREF); @@ -194,7 +194,7 @@ public void domainsEndPoint_returnsListOfDomainsAndLinks() { } @Test - public void existingDomainEndPoint_returnsDomainsUidAndClusterLink() { + void existingDomainEndPoint_returnsDomainsUidAndClusterLink() { defineDomains("uid1", "uid2"); Map result = getJsonResponse(DOMAINS_HREF + "/uid1"); @@ -209,14 +209,14 @@ public void existingDomainEndPoint_returnsDomainsUidAndClusterLink() { } @Test - public void nonexistingDomainEndPoint_fails() { + void nonexistingDomainEndPoint_fails() { defineDomains("uid1", "uid2"); assertThat(getResponseStatus(DOMAINS_HREF + "/uid3"), equalTo(HTTP_NOT_FOUND)); } @Test - public void clustersEndPoint_returnsListOfClustersAndLinks() { + void clustersEndPoint_returnsListOfClustersAndLinks() { defineClusters("uid1", "cluster1", "cluster2"); Map result = getJsonResponse(DOMAIN1_CLUSTERS_HREF); @@ -238,7 +238,7 @@ public void clustersEndPoint_returnsListOfClustersAndLinks() { } @Test - public void existingClusterEndPoint_returnsClusterNameAndScalingLink() { + void existingClusterEndPoint_returnsClusterNameAndScalingLink() { defineClusters("uid1", "cluster1", "cluster2"); Map result = getJsonResponse(DOMAIN1_CLUSTERS_HREF + "/cluster1"); @@ -258,14 +258,14 @@ public void existingClusterEndPoint_returnsClusterNameAndScalingLink() { } @Test - public void nonexistingClusterEndPoint_fails() { + void nonexistingClusterEndPoint_fails() { defineClusters("uid1", "cluster1", "cluster2"); assertThat(getResponseStatus(DOMAIN1_CLUSTERS_HREF + "/cluster3"), equalTo(HTTP_NOT_FOUND)); } @Test - public void scaleExistingCluster() { + void scaleExistingCluster() { defineClusters("uid1", "cluster1", "cluster2"); sendScaleRequest("cluster1", 3); @@ -279,12 +279,12 @@ private Response sendScaleRequest(String cluster, int numManagedServers) { } @Test - public void whenClusterUndefined_scalingIsRejected() { + void whenClusterUndefined_scalingIsRejected() { assertThat(sendScaleRequest("cluster1", 3).getStatus(), equalTo(HTTP_NOT_FOUND)); } @Test - public void whenRequestedByHeaderMissing_scalingIsRejected() { + void whenRequestedByHeaderMissing_scalingIsRejected() { excludeRequestedByHeader(); defineClusters("uid1", "cluster1", "cluster2"); diff --git a/operator/src/test/java/oracle/kubernetes/operator/steps/BeforeAdminServiceStepTest.java b/operator/src/test/java/oracle/kubernetes/operator/steps/BeforeAdminServiceStepTest.java index 96a27c4f872..16535709c29 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/steps/BeforeAdminServiceStepTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/steps/BeforeAdminServiceStepTest.java @@ -28,7 +28,7 @@ import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class BeforeAdminServiceStepTest { +class BeforeAdminServiceStepTest { private static final String DOMAIN_NAME = "domain"; private static final String ADMIN_NAME = "admin"; @@ -86,7 +86,7 @@ public void tearDown() throws Exception { } @Test - public void afterProcessing_packetContainsAdminServerNameAndPort() { + void afterProcessing_packetContainsAdminServerNameAndPort() { Packet packet = invokeStep(); assertThat(packet, hasEntry(SERVER_NAME, ADMIN_NAME)); diff --git a/operator/src/test/java/oracle/kubernetes/operator/steps/ManagedServerUpIteratorStepTest.java b/operator/src/test/java/oracle/kubernetes/operator/steps/ManagedServerUpIteratorStepTest.java index 73e4b1ef8df..9157b2b373f 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/steps/ManagedServerUpIteratorStepTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/steps/ManagedServerUpIteratorStepTest.java @@ -65,7 +65,7 @@ import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class ManagedServerUpIteratorStepTest extends ThreadFactoryTestBase implements WatchListener, +class ManagedServerUpIteratorStepTest extends ThreadFactoryTestBase implements WatchListener, StubWatchFactory.AllWatchesClosedListener { protected static final String DOMAIN_NAME = "domain1"; @@ -227,7 +227,7 @@ protected PodWatcher createWatcher(String ns, AtomicBoolean stopping, BigInteger } @Test - public void withMultipleServersAvailableToStart_onlyOneForEachClusterInitiallyStarts() { + void withMultipleServersAvailableToStart_onlyOneForEachClusterInitiallyStarts() { configureCluster(CLUSTER1).withMaxConcurrentStartup(0); configureCluster(CLUSTER2).withMaxConcurrentStartup(1); addWlsCluster(CLUSTER1, MS1, MS2); @@ -255,7 +255,7 @@ private String getServerName(@Nonnull Map labels) { } @Test - public void whenConcurrencyLimitDisabled_additionalClusteredServersStartsAfterPreviousIsScheduled() { + void whenConcurrencyLimitDisabled_additionalClusteredServersStartsAfterPreviousIsScheduled() { configureCluster(CLUSTER1).withMaxConcurrentStartup(0); addWlsCluster(CLUSTER1, MS1, MS2, MS3); @@ -266,7 +266,7 @@ public void whenConcurrencyLimitDisabled_additionalClusteredServersStartsAfterPr } @Test - public void whenConcurrencyLimitIs1_secondClusteredServerDoesNotStartIfFirstIsNotReady() { + void whenConcurrencyLimitIs1_secondClusteredServerDoesNotStartIfFirstIsNotReady() { configureCluster(CLUSTER1).withMaxConcurrentStartup(1); addWlsCluster(CLUSTER1, MS1, MS2); @@ -277,7 +277,7 @@ public void whenConcurrencyLimitIs1_secondClusteredServerDoesNotStartIfFirstIsNo } @Test - public void whileAdminServerStopped_canStartManagedServer() { + void whileAdminServerStopped_canStartManagedServer() { createDomainPresenceInfoWithNoAdminServer(); addWlsCluster(CLUSTER1, MS1); @@ -294,7 +294,7 @@ private void createDomainPresenceInfoWithNoAdminServer() { } @Test - public void whenConcurrencyLimitIs1_secondClusteredServerStartsAfterFirstIsReady() { + void whenConcurrencyLimitIs1_secondClusteredServerStartsAfterFirstIsReady() { configureCluster(CLUSTER1).withMaxConcurrentStartup(1); addWlsCluster(CLUSTER1, MS1, MS2); @@ -305,7 +305,7 @@ public void whenConcurrencyLimitIs1_secondClusteredServerStartsAfterFirstIsReady } @Test - public void whenConcurrencyLimitIs2_secondClusteredServerStartsAfterFirstIsScheduledButNotThird() { + void whenConcurrencyLimitIs2_secondClusteredServerStartsAfterFirstIsScheduledButNotThird() { configureCluster(CLUSTER1).withMaxConcurrentStartup(2); addWlsCluster(CLUSTER1, MS1, MS2, MS3, MS4); @@ -316,7 +316,7 @@ public void whenConcurrencyLimitIs2_secondClusteredServerStartsAfterFirstIsSched } @Test - public void whenConcurrencyLimitIs2_nextTwoStartAfterFirstTwoAreReady() { + void whenConcurrencyLimitIs2_nextTwoStartAfterFirstTwoAreReady() { configureCluster(CLUSTER1).withMaxConcurrentStartup(2); addWlsCluster(CLUSTER1, MS1, MS2, MS3, MS4); @@ -327,7 +327,7 @@ public void whenConcurrencyLimitIs2_nextTwoStartAfterFirstTwoAreReady() { } @Test - public void nonClusteredServers_ignoreConcurrencyLimit() { + void nonClusteredServers_ignoreConcurrencyLimit() { domain.getSpec().setMaxClusterConcurrentStartup(1); addWlsServers(MS1, MS2, MS3); @@ -338,7 +338,7 @@ public void nonClusteredServers_ignoreConcurrencyLimit() { } @Test - public void withMultipleClusters_differentClusterScheduleAndStartDifferently() { + void withMultipleClusters_differentClusterScheduleAndStartDifferently() { configureCluster(CLUSTER1).withMaxConcurrentStartup(0); configureCluster(CLUSTER2).withMaxConcurrentStartup(1); addWlsCluster(CLUSTER1, MS1, MS2); @@ -351,7 +351,7 @@ public void withMultipleClusters_differentClusterScheduleAndStartDifferently() { } @Test - public void whenClusteredServersAlreadyScheduled_canStartNonclusteredServer() { + void whenClusteredServersAlreadyScheduled_canStartNonclusteredServer() { domain.getSpec().setMaxClusterConcurrentStartup(1); Arrays.asList(MS1, MS2).forEach(this::addScheduledClusteredServer); addWlsServer(MS3); diff --git a/operator/src/test/java/oracle/kubernetes/operator/steps/ManagedServersUpStepTest.java b/operator/src/test/java/oracle/kubernetes/operator/steps/ManagedServersUpStepTest.java index 599a8f61af7..4ad3041ea4a 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/steps/ManagedServersUpStepTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/steps/ManagedServersUpStepTest.java @@ -91,7 +91,7 @@ * servers should be running. */ @SuppressWarnings({"ConstantConditions", "SameParameterValue"}) -public class ManagedServersUpStepTest { +class ManagedServersUpStepTest { private static final String DOMAIN = "domain"; private static final String NS = "namespace"; @@ -160,7 +160,7 @@ public void tearDown() throws Exception { } @Test - public void whenEnabled_logCurrentServers() { + void whenEnabled_logCurrentServers() { List messages = new ArrayList<>(); consoleHandlerMemento.withLogLevel(Level.FINE).collectLogMessages(messages, SERVERS_UP_MSG); addRunningServer("admin"); @@ -190,7 +190,7 @@ private void addDynamicWlsCluster(String clusterName, } @Test - public void whenStartPolicyUndefined_startServers() { + void whenStartPolicyUndefined_startServers() { invokeStepWithConfiguredServer(); assertServersToBeStarted(); @@ -203,7 +203,7 @@ private void invokeStepWithConfiguredServer() { } @Test - public void whenStartPolicyIfNeeded_startServers() { + void whenStartPolicyIfNeeded_startServers() { setDefaultServerStartPolicy(ConfigurationConstants.START_IF_NEEDED); invokeStepWithConfiguredServer(); @@ -212,7 +212,7 @@ public void whenStartPolicyIfNeeded_startServers() { } @Test - public void whenStartPolicyAlways_startServers() { + void whenStartPolicyAlways_startServers() { startAllServers(); invokeStepWithConfiguredServer(); @@ -233,7 +233,7 @@ private void assertServersToBeStarted() { } @Test - public void whenStartPolicyAdminOnly_dontStartServers() { + void whenStartPolicyAdminOnly_dontStartServers() { startAdminServerOnly(); invokeStepWithConfiguredServer(); @@ -249,7 +249,7 @@ private void startAdminServerOnly() { } @Test - public void whenNoServerStartRequested_dontStartServers() { + void whenNoServerStartRequested_dontStartServers() { startNoServers(); invokeStepWithConfiguredServer(); @@ -262,7 +262,7 @@ private void startNoServers() { } @Test - public void whenWlsServerInDomainSpec_addToServerList() { + void whenWlsServerInDomainSpec_addToServerList() { configureServerToStart("wls1"); addWlsServer("wls1"); @@ -272,7 +272,7 @@ public void whenWlsServerInDomainSpec_addToServerList() { } @Test - public void whenServerInDomainSpecButNotDefinedInWls_dontAddToServerList() { + void whenServerInDomainSpecButNotDefinedInWls_dontAddToServerList() { configureServerToStart("wls1"); invokeStep(); @@ -281,7 +281,7 @@ public void whenServerInDomainSpecButNotDefinedInWls_dontAddToServerList() { } @Test - public void whenMultipleWlsServersInDomainSpec_addToServerList() { + void whenMultipleWlsServersInDomainSpec_addToServerList() { configureServers("wls1", "wls2", "wls3"); addWlsServers("wls1", "wls2", "wls3"); @@ -291,7 +291,7 @@ public void whenMultipleWlsServersInDomainSpec_addToServerList() { } @Test - public void whenMultipleWlsServersInDomainSpec_skipAdminServer() { + void whenMultipleWlsServersInDomainSpec_skipAdminServer() { defineAdminServer(); configureServers("wls1", ADMIN, "wls3"); addWlsServers("wls1", ADMIN, "wls3"); @@ -302,7 +302,7 @@ public void whenMultipleWlsServersInDomainSpec_skipAdminServer() { } @Test - public void whenWlsServersDuplicatedInDomainSpec_skipDuplicates() { + void whenWlsServersDuplicatedInDomainSpec_skipDuplicates() { defineAdminServer(); configureServers("wls1", "wls1", "wls2"); addWlsServers("wls1", "wls2"); @@ -313,7 +313,7 @@ public void whenWlsServersDuplicatedInDomainSpec_skipDuplicates() { } @Test - public void whenWlsServersInDomainSpec_addStartupInfo() { + void whenWlsServersInDomainSpec_addStartupInfo() { configureServerToStart("wls1"); configureServerToStart("wls2"); addWlsServers("wls1", "wls2"); @@ -325,7 +325,7 @@ public void whenWlsServersInDomainSpec_addStartupInfo() { } @Test - public void serverStartupInfo_containsEnvironmentVariable() { + void serverStartupInfo_containsEnvironmentVariable() { configureServerToStart("wls1") .withEnvironmentVariable("item1", "value1") .withEnvironmentVariable("item2", "value2"); @@ -339,7 +339,7 @@ public void serverStartupInfo_containsEnvironmentVariable() { } @Test - public void whenWlsServerNotInCluster_serverStartupInfoHasNoClusterConfig() { + void whenWlsServerNotInCluster_serverStartupInfoHasNoClusterConfig() { configureServerToStart("wls1"); addWlsServer("wls1"); @@ -349,7 +349,7 @@ public void whenWlsServerNotInCluster_serverStartupInfoHasNoClusterConfig() { } @Test - public void whenWlsServerInCluster_serverStartupInfoHasMatchingClusterConfig() { + void whenWlsServerInCluster_serverStartupInfoHasMatchingClusterConfig() { configureServerToStart("ms1"); addWlsCluster("cluster1", "ms1"); @@ -361,7 +361,7 @@ public void whenWlsServerInCluster_serverStartupInfoHasMatchingClusterConfig() { } @Test - public void whenClusterStartupDefinedForServerNotRunning_addToServers() { + void whenClusterStartupDefinedForServerNotRunning_addToServers() { configureServerToStart("ms1"); configureCluster("cluster1"); addWlsCluster("cluster1", "ms1"); @@ -372,7 +372,7 @@ public void whenClusterStartupDefinedForServerNotRunning_addToServers() { } @Test - public void whenClusterStartupDefinedWithZeroReplicas_addNothingToServers() { + void whenClusterStartupDefinedWithZeroReplicas_addNothingToServers() { configureCluster("cluster1").withReplicas(0); addWlsCluster("cluster1", "ms1", "ms2"); @@ -382,7 +382,7 @@ public void whenClusterStartupDefinedWithZeroReplicas_addNothingToServers() { } @Test - public void whenServerStartupNotDefined_useEnvForCluster() { + void whenServerStartupNotDefined_useEnvForCluster() { configureCluster("cluster1").withEnvironmentVariable("item1", "value1"); addWlsCluster("cluster1", "ms1"); @@ -394,7 +394,7 @@ public void whenServerStartupNotDefined_useEnvForCluster() { } @Test - public void withStartSpecifiedWhenWlsClusterNotInDomainSpec_dontAddServersToList() { + void withStartSpecifiedWhenWlsClusterNotInDomainSpec_dontAddServersToList() { startConfiguredServers(); setDefaultReplicas(0); setCluster1Replicas(3); @@ -406,7 +406,7 @@ public void withStartSpecifiedWhenWlsClusterNotInDomainSpec_dontAddServersToList } @Test - public void withStartNoneWhenWlsClusterNotInDomainSpec_dontAddServersToList() { + void withStartNoneWhenWlsClusterNotInDomainSpec_dontAddServersToList() { startNoServers(); setCluster1Replicas(3); addWlsCluster("cluster1", "ms1", "ms2", "ms3", "ms4", "ms5"); @@ -417,7 +417,7 @@ public void withStartNoneWhenWlsClusterNotInDomainSpec_dontAddServersToList() { } @Test - public void withStartAdminWhenWlsClusterNotInDomainSpec_dontAddServersToList() { + void withStartAdminWhenWlsClusterNotInDomainSpec_dontAddServersToList() { startAdminServerOnly(); setCluster1Replicas(3); addWlsCluster("cluster1", "ms1", "ms2", "ms3", "ms4", "ms5"); @@ -428,7 +428,7 @@ public void withStartAdminWhenWlsClusterNotInDomainSpec_dontAddServersToList() { } @Test - public void withStartAutoWhenWlsClusterNotInDomainSpec_addServersToListUpToReplicaLimit() { + void withStartAutoWhenWlsClusterNotInDomainSpec_addServersToListUpToReplicaLimit() { setDefaultServerStartPolicy(ConfigurationConstants.START_IF_NEEDED); setCluster1Replicas(3); addWlsCluster("cluster1", "ms1", "ms2", "ms3", "ms4", "ms5"); @@ -439,7 +439,7 @@ public void withStartAutoWhenWlsClusterNotInDomainSpec_addServersToListUpToRepli } @Test - public void withStartAllWhenWlsClusterNotInDomainSpec_addClusteredServersToListUpWithoutLimit() { + void withStartAllWhenWlsClusterNotInDomainSpec_addClusteredServersToListUpWithoutLimit() { startAllServers(); setCluster1Replicas(3); addWlsCluster("cluster1", "ms1", "ms2", "ms3", "ms4", "ms5"); @@ -452,7 +452,7 @@ public void withStartAllWhenWlsClusterNotInDomainSpec_addClusteredServersToListU } @Test - public void whenWlsClusterNotInDomainSpec_recordServerAndClusterConfigs() { + void whenWlsClusterNotInDomainSpec_recordServerAndClusterConfigs() { setCluster1Replicas(3); addWlsServers("ms1", "ms2", "ms3", "ms4", "ms5"); addWlsCluster("cluster1", "ms1", "ms2", "ms3", "ms4", "ms5"); @@ -465,7 +465,7 @@ public void whenWlsClusterNotInDomainSpec_recordServerAndClusterConfigs() { } @Test - public void whenWlsClusterNotInDomainSpec_startUpToLimit() { + void whenWlsClusterNotInDomainSpec_startUpToLimit() { setCluster1Replicas(3); addWlsServers("ms1", "ms2", "ms3", "ms4", "ms5"); addWlsCluster("cluster1", "ms1", "ms2", "ms3", "ms4", "ms5"); @@ -476,7 +476,7 @@ public void whenWlsClusterNotInDomainSpec_startUpToLimit() { } @Test - public void withStartPolicyAlways_addNonManagedServers() { + void withStartPolicyAlways_addNonManagedServers() { startAllServers(); addWlsServer("ms1"); @@ -487,28 +487,28 @@ public void withStartPolicyAlways_addNonManagedServers() { } @Test - public void whenShuttingDown_insertCreateAvailableStep() { + void whenShuttingDown_insertCreateAvailableStep() { configurator.setShuttingDown(true); assertThat(createNextStep().getClass().getSimpleName(), equalTo("AvailableStep")); } @Test - public void whenNotShuttingDown_dontInsertCreateAvailableStep() { + void whenNotShuttingDown_dontInsertCreateAvailableStep() { configurator.setShuttingDown(false); assertThat(createNextStep(), instanceOf(ClusterServicesStep.class)); } @Test - public void whenShuttingDownAtLeastOneServer_prependServerDownIteratorStep() { + void whenShuttingDownAtLeastOneServer_prependServerDownIteratorStep() { addServer(domainPresenceInfo, "server1"); assertThat(skipProgressingStep(createNextStep()), instanceOf(ServerDownIteratorStep.class)); } @Test - public void whenExclusionsSpecified_doNotAddToListOfServers() { + void whenExclusionsSpecified_doNotAddToListOfServers() { addServer(domainPresenceInfo, "server1"); addServer(domainPresenceInfo, "server2"); addServer(domainPresenceInfo, "server3"); @@ -519,7 +519,7 @@ public void whenExclusionsSpecified_doNotAddToListOfServers() { } @Test - public void whenShuttingDown_allowAdminServerNameInListOfServers() { + void whenShuttingDown_allowAdminServerNameInListOfServers() { configurator.setShuttingDown(true); addServer(domainPresenceInfo, "server1"); @@ -532,7 +532,7 @@ public void whenShuttingDown_allowAdminServerNameInListOfServers() { } @Test - public void whenClusterStartupDefinedWithPreCreateServerService_addAllToServers() { + void whenClusterStartupDefinedWithPreCreateServerService_addAllToServers() { configureCluster("cluster1").withPrecreateServerService(true); addWlsCluster("cluster1", "ms1", "ms2"); @@ -542,7 +542,7 @@ public void whenClusterStartupDefinedWithPreCreateServerService_addAllToServers( } @Test - public void whenClusterStartupDefinedWithPreCreateServerService_adminServerDown_addAllToServers() { + void whenClusterStartupDefinedWithPreCreateServerService_adminServerDown_addAllToServers() { configureCluster("cluster1").withPrecreateServerService(true); addWlsCluster("cluster1", "ms1", "ms2"); configureAdminServer().withServerStartPolicy(START_NEVER); @@ -553,7 +553,7 @@ public void whenClusterStartupDefinedWithPreCreateServerService_adminServerDown_ } @Test - public void whenClusterStartupDefinedWithPreCreateServerService_managedServerDown_addAllToServers() { + void whenClusterStartupDefinedWithPreCreateServerService_managedServerDown_addAllToServers() { configureCluster("cluster1").withPrecreateServerService(true).withServerStartPolicy(START_NEVER); addWlsCluster("cluster1", "ms1", "ms2"); @@ -563,7 +563,7 @@ public void whenClusterStartupDefinedWithPreCreateServerService_managedServerDow } @Test - public void whenClusterStartupDefinedWithPreCreateServerService_allServersDown_addNothingToServers() { + void whenClusterStartupDefinedWithPreCreateServerService_allServersDown_addNothingToServers() { configureCluster("cluster1").withPrecreateServerService(true).withServerStartPolicy(START_NEVER); addWlsCluster("cluster1", "ms1", "ms2"); configureAdminServer().withServerStartPolicy(START_NEVER); @@ -574,7 +574,7 @@ public void whenClusterStartupDefinedWithPreCreateServerService_allServersDown_a } @Test - public void whenReplicasLessThanMinDynClusterSize_setReplicaCountToMinClusterSize() { + void whenReplicasLessThanMinDynClusterSize_setReplicaCountToMinClusterSize() { startNoServers(); setCluster1Replicas(0); setCluster1AllowReplicasBelowMinDynClusterSize(false); @@ -587,7 +587,7 @@ public void whenReplicasLessThanMinDynClusterSize_setReplicaCountToMinClusterSiz } @Test - public void whenReplicasLessThanMinDynClusterSize_allowBelowMin_doNotChangeReplicaCount() { + void whenReplicasLessThanMinDynClusterSize_allowBelowMin_doNotChangeReplicaCount() { startNoServers(); setCluster1Replicas(0); @@ -599,7 +599,7 @@ public void whenReplicasLessThanMinDynClusterSize_allowBelowMin_doNotChangeRepli } @Test - public void whenReplicasMoreThanMinDynClusterSize_doNotChangeReplicaCount() { + void whenReplicasMoreThanMinDynClusterSize_doNotChangeReplicaCount() { startNoServers(); setCluster1Replicas(3); setCluster1AllowReplicasBelowMinDynClusterSize(false); @@ -612,7 +612,7 @@ public void whenReplicasMoreThanMinDynClusterSize_doNotChangeReplicaCount() { } @Test - public void whenReplicasLessThanMinDynClusterSize_logMessage() { + void whenReplicasLessThanMinDynClusterSize_logMessage() { List messages = new ArrayList<>(); consoleHandlerMemento.withLogLevel(Level.WARNING) .collectLogMessages(messages, REPLICAS_LESS_THAN_TOTAL_CLUSTER_SERVER_COUNT); @@ -629,7 +629,7 @@ public void whenReplicasLessThanMinDynClusterSize_logMessage() { } @Test - public void whenReplicasLessThanDynClusterSize_createsEvent() { + void whenReplicasLessThanDynClusterSize_createsEvent() { startNoServers(); setCluster1Replicas(0); addDynamicWlsCluster("cluster1", 2, 5,"ms1", "ms2", "ms3", "ms4", "ms5"); @@ -641,7 +641,7 @@ public void whenReplicasLessThanDynClusterSize_createsEvent() { } @Test - public void whenReplicasLessThanDynClusterSize_addValidationWarning() { + void whenReplicasLessThanDynClusterSize_addValidationWarning() { startNoServers(); setCluster1Replicas(0); addDynamicWlsCluster("cluster1", 2, 5,"ms1", "ms2", "ms3", "ms4", "ms5"); @@ -654,7 +654,7 @@ public void whenReplicasLessThanDynClusterSize_addValidationWarning() { } @Test - public void whenReplicasExceedsMaxDynClusterSize_logMessage() { + void whenReplicasExceedsMaxDynClusterSize_logMessage() { List messages = new ArrayList<>(); consoleHandlerMemento.withLogLevel(Level.WARNING) .collectLogMessages(messages, REPLICAS_EXCEEDS_TOTAL_CLUSTER_SERVER_COUNT); @@ -670,7 +670,7 @@ public void whenReplicasExceedsMaxDynClusterSize_logMessage() { } @Test - public void whenReplicasExceedsMaxDynClusterSize_createsEvent() { + void whenReplicasExceedsMaxDynClusterSize_createsEvent() { startNoServers(); setCluster1Replicas(10); addDynamicWlsCluster("cluster1", 2, 5,"ms1", "ms2", "ms3", "ms4", "ms5"); @@ -681,7 +681,7 @@ public void whenReplicasExceedsMaxDynClusterSize_createsEvent() { } @Test - public void whenReplicasExceedsMaxDynClusterSize_addValidationWarning() { + void whenReplicasExceedsMaxDynClusterSize_addValidationWarning() { startNoServers(); setCluster1Replicas(10); addDynamicWlsCluster("cluster1", 2, 5,"ms1", "ms2", "ms3", "ms4", "ms5"); @@ -693,7 +693,7 @@ public void whenReplicasExceedsMaxDynClusterSize_addValidationWarning() { } @Test - public void whenReplicasExceedsMaxDynClusterSize_andStartNoServers_createsEvent() { + void whenReplicasExceedsMaxDynClusterSize_andStartNoServers_createsEvent() { startNoServers(); setCluster1Replicas(10); addDynamicWlsCluster("cluster1", 2, 5,"ms1", "ms2", "ms3", "ms4", "ms5"); @@ -704,7 +704,7 @@ public void whenReplicasExceedsMaxDynClusterSize_andStartNoServers_createsEvent( } @Test - public void withInvalidReplicasDuringExplicitRecheck_addValidationWarning() { + void withInvalidReplicasDuringExplicitRecheck_addValidationWarning() { setExplicitRecheck(); setCluster1Replicas(10); addDynamicWlsCluster("cluster1", 2, 5,"ms1", "ms2", "ms3", "ms4", "ms5"); @@ -716,7 +716,7 @@ public void withInvalidReplicasDuringExplicitRecheck_addValidationWarning() { } @Test - public void withInvalidReplicasDuringExplicitRecheck_createsNoEvent() { + void withInvalidReplicasDuringExplicitRecheck_createsNoEvent() { setExplicitRecheck(); setCluster1Replicas(10); addDynamicWlsCluster("cluster1", 2, 5,"ms1", "ms2", "ms3", "ms4", "ms5"); @@ -727,7 +727,7 @@ public void withInvalidReplicasDuringExplicitRecheck_createsNoEvent() { } @Test - public void withValidReplicas_noEventsCreated() { + void withValidReplicas_noEventsCreated() { setCluster1Replicas(2); addDynamicWlsCluster("cluster1", 2, 5,"ms1", "ms2", "ms3", "ms4", "ms5"); @@ -737,7 +737,7 @@ public void withValidReplicas_noEventsCreated() { } @Test - public void withValidReplicas_noValidationWarnings() { + void withValidReplicas_noValidationWarnings() { setCluster1Replicas(2); addDynamicWlsCluster("cluster1", 2, 5,"ms1", "ms2", "ms3", "ms4", "ms5"); @@ -747,7 +747,7 @@ public void withValidReplicas_noValidationWarnings() { } @Test - public void whenDomainTopologyIsMissing_noExceptionAndDontStartServers() { + void whenDomainTopologyIsMissing_noExceptionAndDontStartServers() { invokeStepWithoutDomainTopology(); assertServersWillNotBeStarted(); diff --git a/operator/src/test/java/oracle/kubernetes/operator/steps/MonitoringExporterStepsTest.java b/operator/src/test/java/oracle/kubernetes/operator/steps/MonitoringExporterStepsTest.java index c79828b9e62..5348d094e42 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/steps/MonitoringExporterStepsTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/steps/MonitoringExporterStepsTest.java @@ -56,7 +56,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class MonitoringExporterStepsTest { +class MonitoringExporterStepsTest { private static final int EXPORTER_PORT = 8000; private static final String ADMIN_SERVER = "admin-server"; diff --git a/operator/src/test/java/oracle/kubernetes/operator/steps/ReadHealthStepTest.java b/operator/src/test/java/oracle/kubernetes/operator/steps/ReadHealthStepTest.java index 31a24f2b994..333485242f1 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/steps/ReadHealthStepTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/steps/ReadHealthStepTest.java @@ -57,7 +57,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -public class ReadHealthStepTest { +class ReadHealthStepTest { static final String OK_RESPONSE = "{\n" + " \"overallHealthState\": {\n" @@ -155,7 +155,7 @@ public void tearDown() { } @Test - public void whenReadAdminServerHealth_decrementRemainingServers() { + void whenReadAdminServerHealth_decrementRemainingServers() { selectServer(ADMIN_NAME); defineResponse(200, "", "http://127.0.0.1:3456"); @@ -183,7 +183,7 @@ private HttpRequest createExpectedRequest(String url) { @Test - public void whenReadConfiguredManagedServerHealth_decrementRemainingServers() { + void whenReadConfiguredManagedServerHealth_decrementRemainingServers() { selectServer(CONFIGURED_MANAGED_SERVER1); configureServiceWithClusterName(CONFIGURED_CLUSTER_NAME); defineResponse(200, ""); @@ -197,7 +197,7 @@ public void whenReadConfiguredManagedServerHealth_decrementRemainingServers() { // todo test failure to read credentials @Test - public void whenReadDynamicManagedServerHealth_decrementRemainingServers() { + void whenReadDynamicManagedServerHealth_decrementRemainingServers() { selectServer(DYNAMIC_MANAGED_SERVER1); configureServiceWithClusterName(DYNAMIC_CLUSTER_NAME); defineResponse(200, ""); @@ -208,7 +208,7 @@ public void whenReadDynamicManagedServerHealth_decrementRemainingServers() { } @Test - public void whenServerRunning_verifyServerHealth() { + void whenServerRunning_verifyServerHealth() { selectServer(MANAGED_SERVER1); defineResponse(200, OK_RESPONSE, "http://127.0.0.1:8001"); @@ -228,7 +228,7 @@ private Map getServerStateMap(Packet packet) { } @Test - public void whenAdminPodIPNull_verifyServerHealth() { + void whenAdminPodIPNull_verifyServerHealth() { selectServer(ADMIN_NAME, true); defineResponse(200, OK_RESPONSE, "http://admin-server.Test:3456"); @@ -238,7 +238,7 @@ public void whenAdminPodIPNull_verifyServerHealth() { } @Test - public void whenAdminPodIPNull_requestSendWithCredentials() { + void whenAdminPodIPNull_requestSendWithCredentials() { selectServer(ADMIN_NAME, true); defineResponse(200, OK_RESPONSE, "http://admin-server.Test:3456"); @@ -260,7 +260,7 @@ private String expectedAuthorizationHeader() { } @Test - public void whenServerOverloaded_verifyServerHealth() { + void whenServerOverloaded_verifyServerHealth() { selectServer(MANAGED_SERVER1); defineResponse(500, "", "http://127.0.0.1:8001"); @@ -273,7 +273,7 @@ public void whenServerOverloaded_verifyServerHealth() { } @Test - public void whenUnableToReadHealth_verifyNotAvailable() { + void whenUnableToReadHealth_verifyNotAvailable() { selectServer(MANAGED_SERVER1); defineResponse(404, ""); @@ -286,7 +286,7 @@ public void whenUnableToReadHealth_verifyNotAvailable() { } @Test - public void whenServerConfiguredWithServerListenPortOnly_readHealthUsingServerListenPort() { + void whenServerConfiguredWithServerListenPortOnly_readHealthUsingServerListenPort() { selectServer(DYNAMIC_MANAGED_SERVER2, headlessMSService); WlsServerConfig server = getDynamicClusterServer2(); server.setListenPort(8001); @@ -298,7 +298,7 @@ public void whenServerConfiguredWithServerListenPortOnly_readHealthUsingServerLi } @Test - public void whenServerConfiguredWithSSLPortOnly_readHealthUsingSSLPort() { + void whenServerConfiguredWithSSLPortOnly_readHealthUsingSSLPort() { selectServer(DYNAMIC_MANAGED_SERVER2, headlessMSService); WlsServerConfig server = getDynamicClusterServer2(); server.setSslListenPort(7002); @@ -310,7 +310,7 @@ public void whenServerConfiguredWithSSLPortOnly_readHealthUsingSSLPort() { } @Test - public void whenServerConfiguredWithServerListenPortAndSSLPort_readHealthUsingSSLPort() { + void whenServerConfiguredWithServerListenPortAndSSLPort_readHealthUsingSSLPort() { selectServer(DYNAMIC_MANAGED_SERVER2, headlessMSService); WlsServerConfig server = getDynamicClusterServer2(); server.setListenPort(8001); @@ -323,7 +323,7 @@ public void whenServerConfiguredWithServerListenPortAndSSLPort_readHealthUsingSS } @Test - public void whenServerConfiguredWithServerListenPortAndNonAdminNAP_readHealthUsingServerListenPort() { + void whenServerConfiguredWithServerListenPortAndNonAdminNAP_readHealthUsingServerListenPort() { selectServer(DYNAMIC_MANAGED_SERVER2, headlessMSService); WlsServerConfig server = getDynamicClusterServer2(); server.setListenPort(8001); @@ -336,7 +336,7 @@ public void whenServerConfiguredWithServerListenPortAndNonAdminNAP_readHealthUsi } @Test - public void whenServerConfiguredWithServerSSLPortAndNonAdminNAP_readHealthUsingSSLPort() { + void whenServerConfiguredWithServerSSLPortAndNonAdminNAP_readHealthUsingSSLPort() { selectServer(DYNAMIC_MANAGED_SERVER2, headlessMSService); WlsServerConfig server = getDynamicClusterServer2(); server.setSslListenPort(7002); @@ -349,7 +349,7 @@ public void whenServerConfiguredWithServerSSLPortAndNonAdminNAP_readHealthUsingS } @Test - public void whenServerConfiguredWithSSLPortAndAdminNAP_readHealthUsingAdminNAPPort() { + void whenServerConfiguredWithSSLPortAndAdminNAP_readHealthUsingAdminNAPPort() { selectServer(DYNAMIC_MANAGED_SERVER2, headlessMSService); WlsServerConfig server = getDynamicClusterServer2(); server.setSslListenPort(7002); @@ -362,7 +362,7 @@ public void whenServerConfiguredWithSSLPortAndAdminNAP_readHealthUsingAdminNAPPo } @Test - public void whenServerConfiguredWithServerListenPortAndAdminNAP_readHealthUsingAdminNAPPort() { + void whenServerConfiguredWithServerListenPortAndAdminNAP_readHealthUsingAdminNAPPort() { selectServer(DYNAMIC_MANAGED_SERVER2, headlessMSService); WlsServerConfig server = getDynamicClusterServer2(); server.setListenPort(8001); @@ -376,7 +376,7 @@ public void whenServerConfiguredWithServerListenPortAndAdminNAP_readHealthUsingA } @Test - public void whenServerConfiguredWithNonAdminNAPOnly_readHealthFailed() { + void whenServerConfiguredWithNonAdminNAPOnly_readHealthFailed() { selectServer(DYNAMIC_MANAGED_SERVER2, headlessMSService); WlsServerConfig server = getDynamicClusterServer2(); server.addNetworkAccessPoint(new NetworkAccessPoint("nap1", "t3", 9001, 9001)); @@ -388,7 +388,7 @@ public void whenServerConfiguredWithNonAdminNAPOnly_readHealthFailed() { } @Test - public void whenAuthorizedToReadHealth_verifySecretSet() { + void whenAuthorizedToReadHealth_verifySecretSet() { selectServer(MANAGED_SERVER1); defineResponse(200, "", "http://127.0.0.1:8001"); @@ -399,7 +399,7 @@ public void whenAuthorizedToReadHealth_verifySecretSet() { } @Test - public void whenAuthorizedToReadHealthAndThenWait_verifySecretCleared() { + void whenAuthorizedToReadHealthAndThenWait_verifySecretCleared() { selectServer(MANAGED_SERVER1); defineResponse(200, "", "http://127.0.0.1:8001"); @@ -414,7 +414,7 @@ public void whenAuthorizedToReadHealthAndThenWait_verifySecretCleared() { } @Test - public void whenNotAuthorizedToReadHealth_verifySecretCleared() { + void whenNotAuthorizedToReadHealth_verifySecretCleared() { selectServer(MANAGED_SERVER1); defineResponse(403, "", "http://127.0.0.1:8001"); diff --git a/operator/src/test/java/oracle/kubernetes/operator/steps/ServerDownIteratorStepTest.java b/operator/src/test/java/oracle/kubernetes/operator/steps/ServerDownIteratorStepTest.java index 72bc3bdd84a..a278c9ab158 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/steps/ServerDownIteratorStepTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/steps/ServerDownIteratorStepTest.java @@ -47,7 +47,7 @@ import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class ServerDownIteratorStepTest { +class ServerDownIteratorStepTest { protected static final String DOMAIN_NAME = "domain1"; private static final String NS = "namespace"; @@ -150,7 +150,7 @@ public void tearDown() throws Exception { } @Test - public void withConcurrencyOf1_bothClusteredServersShutdownSequentially() { + void withConcurrencyOf1_bothClusteredServersShutdownSequentially() { configureCluster(CLUSTER).withMaxConcurrentShutdown(1).withReplicas(1); addWlsCluster(CLUSTER, 8001, MS1, MS2); domainPresenceInfo = createDomainPresenceInfoWithServers(MS1, MS2); @@ -166,7 +166,7 @@ public void withConcurrencyOf1_bothClusteredServersShutdownSequentially() { } @Test - public void withConcurrencyOf2_bothClusteredServersShutdownConcurrently() { + void withConcurrencyOf2_bothClusteredServersShutdownConcurrently() { configureCluster(CLUSTER).withMaxConcurrentShutdown(2).withReplicas(1); addWlsCluster(CLUSTER, PORT, MS1, MS2); domainPresenceInfo = createDomainPresenceInfoWithServers(MS1, MS2); @@ -180,7 +180,7 @@ public void withConcurrencyOf2_bothClusteredServersShutdownConcurrently() { } @Test - public void withConcurrencyOf0_clusteredServersShutdownConcurrently() { + void withConcurrencyOf0_clusteredServersShutdownConcurrently() { configureCluster(CLUSTER).withMaxConcurrentShutdown(0); addWlsCluster(CLUSTER, PORT, MS1, MS2); domainPresenceInfo = createDomainPresenceInfoWithServers(MS1, MS2); @@ -194,7 +194,7 @@ public void withConcurrencyOf0_clusteredServersShutdownConcurrently() { } @Test - public void whenClusterShutdown_concurrencySettingIsIgnored() { + void whenClusterShutdown_concurrencySettingIsIgnored() { configureCluster(CLUSTER).withMaxConcurrentShutdown(1).withReplicas(0); addWlsCluster(CLUSTER, PORT, MS1, MS2); domainPresenceInfo = createDomainPresenceInfoWithServers(MS1, MS2); @@ -208,7 +208,7 @@ public void whenClusterShutdown_concurrencySettingIsIgnored() { } @Test - public void whenMaxConcurrentShutdownSet_limitNumberOfServersShuttingDownAtOnce() { + void whenMaxConcurrentShutdownSet_limitNumberOfServersShuttingDownAtOnce() { configureCluster(CLUSTER).withMaxConcurrentShutdown(2).withReplicas(1); addWlsCluster(CLUSTER, PORT, MS1, MS2, MS3, MS4); domainPresenceInfo = createDomainPresenceInfoWithServers(MS1, MS2, MS3, MS4); @@ -224,7 +224,7 @@ public void whenMaxConcurrentShutdownSet_limitNumberOfServersShuttingDownAtOnce( } @Test - public void withMultipleClusters_concurrencySettingIsIgnoredForShuttingDownClusterAndHonoredForShrinkingCluster() { + void withMultipleClusters_concurrencySettingIsIgnoredForShuttingDownClusterAndHonoredForShrinkingCluster() { configureCluster(CLUSTER).withMaxConcurrentShutdown(1).withReplicas(0); configureCluster(CLUSTER2).withMaxConcurrentShutdown(1).withReplicas(1); addWlsCluster(CLUSTER, PORT, MS1, MS2, MS3); @@ -241,7 +241,7 @@ public void withMultipleClusters_concurrencySettingIsIgnoredForShuttingDownClust } @Test - public void withMultipleClusters_differentClusterScheduleAndShutdownDifferently() { + void withMultipleClusters_differentClusterScheduleAndShutdownDifferently() { configureCluster(CLUSTER).withMaxConcurrentShutdown(0).withReplicas(1); configureCluster(CLUSTER2).withMaxConcurrentShutdown(1).withReplicas(1); addWlsCluster(CLUSTER, PORT, MS1, MS2); @@ -258,7 +258,7 @@ public void withMultipleClusters_differentClusterScheduleAndShutdownDifferently( } @Test - public void maxClusterConcurrentShutdown_doesNotApplyToNonClusteredServers() { + void maxClusterConcurrentShutdown_doesNotApplyToNonClusteredServers() { domain.getSpec().setMaxClusterConcurrentShutdown(1); addWlsServers(MS3, MS4); domainPresenceInfo = createDomainPresenceInfoWithServers(MS3,MS4); diff --git a/operator/src/test/java/oracle/kubernetes/operator/utils/CertificatesTest.java b/operator/src/test/java/oracle/kubernetes/operator/utils/CertificatesTest.java index 24553783844..bef8b0503cf 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/utils/CertificatesTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/utils/CertificatesTest.java @@ -23,7 +23,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class CertificatesTest { +class CertificatesTest { private final TestUtils.ConsoleHandlerMemento consoleHandlerMemento = TestUtils.silenceOperatorLogger(); private final Collection logRecords = new ArrayList<>(); @@ -43,12 +43,12 @@ public void tearDown() { } @Test - public void whenNoExternalKeyFile_returnNull() { + void whenNoExternalKeyFile_returnNull() { assertThat(Certificates.getOperatorExternalKeyFile(), nullValue()); } @Test - public void whenExternalKeyFileDefined_returnPath() { + void whenExternalKeyFileDefined_returnPath() { InMemoryCertificates.defineOperatorExternalKeyFile("asdf"); assertThat( @@ -56,12 +56,12 @@ public void whenExternalKeyFileDefined_returnPath() { } @Test - public void whenNoInternalKeyFile_returnNull() { + void whenNoInternalKeyFile_returnNull() { assertThat(Certificates.getOperatorInternalKeyFile(), nullValue()); } @Test - public void whenInternalKeyFileDefined_returnPath() { + void whenInternalKeyFileDefined_returnPath() { InMemoryCertificates.defineOperatorInternalKeyFile("asdf"); assertThat( @@ -69,42 +69,42 @@ public void whenInternalKeyFileDefined_returnPath() { } @Test - public void whenNoExternalCertificateFile_returnNull() { + void whenNoExternalCertificateFile_returnNull() { consoleHandlerMemento.ignoreMessage(NO_EXTERNAL_CERTIFICATE); assertThat(Certificates.getOperatorExternalCertificateData(), nullValue()); } @Test - public void whenNoExternalCertificateFile_logConfigMessage() { + void whenNoExternalCertificateFile_logConfigMessage() { assertThat(Certificates.getOperatorExternalCertificateData(), nullValue()); assertThat(logRecords, containsConfig(NO_EXTERNAL_CERTIFICATE)); } @Test - public void whenExternalCertificateFileDefined_returnData() { + void whenExternalCertificateFileDefined_returnData() { InMemoryCertificates.defineOperatorExternalCertificateFile("asdf"); assertThat(Certificates.getOperatorExternalCertificateData(), notNullValue()); } @Test - public void whenNoInternalCertificateFile_returnNull() { + void whenNoInternalCertificateFile_returnNull() { consoleHandlerMemento.ignoreMessage(NO_INTERNAL_CERTIFICATE); assertThat(Certificates.getOperatorInternalCertificateData(), nullValue()); } @Test - public void whenNoInternalCertificateFile_logConfigMessage() { + void whenNoInternalCertificateFile_logConfigMessage() { Certificates.getOperatorInternalCertificateData(); assertThat(logRecords, containsConfig(NO_INTERNAL_CERTIFICATE)); } @Test - public void whenInternalCertificateFileDefined_returnPath() { + void whenInternalCertificateFileDefined_returnPath() { InMemoryCertificates.defineOperatorInternalCertificateFile("asdf"); assertThat(Certificates.getOperatorInternalCertificateData(), notNullValue()); diff --git a/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/MacroSubstitutorTest.java b/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/MacroSubstitutorTest.java index 1d9eeb86fbe..9f0990d2db1 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/MacroSubstitutorTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/MacroSubstitutorTest.java @@ -10,10 +10,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; -public class MacroSubstitutorTest { +class MacroSubstitutorTest { @Test - public void testMacros() { + void testMacros() { final int ID = 123; final String server = "ms-1"; final String cluster = "cluster-1"; diff --git a/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsClusterConfigTest.java b/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsClusterConfigTest.java index a6ef59aaa9a..196ac2a368d 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsClusterConfigTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsClusterConfigTest.java @@ -30,7 +30,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -public class WlsClusterConfigTest { +class WlsClusterConfigTest { // The log messages to be checked during this test private static final String[] LOG_KEYS = { @@ -74,7 +74,7 @@ public void tearDown() { } @Test - public void verifyClusterSizeIsSameAsNumberOfServers() { + void verifyClusterSizeIsSameAsNumberOfServers() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1"); wlsClusterConfig.addServerConfig(createWlsServerConfig("ms-0", null, null)); wlsClusterConfig.addServerConfig(createWlsServerConfig("ms-1", 8011, null)); @@ -82,7 +82,7 @@ public void verifyClusterSizeIsSameAsNumberOfServers() { } @Test - public void verifyMaxClusterSizeIsSameAsNumberOfServers() { + void verifyMaxClusterSizeIsSameAsNumberOfServers() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1"); wlsClusterConfig.addServerConfig(createWlsServerConfig("ms-0", null, null)); wlsClusterConfig.addServerConfig(createWlsServerConfig("ms-1", 8011, null)); @@ -90,46 +90,46 @@ public void verifyMaxClusterSizeIsSameAsNumberOfServers() { } @Test - public void verifyClusterSizeIs0IfNoServers() { + void verifyClusterSizeIs0IfNoServers() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1"); assertEquals(0, wlsClusterConfig.getClusterSize()); } @Test - public void verifyHasStaticServersIsFalseIfNoServers() { + void verifyHasStaticServersIsFalseIfNoServers() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1"); assertFalse(wlsClusterConfig.hasStaticServers()); } @Test - public void verifyHasStaticServersIsTrueIfStaticServers() { + void verifyHasStaticServersIsTrueIfStaticServers() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1"); wlsClusterConfig.addServerConfig(createWlsServerConfig("ms-0", null, null)); assertTrue(wlsClusterConfig.hasStaticServers()); } @Test - public void verifyHasDynamicServersIsFalseIfNoDynamicServers() { + void verifyHasDynamicServersIsFalseIfNoDynamicServers() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1"); assertFalse(wlsClusterConfig.hasDynamicServers()); } @Test - public void verifyHasDynamicServersIsTrueForDynamicCluster() { + void verifyHasDynamicServersIsTrueForDynamicCluster() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", createDynamicServersConfig(2, 5, 1, "ms-", "cluster1")); assertTrue(wlsClusterConfig.hasDynamicServers()); } @Test - public void verifyHasStaticServersIsFalseForDynamicCluster() { + void verifyHasStaticServersIsFalseForDynamicCluster() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", createDynamicServersConfig(2, 5, 1, "ms-", "cluster1")); assertFalse(wlsClusterConfig.hasStaticServers()); } @Test - public void verifyHasDynamicServersIsTrueForMixedCluster() { + void verifyHasDynamicServersIsTrueForMixedCluster() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", createDynamicServersConfig(2, 5, 1, "ms-", "cluster1")); wlsClusterConfig.addServerConfig(createWlsServerConfig("mss-0", 8011, null)); @@ -137,7 +137,7 @@ public void verifyHasDynamicServersIsTrueForMixedCluster() { } @Test - public void verifyHasStaticServersIsTrueForMixedCluster() { + void verifyHasStaticServersIsTrueForMixedCluster() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", createDynamicServersConfig(2, 5, 1, "ms-", "cluster1")); wlsClusterConfig.addServerConfig(createWlsServerConfig("mss-0", 8011, null)); @@ -145,7 +145,7 @@ public void verifyHasStaticServersIsTrueForMixedCluster() { } @Test - public void verifyMaxClusterSizeIsSameAsNumberOfServersPlusDynamicSizeForMixedCluster() { + void verifyMaxClusterSizeIsSameAsNumberOfServersPlusDynamicSizeForMixedCluster() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", createDynamicServersConfig(2, 5, 1, "ms-", "cluster1")); wlsClusterConfig.addServerConfig(createWlsServerConfig("mss-0", 8011, null)); @@ -154,7 +154,7 @@ public void verifyMaxClusterSizeIsSameAsNumberOfServersPlusDynamicSizeForMixedCl } @Test - public void verifyMaxClusterSizeIsSameAsDynamicSizeForDynamicCluster() { + void verifyMaxClusterSizeIsSameAsDynamicSizeForDynamicCluster() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", createDynamicServersConfig(2, 5, 1, "ms-", "cluster1")); @@ -162,7 +162,7 @@ public void verifyMaxClusterSizeIsSameAsDynamicSizeForDynamicCluster() { } @Test - public void verifyDynamicClusterSizeIsSameAsNumberOfDynamicServers() { + void verifyDynamicClusterSizeIsSameAsNumberOfDynamicServers() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", createDynamicServersConfig(2, 5, 1, "ms-", "cluster1")); assertEquals(0, wlsClusterConfig.getClusterSize()); @@ -172,19 +172,19 @@ public void verifyDynamicClusterSizeIsSameAsNumberOfDynamicServers() { } @Test - public void verifyDynamicClusterSizeIsNeg1IfNoDynamicServers() { + void verifyDynamicClusterSizeIsNeg1IfNoDynamicServers() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1"); assertEquals(-1, wlsClusterConfig.getDynamicClusterSize()); } @Test - public void verifyMinDynamicClusterSizeIsNeg1IfNoDynamicServers() { + void verifyMinDynamicClusterSizeIsNeg1IfNoDynamicServers() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1"); assertEquals(-1, wlsClusterConfig.getMinDynamicClusterSize()); } @Test - public void verifyGetServerConfigsReturnListOfAllServerConfigs() { + void verifyGetServerConfigsReturnListOfAllServerConfigs() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1"); wlsClusterConfig.addServerConfig(createWlsServerConfig("ms-0", 8011, null)); wlsClusterConfig.addServerConfig(createWlsServerConfig("ms-1", 8012, null)); @@ -196,7 +196,7 @@ public void verifyGetServerConfigsReturnListOfAllServerConfigs() { } @Test - public void verifyGetServerConfigsReturnListOfAllServerConfigsWithDynamicServers() { + void verifyGetServerConfigsReturnListOfAllServerConfigsWithDynamicServers() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", createDynamicServersConfig(3, 5, 1, "ms-", "cluster1")); wlsClusterConfig.addServerConfig(createWlsServerConfig("static-0", 8011, null)); @@ -224,7 +224,7 @@ private boolean containsServer(WlsClusterConfig wlsClusterConfig, String serverN } @Test - public void verifyMaxClusterSizeForStaticCluster() { + void verifyMaxClusterSizeForStaticCluster() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1"); wlsClusterConfig.addServerConfig(createWlsServerConfig("ms-0", 8011, null)); @@ -232,7 +232,7 @@ public void verifyMaxClusterSizeForStaticCluster() { } @Test - public void verifyMaxClusterSizeForDynamicCluster() { + void verifyMaxClusterSizeForDynamicCluster() { WlsDynamicServersConfig wlsDynamicServersConfig = createDynamicServersConfig(1, 1, 1, "ms-", "cluster1"); WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", wlsDynamicServersConfig); @@ -241,7 +241,7 @@ public void verifyMaxClusterSizeForDynamicCluster() { } @Test - public void verifyMaxClusterSizeForMixedCluster() { + void verifyMaxClusterSizeForMixedCluster() { WlsDynamicServersConfig wlsDynamicServersConfig = createDynamicServersConfig(1, 1, 1, "ms-", "cluster1"); WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", wlsDynamicServersConfig); @@ -251,7 +251,7 @@ public void verifyMaxClusterSizeForMixedCluster() { } @Test - public void verifyGetUpdateDynamicClusterSizeUrlIncludesClusterName() { + void verifyGetUpdateDynamicClusterSizeUrlIncludesClusterName() { WlsDynamicServersConfig wlsDynamicServersConfig = createDynamicServersConfig(1, 1, 1, "ms-", "cluster1"); WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", wlsDynamicServersConfig); @@ -261,7 +261,7 @@ public void verifyGetUpdateDynamicClusterSizeUrlIncludesClusterName() { } @Test - public void verifyGetUpdateDynamicClusterSizePayload() { + void verifyGetUpdateDynamicClusterSizePayload() { WlsDynamicServersConfig wlsDynamicServersConfig = createDynamicServersConfig(1, 5, 1, "ms-", "cluster1"); WlsClusterConfig wlsClusterConfig = new WlsClusterConfig("cluster1", wlsDynamicServersConfig); @@ -270,17 +270,17 @@ public void verifyGetUpdateDynamicClusterSizePayload() { } @Test - public void checkDynamicClusterSizeJsonResultReturnsFalseOnNull() { + void checkDynamicClusterSizeJsonResultReturnsFalseOnNull() { assertFalse(WlsClusterConfig.checkUpdateDynamicClusterSizeJsonResult(null)); } @Test - public void checkDynamicClusterSizeJsonResultReturnsFalseOnUnexpectedString() { + void checkDynamicClusterSizeJsonResultReturnsFalseOnUnexpectedString() { assertFalse(WlsClusterConfig.checkUpdateDynamicClusterSizeJsonResult("{ xyz }")); } @Test - public void checkDynamicClusterSizeJsonResultReturnsTrueWithExpectedString() { + void checkDynamicClusterSizeJsonResultReturnsTrueWithExpectedString() { assertTrue(WlsClusterConfig.checkUpdateDynamicClusterSizeJsonResult("{}")); } @@ -294,7 +294,7 @@ private WlsServerConfig createWlsServerConfig( } @Test - public void verifyMachinesConfiguredReturnTrueIfAllMachinesConfigured() { + void verifyMachinesConfiguredReturnTrueIfAllMachinesConfigured() { WlsMachineConfig machine1 = new WlsMachineConfig("domain1-machine1", 5556, "localhost", "SSL"); WlsMachineConfig machine2 = new WlsMachineConfig("domain1-machine2", 5556, "localhost", "SSL"); Map machines = new HashMap<>(); @@ -315,7 +315,7 @@ public void verifyMachinesConfiguredReturnTrueIfAllMachinesConfigured() { } @Test - public void verifyMachinesConfiguredReturnFalseIfNotAllMachinesConfigured() { + void verifyMachinesConfiguredReturnFalseIfNotAllMachinesConfigured() { WlsMachineConfig machine1 = new WlsMachineConfig("domain1-machine1", 5556, "localhost", "SSL"); WlsMachineConfig machine2 = new WlsMachineConfig("domain1-machine2", 5556, "localhost", "SSL"); Map machines = new HashMap<>(); @@ -336,7 +336,7 @@ public void verifyMachinesConfiguredReturnFalseIfNotAllMachinesConfigured() { } @Test - public void verifyMachinesConfiguredReturnTrueIfNoWlsDomainConfig() { + void verifyMachinesConfiguredReturnTrueIfNoWlsDomainConfig() { Map machines = new HashMap<>(); WlsClusterConfig wlsClusterConfig = @@ -350,7 +350,7 @@ public void verifyMachinesConfiguredReturnTrueIfNoWlsDomainConfig() { } @Test - public void verifyMachinesConfiguredReturnTrueIfPrefixIsNull() { + void verifyMachinesConfiguredReturnTrueIfPrefixIsNull() { Map machines = new HashMap<>(); WlsClusterConfig wlsClusterConfig = @@ -368,7 +368,7 @@ public void verifyMachinesConfiguredReturnTrueIfPrefixIsNull() { } @Test - public void verifyGetMachinesNameReturnsExpectedMachineName() { + void verifyGetMachinesNameReturnsExpectedMachineName() { WlsMachineConfig machine1 = new WlsMachineConfig("domain1-machine1", 5556, "localhost", "SSL"); WlsMachineConfig machine2 = new WlsMachineConfig("domain1-machine2", 5556, "localhost", "SSL"); Map machines = new HashMap<>(); @@ -392,7 +392,7 @@ public void verifyGetMachinesNameReturnsExpectedMachineName() { } @Test - public void verifyGetMachinesNameDoesNotReturnExistingMachines() { + void verifyGetMachinesNameDoesNotReturnExistingMachines() { WlsMachineConfig machine1 = new WlsMachineConfig("domain1-machine1", 5556, "localhost", "SSL"); WlsMachineConfig machine2 = new WlsMachineConfig("domain1-machine2", 5556, "localhost", "SSL"); WlsMachineConfig machine3 = new WlsMachineConfig("domain1-machine3", 5556, "localhost", "SSL"); @@ -416,7 +416,7 @@ public void verifyGetMachinesNameDoesNotReturnExistingMachines() { } @Test - public void verifyGetMachinesNameReturnsEmptyArrayIfNoDomainConfig() { + void verifyGetMachinesNameReturnsEmptyArrayIfNoDomainConfig() { WlsMachineConfig machine1 = new WlsMachineConfig("domain1-machine1", 5556, "localhost", "SSL"); WlsMachineConfig machine2 = new WlsMachineConfig("domain1-machine2", 5556, "localhost", "SSL"); Map machines = new HashMap<>(); @@ -434,7 +434,7 @@ public void verifyGetMachinesNameReturnsEmptyArrayIfNoDomainConfig() { } @Test - public void verifyGetMachineNamesNoExceptionWhenPrefixIsNull() { + void verifyGetMachineNamesNoExceptionWhenPrefixIsNull() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig( "cluster1", WlsClusterConfigTest.createDynamicServersConfig(1, 5, 1, "ms-", "cluster1")); @@ -452,7 +452,7 @@ public void verifyGetMachineNamesNoExceptionWhenPrefixIsNull() { } @Test - public void verifyGetMachineNamesReturnsEmptyArrayWhenNumIsInvalid() { + void verifyGetMachineNamesReturnsEmptyArrayWhenNumIsInvalid() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig( "cluster1", WlsClusterConfigTest.createDynamicServersConfig(0, 5, 1, "ms-", "cluster1")); @@ -470,7 +470,7 @@ public void verifyGetMachineNamesReturnsEmptyArrayWhenNumIsInvalid() { } @Test - public void verifyGetMachineNamesReturnsUndefinedMachineNamesEvenWithSameTargetSize() { + void verifyGetMachineNamesReturnsUndefinedMachineNamesEvenWithSameTargetSize() { WlsClusterConfig wlsClusterConfig = new WlsClusterConfig( "cluster1", WlsClusterConfigTest.createDynamicServersConfig(2, 5, 1, "ms-", "cluster1")); diff --git a/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsDomainConfigTest.java b/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsDomainConfigTest.java index b99bc6b353c..bc7280649a9 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsDomainConfigTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsDomainConfigTest.java @@ -34,7 +34,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -public class WlsDomainConfigTest { +class WlsDomainConfigTest { // The log messages to be checked during this test private static final String[] LOG_KEYS = { @@ -364,7 +364,7 @@ public void tearDown() { } @Test - public void verifyDomainNameLoadedFromJsonString() { + void verifyDomainNameLoadedFromJsonString() { createDomainConfig(JSON_STRING_1_CLUSTER); assertEquals("base_domain", wlsDomainConfig.getName()); @@ -375,7 +375,7 @@ private void createDomainConfig(String json) { } @Test - public void verifyServersLoadedFromJsonString() { + void verifyServersLoadedFromJsonString() { createDomainConfig(JSON_STRING_1_CLUSTER); Map wlsClusterConfigList = wlsDomainConfig.getClusterConfigs(); assertEquals(1, wlsClusterConfigList.size()); @@ -395,7 +395,7 @@ public void verifyServersLoadedFromJsonString() { } @Test - public void verifyDynamicServersLoadedFromJsonString() { + void verifyDynamicServersLoadedFromJsonString() { createDomainConfig(JSON_STRING_MIXED_CLUSTER); WlsClusterConfig wlsClusterConfig = wlsDomainConfig.getClusterConfig("DockerCluster"); assertEquals(2, wlsClusterConfig.getDynamicClusterSize()); @@ -433,7 +433,7 @@ public void verifyDynamicServersLoadedFromJsonString() { } @Test - public void verifyMachinesLoadedFromJsonString() { + void verifyMachinesLoadedFromJsonString() { createDomainConfig(JSON_STRING_1_CLUSTER); Map wlsMachineConfigList = wlsDomainConfig.getMachineConfigs(); assertEquals(2, wlsMachineConfigList.size()); @@ -452,14 +452,14 @@ public void verifyMachinesLoadedFromJsonString() { } @Test - public void verifyGetServerConfigsDoesNotIncludeDynamicServers() { + void verifyGetServerConfigsDoesNotIncludeDynamicServers() { createDomainConfig(JSON_STRING_MIXED_CLUSTER); assertEquals(6, wlsDomainConfig.getServerConfigs().size()); } @Test - public void verifyNetworkAccessPointsInDynamicServersLoadedFromJsonString() { + void verifyNetworkAccessPointsInDynamicServersLoadedFromJsonString() { createDomainConfig(JSON_STRING_MIXED_CLUSTER); WlsClusterConfig wlsClusterConfig = wlsDomainConfig.getClusterConfig("DockerCluster"); assertEquals(2, wlsClusterConfig.getDynamicClusterSize()); @@ -496,7 +496,7 @@ public void verifyNetworkAccessPointsInDynamicServersLoadedFromJsonString() { } @Test - public void verifyServerWithNoChannelLoadedFromJsonString() { + void verifyServerWithNoChannelLoadedFromJsonString() { WlsDomainConfig wlsDomainConfig = WlsDomainConfig.create(JSON_STRING_1_CLUSTER); WlsServerConfig serverConfig = wlsDomainConfig.getServerConfig("ms-1"); @@ -504,7 +504,7 @@ public void verifyServerWithNoChannelLoadedFromJsonString() { } @Test - public void verifyNetworkAccessPointsLoadedFromJsonString() { + void verifyNetworkAccessPointsLoadedFromJsonString() { createDomainConfig(JSON_STRING_1_CLUSTER); WlsServerConfig serverConfig = wlsDomainConfig.getServerConfig("ms-0"); @@ -538,7 +538,7 @@ public void verifyNetworkAccessPointsLoadedFromJsonString() { } @Test - public void verifySslConfigsLoadedFromJsonString() { + void verifySslConfigsLoadedFromJsonString() { createDomainConfig(JSON_STRING_1_CLUSTER); WlsServerConfig serverConfig = wlsDomainConfig.getServerConfig("ms-0"); @@ -551,7 +551,7 @@ public void verifySslConfigsLoadedFromJsonString() { } @Test - public void verifyMultipleClustersLoadedFromJsonString() { + void verifyMultipleClustersLoadedFromJsonString() { createDomainConfig(JSON_STRING_2_CLUSTERS); Map wlsClusterConfigList = wlsDomainConfig.getClusterConfigs(); assertEquals(2, wlsClusterConfigList.size()); @@ -569,7 +569,7 @@ public void verifyMultipleClustersLoadedFromJsonString() { } @Test - public void verifyGetClusterConfigsDoesNotReturnNull() { + void verifyGetClusterConfigsDoesNotReturnNull() { WlsClusterConfig wlsClusterConfig = wlsDomainConfig.getClusterConfig("DockerCluster"); assertNotNull(wlsClusterConfig); assertEquals(0, wlsClusterConfig.getClusterSize()); @@ -580,17 +580,17 @@ public void verifyGetClusterConfigsDoesNotReturnNull() { } @Test - public void verifyGetServerConfigsReturnNullIfNotFound() { + void verifyGetServerConfigsReturnNullIfNotFound() { assertNull(wlsDomainConfig.getServerConfig("noSuchServer")); } @Test - public void verifyGetMachineConfigsReturnNullIfNotFound() { + void verifyGetMachineConfigsReturnNullIfNotFound() { assertNull(wlsDomainConfig.getMachineConfig("noSuchMachine")); } @Test - public void whenNoClustersDefined_returnEmptyArray() { + void whenNoClustersDefined_returnEmptyArray() { support.addWlsServer("server1"); support.addWlsServer("server2"); @@ -598,7 +598,7 @@ public void whenNoClustersDefined_returnEmptyArray() { } @Test - public void whenOneClusterDefined_returnItsName() { + void whenOneClusterDefined_returnItsName() { support.addWlsCluster("cluster1", "ms1", "ms2", "ms3"); support.addWlsServer("server2"); @@ -606,7 +606,7 @@ public void whenOneClusterDefined_returnItsName() { } @Test - public void whenTwoClustersDefined_returnBothNames() { + void whenTwoClustersDefined_returnBothNames() { support.addWlsCluster("cluster1", "ms1", "ms2", "ms3"); support.addWlsCluster("cluster2", "ms4", "ms5"); @@ -616,7 +616,7 @@ public void whenTwoClustersDefined_returnBothNames() { } @Test - public void whenTwoClustersDefined_returnReplicaLimits() { + void whenTwoClustersDefined_returnReplicaLimits() { support.addWlsCluster("cluster1", "ms1", "ms2", "ms3"); support.addWlsCluster("cluster2", "ms4", "ms5"); @@ -625,7 +625,7 @@ public void whenTwoClustersDefined_returnReplicaLimits() { } @Test - public void whenUnknownClusterName_returnZeroReplicaLimit() { + void whenUnknownClusterName_returnZeroReplicaLimit() { assertThat(support.createDomainConfig().getReplicaLimit("cluster3"), equalTo(0)); } @@ -650,17 +650,17 @@ private boolean containsNetworkAccessPoint(WlsServerConfig wlsServerConfig, Stri } @Test - public void whenTopologyGenerated_containsDomainValidFlag() { + void whenTopologyGenerated_containsDomainValidFlag() { assertThat(wlsDomainConfig.toTopology(), hasJsonPath("domainValid", equalTo("true"))); } @Test - public void whenTopologyGenerated_containsDomainName() { + void whenTopologyGenerated_containsDomainName() { assertThat(wlsDomainConfig.toTopology(), hasJsonPath("domain.name", equalTo("test-domain"))); } @Test - public void whenTopologyGenerated_containsAdminServerName() { + void whenTopologyGenerated_containsAdminServerName() { wlsDomainConfig.withAdminServer("admin-server", "admin-host", 7001); assertThat( @@ -668,7 +668,7 @@ public void whenTopologyGenerated_containsAdminServerName() { } @Test - public void whenTopologyGenerated_containsAdminServerSpec() { + void whenTopologyGenerated_containsAdminServerSpec() { wlsDomainConfig.withAdminServer("admin-server", "admin-host", 7001); assertThat( @@ -677,7 +677,7 @@ public void whenTopologyGenerated_containsAdminServerSpec() { } @Test - public void whenYamlGenerated_containsClusterConfig() { + void whenYamlGenerated_containsClusterConfig() { wlsDomainConfig.withCluster(new WlsClusterConfig("cluster1")); assertThat( @@ -686,7 +686,7 @@ public void whenYamlGenerated_containsClusterConfig() { } @Test - public void whenYamlGenerated_containsClusteredServerConfigs() { + void whenYamlGenerated_containsClusteredServerConfigs() { wlsDomainConfig.withCluster( new WlsClusterConfig("cluster1") .addServerConfig(new WlsServerConfig("ms1", "host1", 8001)) @@ -703,28 +703,28 @@ public void whenYamlGenerated_containsClusteredServerConfigs() { } @Test - public void containsServer_returnsTrue_forExistingStandaloneServer() { + void containsServer_returnsTrue_forExistingStandaloneServer() { wlsDomainConfig.addWlsServer("ms1","host1", 8001); assertThat(wlsDomainConfig.containsServer("ms1"), equalTo(true)); } @Test - public void containsServer_returnsTrue_forExistingConfiguredClusteredServer() { + void containsServer_returnsTrue_forExistingConfiguredClusteredServer() { support.addWlsCluster("cluster-1", "ms1"); assertThat(support.createDomainConfig().containsServer("ms1"), equalTo(true)); } @Test - public void containsServer_returnsTrue_forExistingDynamicClusterServer() { + void containsServer_returnsTrue_forExistingDynamicClusterServer() { support.addDynamicWlsCluster("cluster-1", "ms1"); assertThat(support.createDomainConfig().containsServer("ms1"), equalTo(true)); } @Test - public void containsServer_returnsFalse_forNonExistingServer() { + void containsServer_returnsFalse_forNonExistingServer() { support.addWlsCluster("cluster-1", "ms1"); support.addDynamicWlsCluster("dynamic-cluster", "dyn1"); support.addWlsServer("standalone"); @@ -733,26 +733,26 @@ public void containsServer_returnsFalse_forNonExistingServer() { } @Test - public void containsServer_returnsFalse_forNullServerName() { + void containsServer_returnsFalse_forNullServerName() { assertThat(wlsDomainConfig.containsServer(null), equalTo(false)); } @Test - public void containsCluster_returnsFalse_forNonExistingCluster() { + void containsCluster_returnsFalse_forNonExistingCluster() { support.addWlsCluster("cluster-1", "ms1"); assertThat(support.createDomainConfig().containsCluster("notthere"), equalTo(false)); } @Test - public void containsCluster_returnsTrue_forExistingCluster() { + void containsCluster_returnsTrue_forExistingCluster() { support.addWlsCluster("cluster-1", "ms1"); assertThat(support.createDomainConfig().containsCluster("cluster-1"), equalTo(true)); } @Test - public void containsCluster_returnsFalse_forNullServerName() { + void containsCluster_returnsFalse_forNullServerName() { assertThat(wlsDomainConfig.containsCluster(null), equalTo(false)); } diff --git a/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsDynamicServerConfigTest.java b/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsDynamicServerConfigTest.java index 12b96bcdde6..de063cabc10 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsDynamicServerConfigTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsDynamicServerConfigTest.java @@ -13,10 +13,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; -public class WlsDynamicServerConfigTest { +class WlsDynamicServerConfigTest { @Test - public void testCreateWithFixedPorts() { + void testCreateWithFixedPorts() { NetworkAccessPoint networkAccessPoint = new NetworkAccessPoint("Channel1", "t3", 10000, 30001); List networkAccessPointList = new ArrayList<>(); networkAccessPointList.add(networkAccessPoint); @@ -34,7 +34,7 @@ public void testCreateWithFixedPorts() { } @Test - public void testCreateWithNullPorts() { + void testCreateWithNullPorts() { NetworkAccessPoint networkAccessPoint = new NetworkAccessPoint("Channel1", "t3", null, null); List networkAccessPointList = new ArrayList<>(); networkAccessPointList.add(networkAccessPoint); @@ -52,7 +52,7 @@ public void testCreateWithNullPorts() { } @Test - public void testCreateWithCalculatedPorts() { + void testCreateWithCalculatedPorts() { NetworkAccessPoint networkAccessPoint = new NetworkAccessPoint("Channel1", "t3", 10000, 30001); List networkAccessPointList = new ArrayList<>(); networkAccessPointList.add(networkAccessPoint); @@ -70,7 +70,7 @@ public void testCreateWithCalculatedPorts() { } @Test - public void testCreateWithCalculatedDefaultPorts() { + void testCreateWithCalculatedDefaultPorts() { NetworkAccessPoint networkAccessPoint = new NetworkAccessPoint("Channel1", "t3", null, null); List networkAccessPointList = new ArrayList<>(); networkAccessPointList.add(networkAccessPoint); @@ -88,7 +88,7 @@ public void testCreateWithCalculatedDefaultPorts() { } @Test - public void verifyAdminPortIsSetOnServerConfigs() { + void verifyAdminPortIsSetOnServerConfigs() { final int adminPort = 9002; List networkAccessPointList = new ArrayList<>(); WlsServerConfig template = diff --git a/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsServerConfigTest.java b/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsServerConfigTest.java index 8a2b43e46cf..7507280b695 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsServerConfigTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsServerConfigTest.java @@ -8,7 +8,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public class WlsServerConfigTest { +class WlsServerConfigTest { static final int LISTEN_PORT = 8001; static final int SSL_LISTEN_PORT = 8002; @@ -17,35 +17,35 @@ public class WlsServerConfigTest { static final int NAP_NON_ADMIN_PORT = 8081; @Test - public void verify_getLocalAdminProtocolChannelPort_returnsListenPort() { + void verify_getLocalAdminProtocolChannelPort_returnsListenPort() { WlsServerConfig wlsServerConfig = createConfigWithOnlyListenPort(); assertThat(wlsServerConfig.getLocalAdminProtocolChannelPort(), is(LISTEN_PORT)); assertThat(wlsServerConfig.isLocalAdminProtocolChannelSecure(), is(false)); } @Test - public void verify_getLocalAdminProtocolChannelPort_returnsSslListenPort() { + void verify_getLocalAdminProtocolChannelPort_returnsSslListenPort() { WlsServerConfig wlsServerConfig = createConfigWithListenPortAndSslListenPort(); assertThat(wlsServerConfig.getLocalAdminProtocolChannelPort(), is(SSL_LISTEN_PORT)); assertThat(wlsServerConfig.isLocalAdminProtocolChannelSecure(), is(true)); } @Test - public void verify_getLocalAdminProtocolChannelPort_returnsAdminPort() { + void verify_getLocalAdminProtocolChannelPort_returnsAdminPort() { WlsServerConfig wlsServerConfig = createConfigWithAllListenPorts(); assertThat(wlsServerConfig.getLocalAdminProtocolChannelPort(), is(ADMIN_PORT)); assertThat(wlsServerConfig.isLocalAdminProtocolChannelSecure(), is(true)); } @Test - public void verify_getLocalAdminProtocolChannelPort_withAdminNap_returnsNapAdminPort() { + void verify_getLocalAdminProtocolChannelPort_withAdminNap_returnsNapAdminPort() { WlsServerConfig wlsServerConfig = createConfigWithAdminNap(); assertThat(wlsServerConfig.getLocalAdminProtocolChannelPort(), is(NAP_ADMIN_PORT)); assertThat(wlsServerConfig.isLocalAdminProtocolChannelSecure(), is(true)); } @Test - public void verify_getLocalAdminProtocolChannelPort_withNonAdminNap_returnsAdminPort() { + void verify_getLocalAdminProtocolChannelPort_withNonAdminNap_returnsAdminPort() { WlsServerConfig wlsServerConfig = createConfigWithNonAdminNap(); assertThat(wlsServerConfig.getLocalAdminProtocolChannelPort(), is(ADMIN_PORT)); assertThat(wlsServerConfig.isLocalAdminProtocolChannelSecure(), is(true)); diff --git a/operator/src/test/java/oracle/kubernetes/operator/work/FiberTest.java b/operator/src/test/java/oracle/kubernetes/operator/work/FiberTest.java index 80fd6729a5c..669277f14d9 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/work/FiberTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/work/FiberTest.java @@ -18,7 +18,7 @@ import static org.hamcrest.junit.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public class FiberTest { +class FiberTest { private static final String STEPS = "steps"; private static final String FIBERS = "fibers"; @@ -46,7 +46,7 @@ public void setUp() { } @Test - public void runToEnd() { + void runToEnd() { runSteps(step1, step2, step3); assertThat(stepList, contains(step1, step2, step3)); @@ -57,14 +57,14 @@ private void runSteps(Step... steps) { } @Test - public void afterSuccessfulRun_executeCompletionCallback() { + void afterSuccessfulRun_executeCompletionCallback() { runSteps(step1, step2, step3); assertThat(completionCallback.completed, is(true)); } @Test - public void whenStepRetries_runItAgain() { + void whenStepRetries_runItAgain() { runSteps(step1, retry, step3); testSupport.setTime(200, TimeUnit.MILLISECONDS); @@ -72,21 +72,21 @@ public void whenStepRetries_runItAgain() { } @Test - public void whenStepThrowsException_abortProcessing() { + void whenStepThrowsException_abortProcessing() { runSteps(step1, error, step3); assertThat(stepList, contains(step1, error)); } @Test - public void whenStepThrowsException_captureThrowable() { + void whenStepThrowsException_captureThrowable() { runSteps(step1, error, step3); assertThat(throwablesList, contains(instanceOf(RuntimeException.class))); } @Test - public void whenStepRequestsSuspend_hasAccessToFiber() { + void whenStepRequestsSuspend_hasAccessToFiber() { runSteps(step1, new SuspendingStep(this::recordFiber), step3); assertThat(fiberList, contains(sameInstance(fiber))); @@ -98,14 +98,14 @@ void recordFiber(Packet packet, AsyncFiber fiber) { } @Test - public void whenStepRequestsSuspend_suspendProcessing() { + void whenStepRequestsSuspend_suspendProcessing() { runSteps(step1, suspend, step3); assertThat(stepList, contains(step1, suspend)); } @Test - public void whenSuspendActionThrowsRuntimeException_rethrowFromFiber() { + void whenSuspendActionThrowsRuntimeException_rethrowFromFiber() { assertThrows(RuntimeException.class, () -> runSteps(step1, new SuspendingStep(this::throwException), step3)); } @@ -115,7 +115,7 @@ void throwException(Packet packet, AsyncFiber fiber) { } @Test - public void whenSuspendActionThrowsError_rethrowFromFiber() { + void whenSuspendActionThrowsError_rethrowFromFiber() { assertThrows(Error.class, () -> runSteps(step1, new SuspendingStep(this::throwError), step3)); } @@ -125,7 +125,7 @@ void throwError(Packet packet, AsyncFiber fiber) { } @Test - public void whenResumeAfterStepRequestsSuspend_completeProcessing() { + void whenResumeAfterStepRequestsSuspend_completeProcessing() { runSteps(step1, suspend, step3); fiber.resume(packet); diff --git a/operator/src/test/java/oracle/kubernetes/operator/work/FiberTestSupportTest.java b/operator/src/test/java/oracle/kubernetes/operator/work/FiberTestSupportTest.java index 6e70e49d758..a6460c672a1 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/work/FiberTestSupportTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/work/FiberTestSupportTest.java @@ -14,28 +14,28 @@ import static org.hamcrest.Matchers.empty; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class FiberTestSupportTest { +class FiberTestSupportTest { private final FiberTestSupport testSupport = new FiberTestSupport(); private final List itemsRun = new ArrayList<>(); private final Runnable reportItemRun = () -> itemsRun.add("item"); @Test - public void whenItemScheduledImmediately_runIt() { + void whenItemScheduledImmediately_runIt() { testSupport.schedule(reportItemRun); assertThat(itemsRun, contains("item")); } @Test - public void whenItemScheduledForFuture_dontExecuteItImmediately() { + void whenItemScheduledForFuture_dontExecuteItImmediately() { testSupport.schedule(reportItemRun, 1, SECONDS); assertThat(itemsRun, empty()); } @Test - public void afterItemScheduledForFuture_executeEachTimeAdvanced() { + void afterItemScheduledForFuture_executeEachTimeAdvanced() { testSupport.scheduleWithFixedDelay(reportItemRun, 1, 1, SECONDS); testSupport.setTime(1, SECONDS); testSupport.setTime(2, SECONDS); @@ -45,7 +45,7 @@ public void afterItemScheduledForFuture_executeEachTimeAdvanced() { } @Test - public void afterItemScheduledWithFixedDelay_executeMultipleTimesAfterTimeAdvanced() { + void afterItemScheduledWithFixedDelay_executeMultipleTimesAfterTimeAdvanced() { testSupport.scheduleWithFixedDelay(reportItemRun, 200, 500, MILLISECONDS); testSupport.setTime(1, SECONDS); diff --git a/operator/src/test/java/oracle/kubernetes/operator/work/InMemoryDatabaseTest.java b/operator/src/test/java/oracle/kubernetes/operator/work/InMemoryDatabaseTest.java index 55894e5e466..6f441eedd15 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/work/InMemoryDatabaseTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/work/InMemoryDatabaseTest.java @@ -19,7 +19,7 @@ import static org.junit.Assert.fail; import static org.junit.jupiter.api.Assertions.assertThrows; -public class InMemoryDatabaseTest { +class InMemoryDatabaseTest { private static final String NS1 = "namespace1"; private static final String NS2 = "namespace2"; @@ -35,7 +35,7 @@ NetworkingV1beta1IngressList createList(List items) { }; @Test - public void whenItemAbsent_readThrowsException() { + void whenItemAbsent_readThrowsException() { try { database.read(keys().name(NAME1).namespace(NS1).map()); fail("Should have thrown an InMemoryDatabaseException"); @@ -45,7 +45,7 @@ public void whenItemAbsent_readThrowsException() { } @Test - public void whenItemPresent_createThrowsException() { + void whenItemPresent_createThrowsException() { createItem(NAME1, NS1); try { @@ -66,14 +66,14 @@ private NetworkingV1beta1Ingress createItem(String name, String namespace) { } @Test - public void afterItemCreated_canRetrieveIt() { + void afterItemCreated_canRetrieveIt() { NetworkingV1beta1Ingress item = createItem(NAME1, NS1); assertThat(database.read(keys().name(NAME1).namespace(NS1).map()), equalTo(item)); } @Test - public void whenItemAbsent_replaceThrowsException() { + void whenItemAbsent_replaceThrowsException() { try { database.replace( new NetworkingV1beta1Ingress().metadata(new V1ObjectMeta().namespace(NS1).name(NAME1)), @@ -85,7 +85,7 @@ public void whenItemAbsent_replaceThrowsException() { } @Test - public void afterReplaceItem_canRetrieveNewItem() { + void afterReplaceItem_canRetrieveNewItem() { createItem(NAME1, NS1).kind("old item"); NetworkingV1beta1Ingress replacement = @@ -98,7 +98,7 @@ public void afterReplaceItem_canRetrieveNewItem() { } @Test - public void afterItemDeleted_cannotRetrieveIt() { + void afterItemDeleted_cannotRetrieveIt() { createItem(NAME1, NS1); database.delete(keys().name(NAME1).namespace(NS1).map()); @@ -107,7 +107,7 @@ public void afterItemDeleted_cannotRetrieveIt() { } @Test - public void whenItemToDeletedAbsent_throwException() { + void whenItemToDeletedAbsent_throwException() { try { database.delete(keys().name(NAME1).namespace(NS1).map()); fail("Should have thrown an InMemoryDatabaseException"); @@ -117,7 +117,7 @@ public void whenItemToDeletedAbsent_throwException() { } @Test - public void afterItemsCreated_canListMatches() { + void afterItemsCreated_canListMatches() { NetworkingV1beta1Ingress item1 = createItem(NAME1, NS1); NetworkingV1beta1Ingress item2 = createItem(NAME2, NS1); NetworkingV1beta1Ingress item3 = createItem(NAME1, NS2); diff --git a/operator/src/test/java/oracle/kubernetes/operator/work/StepChainTest.java b/operator/src/test/java/oracle/kubernetes/operator/work/StepChainTest.java index 9d82ab1ee3a..2b107daaf56 100644 --- a/operator/src/test/java/oracle/kubernetes/operator/work/StepChainTest.java +++ b/operator/src/test/java/oracle/kubernetes/operator/work/StepChainTest.java @@ -16,7 +16,7 @@ import static org.hamcrest.Matchers.contains; import static org.junit.jupiter.api.Assertions.assertThrows; -public class StepChainTest { +class StepChainTest { private final FiberTestSupport testSupport = new FiberTestSupport(); private final List mementos = new ArrayList<>(); @@ -34,7 +34,7 @@ public void tearDown() throws Exception { } @Test - public void afterChainingGroupsOfSteps_fiberRunsThemInOrder() { + void afterChainingGroupsOfSteps_fiberRunsThemInOrder() { Step group1 = new NamedStep("one", new NamedStep("two")); Step group2 = new NamedStep("three", new NamedStep("four", new NamedStep("five"))); Step group3 = new NamedStep("six"); @@ -47,7 +47,7 @@ public void afterChainingGroupsOfSteps_fiberRunsThemInOrder() { } @Test - public void ignoreNullFirstSteps() { + void ignoreNullFirstSteps() { Step group2 = new NamedStep("three", new NamedStep("four", new NamedStep("five"))); Step group3 = new NamedStep("six"); @@ -59,7 +59,7 @@ public void ignoreNullFirstSteps() { } @Test - public void ignoreNullMiddleSteps() { + void ignoreNullMiddleSteps() { Step group1 = new NamedStep("one", new NamedStep("two")); Step group3 = new NamedStep("six"); @@ -71,12 +71,12 @@ public void ignoreNullMiddleSteps() { } @Test - public void whenNoNonNullSteps_throwException() { + void whenNoNonNullSteps_throwException() { assertThrows(IllegalArgumentException.class, Step::chain); } @Test - public void doNotChainGroupThatContainsDuplicateStep() { + void doNotChainGroupThatContainsDuplicateStep() { Step duplicateStep = new NamedStep("duplicate", new NamedStep("two")); Step group1 = new NamedStep("one", duplicateStep); Step group2 = new NamedStep("three", duplicateStep); @@ -87,7 +87,7 @@ public void doNotChainGroupThatContainsDuplicateStep() { } @Test - public void addGroupThatContainsStepsWithSameName() { + void addGroupThatContainsStepsWithSameName() { Step group1 = new NamedStep("one", new NamedStep("two")); Step group2 = new NamedStep("two", new NamedStep("three")); diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/AdminServerTest.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/AdminServerTest.java index 634a90bb8d6..9b417214218 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/AdminServerTest.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/AdminServerTest.java @@ -15,7 +15,7 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class AdminServerTest extends BaseConfigurationTestBase { +class AdminServerTest extends BaseConfigurationTestBase { private static final String CHANNEL1 = "default"; private static final int PORT1 = 12345; private static final String CHANNEL2 = "nap1"; @@ -42,7 +42,7 @@ private AdminServerConfigurator configureAdminServer() { } @Test - public void whenChannelsLabelsAnnotationsAreTheSame_objectsAreEqual() { + void whenChannelsLabelsAnnotationsAreTheSame_objectsAreEqual() { server1.withChannel("nap1", 0); server1.addPodLabel("label1", VALUE1); server1.addPodAnnotation("annotation1", VALUE2); @@ -56,7 +56,7 @@ public void whenChannelsLabelsAnnotationsAreTheSame_objectsAreEqual() { } @Test - public void whenChannelsDifferByName_objectsAreNotEqual() { + void whenChannelsDifferByName_objectsAreNotEqual() { server1.withChannel("nap1", 0); server2.withChannel("nap2", 0); @@ -64,7 +64,7 @@ public void whenChannelsDifferByName_objectsAreNotEqual() { } @Test - public void whenDifferByPodLabel_objectsAreNotEqual() { + void whenDifferByPodLabel_objectsAreNotEqual() { server1.addPodLabel("a", "b"); server2.addPodLabel("a", "c"); @@ -72,7 +72,7 @@ public void whenDifferByPodLabel_objectsAreNotEqual() { } @Test - public void whenDifferByPodAnnotation_objectsAreNotEqual() { + void whenDifferByPodAnnotation_objectsAreNotEqual() { server1.addPodAnnotation("a", "b"); server2.addPodAnnotation("a", "c"); @@ -80,7 +80,7 @@ public void whenDifferByPodAnnotation_objectsAreNotEqual() { } @Test - public void whenDifferByServiceLabel_objectsAreNotEqual() { + void whenDifferByServiceLabel_objectsAreNotEqual() { server1.addServiceLabel("a", "b"); server2.addServiceLabel("a", "c"); @@ -88,7 +88,7 @@ public void whenDifferByServiceLabel_objectsAreNotEqual() { } @Test - public void whenDifferByServiceAnnotation_objectsAreNotEqual() { + void whenDifferByServiceAnnotation_objectsAreNotEqual() { server1.addServiceAnnotation("a", "b"); server2.addServiceAnnotation("a", "c"); @@ -96,7 +96,7 @@ public void whenDifferByServiceAnnotation_objectsAreNotEqual() { } @Test - public void whenConstructedWithAdminService_mayCreateChannels() { + void whenConstructedWithAdminService_mayCreateChannels() { configureAdminServer() .configureAdminService() .withChannel(CHANNEL1, PORT1) @@ -108,7 +108,7 @@ public void whenConstructedWithAdminService_mayCreateChannels() { } @Test - public void whenHaveSameAdminServiceChannels_objectsAreEqual() { + void whenHaveSameAdminServiceChannels_objectsAreEqual() { server1.createAdminService().withChannel(CHANNEL1, PORT1).withChannel(CHANNEL2, PORT2); server2.createAdminService().withChannel(CHANNEL2, PORT2).withChannel(CHANNEL1, PORT1); @@ -116,7 +116,7 @@ public void whenHaveSameAdminServiceChannels_objectsAreEqual() { } @Test - public void whenHaveDifferentAdminServiceChannels_objectsAreNotEqual() { + void whenHaveDifferentAdminServiceChannels_objectsAreNotEqual() { server1.createAdminService().withChannel(CHANNEL1, PORT1).withChannel(CHANNEL2, PORT2); server2.createAdminService().withChannel(CHANNEL1, PORT2).withChannel(CHANNEL2, PORT1); @@ -124,7 +124,7 @@ public void whenHaveDifferentAdminServiceChannels_objectsAreNotEqual() { } @Test - public void whenConstructedWithAdminService_mayAddLabels() { + void whenConstructedWithAdminService_mayAddLabels() { configureAdminServer() .configureAdminService() .withServiceLabel(NAME1, VALUE1) @@ -136,7 +136,7 @@ public void whenConstructedWithAdminService_mayAddLabels() { } @Test - public void whenHaveSameAdminServiceLabels_objectsAreEqual() { + void whenHaveSameAdminServiceLabels_objectsAreEqual() { server1.createAdminService().withServiceLabel(NAME1, VALUE1).withServiceLabel(NAME2, VALUE2); server2.createAdminService().withServiceLabel(NAME2, VALUE2).withServiceLabel(NAME1, VALUE1); @@ -144,7 +144,7 @@ public void whenHaveSameAdminServiceLabels_objectsAreEqual() { } @Test - public void whenHaveDifferentAdminServiceLabels_objectsAreNotEqual() { + void whenHaveDifferentAdminServiceLabels_objectsAreNotEqual() { server1.createAdminService().withServiceLabel(NAME1, VALUE1).withServiceLabel(NAME2, VALUE2); server2.createAdminService().withServiceLabel(NAME1, VALUE2).withServiceLabel(NAME2, VALUE1); @@ -152,7 +152,7 @@ public void whenHaveDifferentAdminServiceLabels_objectsAreNotEqual() { } @Test - public void whenConstructedWithAdminService_mayAddAnnotations() { + void whenConstructedWithAdminService_mayAddAnnotations() { configureAdminServer() .configureAdminService() .withServiceAnnotation(NAME1, VALUE1) @@ -164,7 +164,7 @@ public void whenConstructedWithAdminService_mayAddAnnotations() { } @Test - public void whenHaveSameAdminServiceAnnotations_objectsAreEqual() { + void whenHaveSameAdminServiceAnnotations_objectsAreEqual() { server1 .createAdminService() .withServiceAnnotation(NAME1, VALUE1) @@ -178,7 +178,7 @@ public void whenHaveSameAdminServiceAnnotations_objectsAreEqual() { } @Test - public void whenHaveDifferentAdminServiceAnnotations_objectsAreNotEqual() { + void whenHaveDifferentAdminServiceAnnotations_objectsAreNotEqual() { server1 .createAdminService() .withServiceAnnotation(NAME1, VALUE1) @@ -192,7 +192,7 @@ public void whenHaveDifferentAdminServiceAnnotations_objectsAreNotEqual() { } @Test - public void callingGetAdminService_doesNotChangeTheObject() { + void callingGetAdminService_doesNotChangeTheObject() { server1.getAdminService(); assertThat(server1, equalTo(server2)); diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/BaseConfigurationTestBase.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/BaseConfigurationTestBase.java index b83ed58fdcb..5168d5f401e 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/BaseConfigurationTestBase.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/BaseConfigurationTestBase.java @@ -32,7 +32,7 @@ T getInstance2() { } @Test - public void whenEnvironmentsAreTheSame_objectsAreEqual() { + void whenEnvironmentsAreTheSame_objectsAreEqual() { instance1.setEnv(Arrays.asList(env("a", "b"), env("c", "d"))); instance2.addEnvironmentVariable("a", "b"); instance2.addEnvironmentVariable("c", "d"); @@ -41,7 +41,7 @@ public void whenEnvironmentsAreTheSame_objectsAreEqual() { } @Test - public void whenEnvironmentsDiffer_objectsAreNotEqual() { + void whenEnvironmentsDiffer_objectsAreNotEqual() { instance1.setEnv(Arrays.asList(env("a", "b"), env("c", "d"))); instance2.addEnvironmentVariable("a", "b"); @@ -49,7 +49,7 @@ public void whenEnvironmentsDiffer_objectsAreNotEqual() { } @Test - public void whenServerStartStatesAreSame_objectsAreEqual() { + void whenServerStartStatesAreSame_objectsAreEqual() { instance1.setServerStartState("ADMIN"); instance2.setServerStartState("ADMIN"); @@ -57,14 +57,14 @@ public void whenServerStartStatesAreSame_objectsAreEqual() { } @Test - public void whenServerStartStatesDiffer_objectsAreNotEqual() { + void whenServerStartStatesDiffer_objectsAreNotEqual() { instance1.setServerStartState("ADMIN"); assertThat(instance1, not(equalTo(instance2))); } @Test - public void whenServerStartPolicyAreSame_objectsAreEqual() { + void whenServerStartPolicyAreSame_objectsAreEqual() { instance1.setServerStartPolicy("IF_NEEDED"); instance2.setServerStartPolicy("IF_NEEDED"); @@ -72,7 +72,7 @@ public void whenServerStartPolicyAreSame_objectsAreEqual() { } @Test - public void whenServerStartPoliciesDiffer_objectsAreNotEqual() { + void whenServerStartPoliciesDiffer_objectsAreNotEqual() { instance1.setServerStartPolicy("NEVER"); assertThat(instance1, not(equalTo(instance2))); @@ -83,26 +83,26 @@ private V1EnvVar env(String name, String value) { } @Test - public void whenServiceLabelsDiffer_objectsAreNotEqual() { + void whenServiceLabelsDiffer_objectsAreNotEqual() { instance1.addServiceLabel("key", "value"); assertThat(instance1, not(equalTo(instance2))); } @Test - public void whenServiceLabelsDoNotDiffer_objectsAreEqual() { + void whenServiceLabelsDoNotDiffer_objectsAreEqual() { instance1.addServiceLabel("key", "value"); instance2.addServiceLabel("key", "value"); assertThat(instance1, equalTo(instance2)); } @Test - public void whenServiceAnnotationsDiffer_hashCodesAreNotEqual() { + void whenServiceAnnotationsDiffer_hashCodesAreNotEqual() { instance1.addServiceAnnotation("key", "value"); assertThat(instance1.hashCode(), not(equalTo(instance2.hashCode()))); } @Test - public void whenServiceAnnotationsDoNotDiffer_hashCodesAreEqual() { + void whenServiceAnnotationsDoNotDiffer_hashCodesAreEqual() { instance1.addServiceAnnotation("key", "value"); instance2.addServiceAnnotation("key", "value"); assertThat(instance1.hashCode(), equalTo(instance2.hashCode())); diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ClusterStatusTest.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ClusterStatusTest.java index d3ee61a6a50..d2a63266d3b 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ClusterStatusTest.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ClusterStatusTest.java @@ -10,7 +10,7 @@ import static org.hamcrest.Matchers.lessThan; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class ClusterStatusTest { +class ClusterStatusTest { static final ClusterStatus cluster1 = new ClusterStatus().withClusterName("cluster1"); static final ClusterStatus cluster2 = new ClusterStatus().withClusterName("cluster2"); @@ -18,7 +18,7 @@ public class ClusterStatusTest { static final ClusterStatus nullCluster = new ClusterStatus(); @Test - public void verify_Equal_compareTo() { + void verify_Equal_compareTo() { assertThat("compareTo should return 0 if both Cluster have null cluster name", nullCluster.compareTo(new ClusterStatus()), equalTo(0)); assertThat("compareTo should return 0 if both ClusterStatus have same cluster name", @@ -26,7 +26,7 @@ public void verify_Equal_compareTo() { } @Test - public void verifyThat_cluster1_before_cluster2() { + void verifyThat_cluster1_before_cluster2() { assertThat("ClusterStatus for cluster1 should be ordered before ClusterStatus for cluster2", cluster1.compareTo(cluster2), lessThan(0)); assertThat("ClusterStatus for cluster2 should be ordered after ClusterStatus for cluster1", @@ -34,7 +34,7 @@ public void verifyThat_cluster1_before_cluster2() { } @Test - public void verifyThat_cluster1_before_cluster10() { + void verifyThat_cluster1_before_cluster10() { assertThat("ClusterStatus for cluster1 should be ordered before ClusterStatus for cluster10", cluster1.compareTo(cluster10), lessThan(0)); assertThat("ClusterStatus for cluster10 should be ordered after ClusterStatus for cluster1", @@ -42,7 +42,7 @@ public void verifyThat_cluster1_before_cluster10() { } @Test - public void verifyThat_cluster2_before_cluster10() { + void verifyThat_cluster2_before_cluster10() { assertThat("ClusterStatus for cluster2 should be ordered before ClusterStatus for cluster10", cluster2.compareTo(cluster10), lessThan(0)); assertThat("ClusterStatus for cluster10 should be ordered after ClusterStatus for cluster2", @@ -50,7 +50,7 @@ public void verifyThat_cluster2_before_cluster10() { } @Test - public void verifyThat_nullCluster_before_cluster1() { + void verifyThat_nullCluster_before_cluster1() { assertThat("ClusterStatus without cluster name should be ordered before ClusterStatus for cluster1", nullCluster.compareTo(cluster1), lessThan(0)); assertThat("ClusterStatus for cluster1 should be ordered after ClusterStatus without cluster name", diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ClusterTest.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ClusterTest.java index fd1eef0ecc4..8343d44a22d 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ClusterTest.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ClusterTest.java @@ -9,7 +9,7 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class ClusterTest extends BaseConfigurationTestBase { +class ClusterTest extends BaseConfigurationTestBase { private final Cluster cluster1; private final Cluster cluster2; @@ -23,7 +23,7 @@ public ClusterTest() { } @Test - public void whenNamesAreTheSame_objectsAreEqual() { + void whenNamesAreTheSame_objectsAreEqual() { cluster1.setClusterName("one"); cluster2.setClusterName("one"); @@ -31,7 +31,7 @@ public void whenNamesAreTheSame_objectsAreEqual() { } @Test - public void whenNamesDiffer_objectsAreNotEqual() { + void whenNamesDiffer_objectsAreNotEqual() { cluster1.setClusterName("one"); cluster2.setClusterName("two"); @@ -39,7 +39,7 @@ public void whenNamesDiffer_objectsAreNotEqual() { } @Test - public void whenReplicasAreTheSame_objectsAreEqual() { + void whenReplicasAreTheSame_objectsAreEqual() { cluster1.setReplicas(3); cluster2.setReplicas(3); @@ -47,7 +47,7 @@ public void whenReplicasAreTheSame_objectsAreEqual() { } @Test - public void whenReplicasDiffer_objectsAreNotEqual() { + void whenReplicasDiffer_objectsAreNotEqual() { cluster1.setReplicas(3); assertThat(cluster1, not(equalTo(cluster2))); diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/CrdSchemaGeneratorTest.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/CrdSchemaGeneratorTest.java index 1cccb0f0b62..b046cf61adf 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/CrdSchemaGeneratorTest.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/CrdSchemaGeneratorTest.java @@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class CrdSchemaGeneratorTest { +class CrdSchemaGeneratorTest { private final List mementos = new ArrayList<>(); @@ -68,7 +68,7 @@ void validateSchemaAgainstSamples(String fileName) throws IOException { } @Test - public void whenMixOfEnabledDisabledFeatures_validateSchemaOnlyContainsEnabled() { + void whenMixOfEnabledDisabledFeatures_validateSchemaOnlyContainsEnabled() { final Map schema = createSchema(SomeObject.class); assertThat(schema, hasKey("properties")); diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainConditionTest.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainConditionTest.java index b780d2b52e9..9e5bdaec90d 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainConditionTest.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainConditionTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class DomainConditionTest { +class DomainConditionTest { private final List mementos = new ArrayList<>(); @@ -34,19 +34,19 @@ public void tearDown() { } @Test - public void whenCreated_conditionHasLastTransitionTime() { + void whenCreated_conditionHasLastTransitionTime() { assertThat(new DomainCondition(Available).getLastTransitionTime(), SystemClockTestSupport.isDuringTest()); } @Test - public void predicateDetectsType() { + void predicateDetectsType() { assertThat(new DomainCondition(Failed).hasType(Failed), is(true)); assertThat(new DomainCondition(Progressing).hasType(Available), is(false)); assertThat(new DomainCondition(ConfigChangesPendingRestart).hasType(ConfigChangesPendingRestart), is(true)); } @Test - public void equalsIgnoresLastTransitionTime() { + void equalsIgnoresLastTransitionTime() { DomainCondition oldCondition = new DomainCondition(Available).withStatus("True"); SystemClockTestSupport.increment(); @@ -54,7 +54,7 @@ public void equalsIgnoresLastTransitionTime() { } @Test - public void mayNotPatchObjects() { + void mayNotPatchObjects() { DomainCondition oldCondition = new DomainCondition(Available).withStatus("False"); DomainCondition newCondition = new DomainCondition(Available).withStatus("True"); diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainSpecTest.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainSpecTest.java index 56612800b24..69b6c3b0389 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainSpecTest.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainSpecTest.java @@ -10,24 +10,24 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class DomainSpecTest { +class DomainSpecTest { @Test - public void whenEffectiveDomainSpecsWithDefaultImage_domainSpecEquals() { + void whenEffectiveDomainSpecsWithDefaultImage_domainSpecEquals() { DomainSpec spec1 = new DomainSpec().withImage(KubernetesConstants.DEFAULT_IMAGE); DomainSpec spec2 = new DomainSpec(); assertThat("Expected effective image values to be equal", spec1, equalTo(spec2)); } @Test - public void whenEffectiveDomainSpecsWithLatestImage_domainSpecNotEquals() { + void whenEffectiveDomainSpecsWithLatestImage_domainSpecNotEquals() { DomainSpec spec1 = new DomainSpec().withImage(getLatestDefaultImage()); DomainSpec spec2 = new DomainSpec(); assertThat("Expected effective image values to NOT be equal", spec1, not(equalTo(spec2))); } @Test - public void whenEffectiveImagePullPolicyWithDefaultImage_domainSpecImagePullPolicyEquals() { + void whenEffectiveImagePullPolicyWithDefaultImage_domainSpecImagePullPolicyEquals() { DomainSpec spec1 = new DomainSpec().withImage(KubernetesConstants.DEFAULT_IMAGE); DomainSpec spec2 = new DomainSpec(); assertThat("Expected effective image pull policy values to be equal", @@ -35,7 +35,7 @@ public void whenEffectiveImagePullPolicyWithDefaultImage_domainSpecImagePullPoli } @Test - public void whenEffectiveImagePullPolicyWithLatestImage_domainSpecImagePullPolicyNotEquals() { + void whenEffectiveImagePullPolicyWithLatestImage_domainSpecImagePullPolicyNotEquals() { DomainSpec spec1 = new DomainSpec().withImage(getLatestDefaultImage()); DomainSpec spec2 = new DomainSpec(); assertThat("Expected effective image pull policy values to NOT be equal", @@ -43,7 +43,7 @@ public void whenEffectiveImagePullPolicyWithLatestImage_domainSpecImagePullPolic } @Test - public void whenEffectiveImageWithDefaultImage_imageEquals() { + void whenEffectiveImageWithDefaultImage_imageEquals() { DomainSpec spec1 = new DomainSpec().withImage(KubernetesConstants.DEFAULT_IMAGE); DomainSpec spec2 = new DomainSpec(); assertThat("Expected effective image values to be equal", @@ -51,7 +51,7 @@ public void whenEffectiveImageWithDefaultImage_imageEquals() { } @Test - public void whenEffectiveImageWithLatestImage_imageNotEquals() { + void whenEffectiveImageWithLatestImage_imageNotEquals() { DomainSpec spec1 = new DomainSpec().withImage(getLatestDefaultImage()); DomainSpec spec2 = new DomainSpec(); assertThat("Expected effective image pull policy values to NOT be equal", @@ -59,7 +59,7 @@ public void whenEffectiveImageWithLatestImage_imageNotEquals() { } @Test - public void verifyThatDomainSpecWithoutAllowMinDynClusterSize_equalsToDomainSpecWithDefaultValue() { + void verifyThatDomainSpecWithoutAllowMinDynClusterSize_equalsToDomainSpecWithDefaultValue() { DomainSpec spec1 = new DomainSpec(); DomainSpec spec2 = new DomainSpec(); spec2.setAllowReplicasBelowMinDynClusterSize(KubernetesConstants.DEFAULT_ALLOW_REPLICAS_BELOW_MIN_DYN_CLUSTER_SIZE); @@ -69,7 +69,7 @@ public void verifyThatDomainSpecWithoutAllowMinDynClusterSize_equalsToDomainSpec } @Test - public void verifyThatDomainSpecWithoutAllowMinDynClusterSize_notEqualsToDomainSpecWithFalse() { + void verifyThatDomainSpecWithoutAllowMinDynClusterSize_notEqualsToDomainSpecWithFalse() { DomainSpec spec1 = new DomainSpec(); DomainSpec spec2 = new DomainSpec(); spec2.setAllowReplicasBelowMinDynClusterSize( @@ -80,7 +80,7 @@ public void verifyThatDomainSpecWithoutAllowMinDynClusterSize_notEqualsToDomainS } @Test - public void verifyThatDomainSpecWithoutMaxClusterConcurrentStartup_equalsToDomainSpecWithDefaultValue() { + void verifyThatDomainSpecWithoutMaxClusterConcurrentStartup_equalsToDomainSpecWithDefaultValue() { DomainSpec spec1 = new DomainSpec(); DomainSpec spec2 = new DomainSpec(); spec2.setMaxClusterConcurrentStartup(KubernetesConstants.DEFAULT_MAX_CLUSTER_CONCURRENT_START_UP); @@ -90,7 +90,7 @@ public void verifyThatDomainSpecWithoutMaxClusterConcurrentStartup_equalsToDomai } @Test - public void verifyThatDomainSpecWithoutMaxClusterConcurrentStartup_notEqualsToDomainSpecWithFalse() { + void verifyThatDomainSpecWithoutMaxClusterConcurrentStartup_notEqualsToDomainSpecWithFalse() { DomainSpec spec1 = new DomainSpec(); DomainSpec spec2 = new DomainSpec(); spec2.setMaxClusterConcurrentStartup(KubernetesConstants.DEFAULT_MAX_CLUSTER_CONCURRENT_START_UP diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainStatusTest.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainStatusTest.java index 8a57267194d..76cebaed010 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainStatusTest.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainStatusTest.java @@ -31,7 +31,7 @@ import static org.hamcrest.Matchers.sameInstance; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class DomainStatusTest { +class DomainStatusTest { private DomainStatus domainStatus; private final List mementos = new ArrayList<>(); @@ -49,12 +49,12 @@ public void tearDown() { } @Test - public void whenCreated_statusHasCreationTime() { + void whenCreated_statusHasCreationTime() { assertThat(domainStatus.getStartTime(), SystemClockTestSupport.isDuringTest()); } @Test - public void whenAddedConditionEqualsPresentCondition_ignoreIt() { + void whenAddedConditionEqualsPresentCondition_ignoreIt() { DomainCondition originalCondition = new DomainCondition(Failed).withStatus("True"); domainStatus.addCondition(originalCondition); @@ -65,7 +65,7 @@ public void whenAddedConditionEqualsPresentCondition_ignoreIt() { } @Test - public void whenAddedConditionIsFailed_retainOldFailedCondition() { + void whenAddedConditionIsFailed_retainOldFailedCondition() { domainStatus.addCondition(new DomainCondition(Failed).withStatus("True").withMessage("problem 1")); domainStatus.addCondition(new DomainCondition(Failed).withStatus("True").withMessage("problem 2")); @@ -74,7 +74,7 @@ public void whenAddedConditionIsFailed_retainOldFailedCondition() { } @Test - public void whenAddedConditionIsFailed_removeProgressingCondition() { + void whenAddedConditionIsFailed_removeProgressingCondition() { domainStatus.addCondition(new DomainCondition(Progressing).withStatus("False")); domainStatus.addCondition(new DomainCondition(Failed).withStatus("True")); @@ -84,7 +84,7 @@ public void whenAddedConditionIsFailed_removeProgressingCondition() { } @Test - public void whenAddedConditionIsFailed_removeExistingAvailableCondition() { + void whenAddedConditionIsFailed_removeExistingAvailableCondition() { domainStatus.addCondition(new DomainCondition(Available).withStatus("False")); domainStatus.addCondition(new DomainCondition(Failed).withStatus("True")); @@ -94,7 +94,7 @@ public void whenAddedConditionIsFailed_removeExistingAvailableCondition() { } @Test - public void whenAddedConditionIsAvailable_replaceOldAvailableCondition() { + void whenAddedConditionIsAvailable_replaceOldAvailableCondition() { domainStatus.addCondition(new DomainCondition(Available).withStatus("False")); domainStatus.addCondition(new DomainCondition(Available).withStatus("True")); @@ -104,7 +104,7 @@ public void whenAddedConditionIsAvailable_replaceOldAvailableCondition() { } @Test - public void whenAddedConditionIsAvailable_removeExistedProgressingCondition() { + void whenAddedConditionIsAvailable_removeExistedProgressingCondition() { domainStatus.addCondition(new DomainCondition(Progressing).withStatus("False")); domainStatus.addCondition(new DomainCondition(Available).withStatus("True")); @@ -114,7 +114,7 @@ public void whenAddedConditionIsAvailable_removeExistedProgressingCondition() { } @Test - public void whenAddedConditionIsAvailable_removeExistedFailedCondition() { + void whenAddedConditionIsAvailable_removeExistedFailedCondition() { domainStatus.addCondition(new DomainCondition(Failed).withStatus("False")); domainStatus.addCondition(new DomainCondition(Available).withStatus("True")); @@ -124,7 +124,7 @@ public void whenAddedConditionIsAvailable_removeExistedFailedCondition() { } @Test - public void whenAddedConditionIsProgressing_replaceOldProgressingCondition() { + void whenAddedConditionIsProgressing_replaceOldProgressingCondition() { domainStatus.addCondition(new DomainCondition(Progressing).withStatus("False")); domainStatus.addCondition(new DomainCondition(Progressing).withStatus("True")); @@ -134,7 +134,7 @@ public void whenAddedConditionIsProgressing_replaceOldProgressingCondition() { } @Test - public void whenAddedConditionIsProgressing_leaveExistingAvailableCondition() { + void whenAddedConditionIsProgressing_leaveExistingAvailableCondition() { domainStatus.addCondition(new DomainCondition(Available).withStatus("False")); domainStatus.addCondition(new DomainCondition(Progressing).withStatus("True")); @@ -144,7 +144,7 @@ public void whenAddedConditionIsProgressing_leaveExistingAvailableCondition() { } @Test - public void whenAddedConditionIsProgress_doNotRmoveExistedFailedCondition() { + void whenAddedConditionIsProgress_doNotRmoveExistedFailedCondition() { domainStatus.addCondition(new DomainCondition(Failed).withStatus("False")); domainStatus.addCondition(new DomainCondition(Progressing).withStatus("True")); @@ -154,7 +154,7 @@ public void whenAddedConditionIsProgress_doNotRmoveExistedFailedCondition() { } @Test - public void whenAddedConditionIsConfigChangesPending_doNotRemoveExistingFailedCondition() { + void whenAddedConditionIsConfigChangesPending_doNotRemoveExistingFailedCondition() { domainStatus.addCondition(new DomainCondition(Failed).withStatus("True")); domainStatus.addCondition(new DomainCondition(ConfigChangesPendingRestart).withStatus("True")); @@ -164,7 +164,7 @@ public void whenAddedConditionIsConfigChangesPending_doNotRemoveExistingFailedCo } @Test - public void whenAddedConditionIsConfigChangesPending_doNotRemoveExistingAvailableCondition() { + void whenAddedConditionIsConfigChangesPending_doNotRemoveExistingAvailableCondition() { domainStatus.addCondition(new DomainCondition(Available)); domainStatus.addCondition(new DomainCondition(ConfigChangesPendingRestart).withStatus("True")); @@ -174,19 +174,19 @@ public void whenAddedConditionIsConfigChangesPending_doNotRemoveExistingAvailabl } @Test - public void beforeConditionAdded_statusFailsPredicate() { + void beforeConditionAdded_statusFailsPredicate() { assertThat(domainStatus.hasConditionWith(c -> c.hasType(Available)), is(false)); } @Test - public void afterConditionAdded_statusPassesPredicate() { + void afterConditionAdded_statusPassesPredicate() { domainStatus.addCondition(new DomainCondition(Available)); assertThat(domainStatus.hasConditionWith(c -> c.hasType(Available)), is(true)); } @Test - public void afterFailedConditionAdded_copyMessageAndReasonToStatus() { + void afterFailedConditionAdded_copyMessageAndReasonToStatus() { domainStatus.addCondition(new DomainCondition(Failed).withMessage("message").withReason("reason")); assertThat(domainStatus.getMessage(), equalTo("message")); @@ -194,7 +194,7 @@ public void afterFailedConditionAdded_copyMessageAndReasonToStatus() { } @Test - public void afterNonFailedConditionAdded_clearStatusMessageAndReason() { + void afterNonFailedConditionAdded_clearStatusMessageAndReason() { domainStatus.setMessage("old message"); domainStatus.setReason("old reason"); @@ -205,14 +205,14 @@ public void afterNonFailedConditionAdded_clearStatusMessageAndReason() { } @Test - public void whenClusterStatusAdded_statusHasClusterStatus() { + void whenClusterStatusAdded_statusHasClusterStatus() { domainStatus.addCluster(new ClusterStatus().withClusterName("cluster1").withReplicas(3)); assertThat(domainStatus.getClusters(), hasItem(clusterStatus("cluster1").withReplicas(3))); } @Test - public void whenClusterStatusAdded_remainingClusterStatusesUnaffected() { + void whenClusterStatusAdded_remainingClusterStatusesUnaffected() { domainStatus.addCluster(new ClusterStatus().withClusterName("cluster1").withReplicas(3)); domainStatus.addCluster(new ClusterStatus().withClusterName("cluster2").withMaximumReplicas(10)); @@ -221,7 +221,7 @@ public void whenClusterStatusAdded_remainingClusterStatusesUnaffected() { } @Test - public void whenClusterStatusAdded_matchingClusterStatusesReplaced() { + void whenClusterStatusAdded_matchingClusterStatusesReplaced() { domainStatus.addCluster(new ClusterStatus().withClusterName("cluster1").withReplicas(3).withReplicasGoal(5)); domainStatus.addCluster(new ClusterStatus().withClusterName("cluster1").withMaximumReplicas(10) @@ -235,7 +235,7 @@ public void whenClusterStatusAdded_matchingClusterStatusesReplaced() { } @Test - public void whenHasCondition_cloneIsEqual() { + void whenHasCondition_cloneIsEqual() { domainStatus.addCondition(new DomainCondition(Progressing).withStatus("False")); DomainStatus clone = new DomainStatus(this.domainStatus); @@ -244,7 +244,7 @@ public void whenHasCondition_cloneIsEqual() { } @Test - public void whenHasServerStatusWithHealth_cloneIsEqual() { + void whenHasServerStatusWithHealth_cloneIsEqual() { domainStatus.addServer(new ServerStatus().withHealth(new ServerHealth().withOverallHealth("peachy"))); DomainStatus clone = new DomainStatus(this.domainStatus); @@ -253,7 +253,7 @@ public void whenHasServerStatusWithHealth_cloneIsEqual() { } @Test - public void whenHasServerStatusWithoutHealth_cloneIsEqual() { + void whenHasServerStatusWithoutHealth_cloneIsEqual() { domainStatus.addServer(new ServerStatus().withServerName("myserver")); DomainStatus clone = new DomainStatus(this.domainStatus); @@ -262,7 +262,7 @@ public void whenHasServerStatusWithoutHealth_cloneIsEqual() { } @Test - public void verifyThat_addServers_serverSortedInExpectedOrdering() { + void verifyThat_addServers_serverSortedInExpectedOrdering() { ServerStatus cluster1Server1 = new ServerStatus().withClusterName("cluster-1").withServerName("cluster1-server1"); ServerStatus cluster1Server2 = new ServerStatus().withClusterName("cluster-1").withServerName("cluster1-server2"); ServerStatus cluster2Server1 = new ServerStatus().withClusterName("cluster-2").withServerName("cluster2-server1"); @@ -277,7 +277,7 @@ public void verifyThat_addServers_serverSortedInExpectedOrdering() { } @Test - public void verifyThat_setServers_serverSortedInExpectedOrdering() { + void verifyThat_setServers_serverSortedInExpectedOrdering() { ServerStatus cluster1Server1 = createStatus().withClusterName("cluster-1").withServerName("cluster1-server1"); ServerStatus cluster1Server2 = createStatus().withClusterName("cluster-1").withServerName("cluster1-server2"); ServerStatus cluster2Server1 = createStatus().withClusterName("cluster-2").withServerName("cluster2-server1"); @@ -296,7 +296,7 @@ private ServerStatus createStatus() { } @Test - public void whenMatchingServersExist_setServersUpdatesState() { + void whenMatchingServersExist_setServersUpdatesState() { domainStatus.addServer(new ServerStatus().withClusterName("1").withServerName("1").withState("state1")); domainStatus.addServer(new ServerStatus().withClusterName("1").withServerName("2").withState("state1")); domainStatus.addServer(new ServerStatus().withClusterName("1").withServerName("3").withState("state1")); @@ -313,7 +313,7 @@ public void whenMatchingServersExist_setServersUpdatesState() { } @Test - public void whenSetServerIncludesServerWithoutStateAndNoExistingState_defaultToSHUTDOWN() { + void whenSetServerIncludesServerWithoutStateAndNoExistingState_defaultToSHUTDOWN() { domainStatus.addServer(new ServerStatus().withClusterName("1").withServerName("1").withState("state1")); domainStatus.addServer(new ServerStatus().withClusterName("1").withServerName("2").withState("state1")); domainStatus.addServer(new ServerStatus().withClusterName("1").withServerName("3").withState("state1")); @@ -329,7 +329,7 @@ public void whenSetServerIncludesServerWithoutStateAndNoExistingState_defaultToS } @Test - public void whenSetServerIncludesServerWithoutStateAndHasExistingState_preserveIt() { + void whenSetServerIncludesServerWithoutStateAndHasExistingState_preserveIt() { domainStatus.addServer(new ServerStatus().withClusterName("1").withServerName("1").withState("state1") .withHealth(new ServerHealth().withOverallHealth("ok"))); domainStatus.addServer(new ServerStatus().withClusterName("1").withServerName("2").withState("state1") @@ -356,7 +356,7 @@ private ServerStatus getServer(String clusterName, String serverName) { } @Test - public void verifyThat_getServers_serverInExpectedOrdering() { + void verifyThat_getServers_serverInExpectedOrdering() { ServerStatus cluster1Server1 = new ServerStatus().withClusterName("cluster-1").withServerName("cluster1-server1"); ServerStatus cluster1Server2 = new ServerStatus().withClusterName("cluster-1").withServerName("cluster1-server2"); ServerStatus cluster2Server1 = new ServerStatus().withClusterName("cluster-2").withServerName("cluster2-server1"); @@ -373,7 +373,7 @@ public void verifyThat_getServers_serverInExpectedOrdering() { } @Test - public void verifyThat_addClusters_clustersSortedInExpectedOrdering() { + void verifyThat_addClusters_clustersSortedInExpectedOrdering() { ClusterStatus cluster1 = new ClusterStatus().withClusterName("cluster-1"); ClusterStatus cluster2 = new ClusterStatus().withClusterName("cluster-2"); ClusterStatus cluster10 = new ClusterStatus().withClusterName("cluster-10"); @@ -384,7 +384,7 @@ public void verifyThat_addClusters_clustersSortedInExpectedOrdering() { } @Test - public void verifyThat_setClusters_clustersSortedInExpectedOrdering() { + void verifyThat_setClusters_clustersSortedInExpectedOrdering() { ClusterStatus cluster1 = new ClusterStatus().withClusterName("cluster-1"); ClusterStatus cluster2 = new ClusterStatus().withClusterName("cluster-2"); ClusterStatus cluster10 = new ClusterStatus().withClusterName("cluster-10"); @@ -395,7 +395,7 @@ public void verifyThat_setClusters_clustersSortedInExpectedOrdering() { } @Test - public void verifyThat_getClusters_clustersInExpectedOrdering() { + void verifyThat_getClusters_clustersInExpectedOrdering() { ClusterStatus cluster1 = new ClusterStatus().withClusterName("cluster-1"); ClusterStatus cluster2 = new ClusterStatus().withClusterName("cluster-2"); ClusterStatus cluster10 = new ClusterStatus().withClusterName("cluster-10"); @@ -408,7 +408,7 @@ public void verifyThat_getClusters_clustersInExpectedOrdering() { } @Test - public void verifyThat_getServers_returnCopyOfServersList() { + void verifyThat_getServers_returnCopyOfServersList() { ServerStatus server1 = new ServerStatus().withServerName("server1"); ServerStatus server2 = new ServerStatus().withServerName("server2"); @@ -422,7 +422,7 @@ public void verifyThat_getServers_returnCopyOfServersList() { } @Test - public void verifyThat_getClusters_returnCopyOfClustersList() { + void verifyThat_getClusters_returnCopyOfClustersList() { ClusterStatus cluster1 = new ClusterStatus().withClusterName("cluster1"); ClusterStatus cluster2 = new ClusterStatus().withClusterName("cluster2"); diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainTestBase.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainTestBase.java index c04bbba371d..c38edd17854 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainTestBase.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainTestBase.java @@ -66,17 +66,17 @@ protected static Domain createDomain() { protected abstract DomainConfigurator configureDomain(Domain domain); @Test - public void canGetAdminServerInfoFromDomain() { + void canGetAdminServerInfoFromDomain() { assertThat(domain.getWebLogicCredentialsSecretName(), equalTo(SECRET_NAME)); } @Test - public void canGetDomainInfoFromDomain() { + void canGetDomainInfoFromDomain() { assertThat(domain.getDomainUid(), equalTo(DOMAIN_UID)); } @Test - public void adminServerSpecHasStandardValues() { + void adminServerSpecHasStandardValues() { ServerSpec spec = domain.getAdminServerSpec(); verifyStandardFields(spec); @@ -90,7 +90,7 @@ private void verifyStandardFields(ServerSpec spec) { } @Test - public void unconfiguredManagedServerSpecHasStandardValues() { + void unconfiguredManagedServerSpecHasStandardValues() { ServerSpec spec = domain.getServer("aServer", CLUSTER_NAME); verifyStandardFields(spec); @@ -102,14 +102,14 @@ private V1EnvVar envVar(String name, String value) { } @Test - public void unconfiguredAdminServer_hasNoEnvironmentVariables() { + void unconfiguredAdminServer_hasNoEnvironmentVariables() { ServerSpec spec = domain.getAdminServerSpec(); assertThat(spec.getEnvironmentVariables(), empty()); } @Test - public void whenDefaultImageSpecified_serversHaveSpecifiedImage() { + void whenDefaultImageSpecified_serversHaveSpecifiedImage() { configureDomain(domain).withDefaultImage(IMAGE); assertThat(domain.getAdminServerSpec().getImage(), equalTo(IMAGE)); @@ -117,7 +117,7 @@ public void whenDefaultImageSpecified_serversHaveSpecifiedImage() { } @Test - public void whenLatestImageSpecifiedAsDefault_serversHaveAlwaysPullPolicy() { + void whenLatestImageSpecifiedAsDefault_serversHaveAlwaysPullPolicy() { configureDomain(domain).withDefaultImage(IMAGE + LATEST_IMAGE_SUFFIX); assertThat(domain.getAdminServerSpec().getImagePullPolicy(), equalTo(ALWAYS_IMAGEPULLPOLICY)); @@ -127,7 +127,7 @@ public void whenLatestImageSpecifiedAsDefault_serversHaveAlwaysPullPolicy() { } @Test - public void whenNotSpecified_imageHasDefault() { + void whenNotSpecified_imageHasDefault() { domain.getSpec().setImage(null); ServerSpec spec = domain.getAdminServerSpec(); @@ -136,7 +136,7 @@ public void whenNotSpecified_imageHasDefault() { } @Test - public void whenImageTagIsLatestAndPullPolicyNotSpecified_pullPolicyIsAlways() { + void whenImageTagIsLatestAndPullPolicyNotSpecified_pullPolicyIsAlways() { domain.getSpec().setImage("test:latest"); domain.getSpec().setImagePullPolicy(null); @@ -146,7 +146,7 @@ public void whenImageTagIsLatestAndPullPolicyNotSpecified_pullPolicyIsAlways() { } @Test - public void whenImageTagIsNotLatestAndPullPolicyNotSpecified_pullPolicyIsIfAbsent() { + void whenImageTagIsNotLatestAndPullPolicyNotSpecified_pullPolicyIsIfAbsent() { domain.getSpec().setImage("test:1.0"); domain.getSpec().setImagePullPolicy(null); @@ -156,7 +156,7 @@ public void whenImageTagIsNotLatestAndPullPolicyNotSpecified_pullPolicyIsIfAbsen } @Test - public void whenImagePullPolicySpecifiedAsDefault_allServersHaveIt() { + void whenImagePullPolicySpecifiedAsDefault_allServersHaveIt() { configureDomain(domain).withDefaultImagePullPolicy(ALWAYS_IMAGEPULLPOLICY); assertThat(domain.getAdminServerSpec().getImagePullPolicy(), equalTo(ALWAYS_IMAGEPULLPOLICY)); @@ -166,7 +166,7 @@ public void whenImagePullPolicySpecifiedAsDefault_allServersHaveIt() { } @Test - public void whenDefaultImagePullSecretSpecified_allServersHaveIt() { + void whenDefaultImagePullSecretSpecified_allServersHaveIt() { V1LocalObjectReference secretReference = createSecretReference(PULL_SECRET_NAME); configureDomain(domain).withDefaultImagePullSecrets(secretReference); @@ -181,7 +181,7 @@ private V1LocalObjectReference createSecretReference(String pullSecretName) { } @Test - public void whenSpecified_adminServerHasEnvironmentVariables() { + void whenSpecified_adminServerHasEnvironmentVariables() { configureAdminServer() .withEnvironmentVariable(NAME1, VALUE1) .withEnvironmentVariable(NAME2, VALUE2); @@ -200,7 +200,7 @@ private V1EnvVar[] createEnvironment() { } @Test - public void whenOtherServersDefined_adminServerHasNoEnvironmentVariables() { + void whenOtherServersDefined_adminServerHasNoEnvironmentVariables() { configureServer(SERVER1) .withEnvironmentVariable(NAME1, VALUE1) .withEnvironmentVariable(NAME2, VALUE2); @@ -211,7 +211,7 @@ public void whenOtherServersDefined_adminServerHasNoEnvironmentVariables() { } @Test - public void whenSpecified_adminServerDesiredStateIsAsSpecified() { + void whenSpecified_adminServerDesiredStateIsAsSpecified() { configureAdminServer().withDesiredState("ADMIN"); ServerSpec spec = domain.getAdminServerSpec(); @@ -224,21 +224,21 @@ protected ServerConfigurator configureServer(String serverName) { } @Test - public void whenNotSpecified_adminServerDesiredStateIsRunning() { + void whenNotSpecified_adminServerDesiredStateIsRunning() { ServerSpec spec = domain.getAdminServerSpec(); assertThat(spec.getDesiredState(), equalTo("RUNNING")); } @Test - public void whenNotSpecified_managedServerDesiredStateIsRunning() { + void whenNotSpecified_managedServerDesiredStateIsRunning() { ServerSpec spec = domain.getServer(SERVER1, CLUSTER_NAME); assertThat(spec.getDesiredState(), equalTo("RUNNING")); } @Test - public void whenSpecified_managedServerDesiredStateIsAsSpecified() { + void whenSpecified_managedServerDesiredStateIsAsSpecified() { configureServer(SERVER1).withDesiredState("STAND-BY"); ServerSpec spec = domain.getServer(SERVER1, CLUSTER_NAME); @@ -247,7 +247,7 @@ public void whenSpecified_managedServerDesiredStateIsAsSpecified() { } @Test - public void whenOnlyAsStateSpecified_managedServerDesiredStateIsRunning() { + void whenOnlyAsStateSpecified_managedServerDesiredStateIsRunning() { configureAdminServer().withDesiredState("ADMIN"); ServerSpec spec = domain.getServer(SERVER1, CLUSTER_NAME); @@ -256,7 +256,7 @@ public void whenOnlyAsStateSpecified_managedServerDesiredStateIsRunning() { } @Test - public void whenClusterStateSpecified_managedServerDesiredStateIsAsSpecified() { + void whenClusterStateSpecified_managedServerDesiredStateIsAsSpecified() { configureCluster(CLUSTER_NAME).withDesiredState("NEVER"); ServerSpec spec = domain.getServer(SERVER1, CLUSTER_NAME); @@ -269,21 +269,21 @@ protected ClusterConfigurator configureCluster(String clusterName) { } @Test - public void whenNoReplicaCountSpecified_canChangeIt() { + void whenNoReplicaCountSpecified_canChangeIt() { domain.setReplicaCount("cluster1", 7); assertThat(domain.getReplicaCount("cluster1"), equalTo(7)); } @Test - public void afterReplicaCountSetForCluster_canReadIt() { + void afterReplicaCountSetForCluster_canReadIt() { configureCluster("cluster1").withReplicas(5); assertThat(domain.getReplicaCount("cluster1"), equalTo(5)); } @Test - public void afterReplicaCountSetForCluster_canChangeIt() { + void afterReplicaCountSetForCluster_canChangeIt() { configureCluster("cluster1").withReplicas(5); domain.setReplicaCount("cluster1", 4); @@ -291,42 +291,42 @@ public void afterReplicaCountSetForCluster_canChangeIt() { } @Test - public void afterReplicaCountMaxUnavailableSetForCluster_canReadMinAvailable() { + void afterReplicaCountMaxUnavailableSetForCluster_canReadMinAvailable() { configureCluster("cluster1").withReplicas(5).withMaxUnavailable(2); assertThat(domain.getMinAvailable("cluster1"), equalTo(3)); } @Test - public void afterReplicaCountSetForCluster_canReadMinAvailable() { + void afterReplicaCountSetForCluster_canReadMinAvailable() { configureCluster("cluster1").withReplicas(5); assertThat(domain.getMinAvailable("cluster1"), equalTo(4)); } @Test - public void afterReplicaCountMaxUnavailableSetForCluster_zeroMin() { + void afterReplicaCountMaxUnavailableSetForCluster_zeroMin() { configureCluster("cluster1").withReplicas(3).withMaxUnavailable(10); assertThat(domain.getMinAvailable("cluster1"), equalTo(0)); } @Test - public void afterMaxUnavailableSetForCluster_canReadIt() { + void afterMaxUnavailableSetForCluster_canReadIt() { configureCluster("cluster1").withMaxUnavailable(5); assertThat(domain.getMaxUnavailable("cluster1"), equalTo(5)); } @Test - public void afterAllowReplicasBelowMinDynamicClusterSizeSetForCluster_canReadIt() { + void afterAllowReplicasBelowMinDynamicClusterSizeSetForCluster_canReadIt() { configureCluster("cluster1").withAllowReplicasBelowDynClusterSize(false); assertThat(domain.isAllowReplicasBelowMinDynClusterSize("cluster1"), equalTo(false)); } @Test - public void whenNotSpecified_allowReplicasBelowMinDynamicClusterSizeHasDefault() { + void whenNotSpecified_allowReplicasBelowMinDynamicClusterSizeHasDefault() { configureCluster("cluster1"); configureDomain(domain).withAllowReplicasBelowMinDynClusterSize(null); @@ -335,7 +335,7 @@ public void whenNotSpecified_allowReplicasBelowMinDynamicClusterSizeHasDefault() } @Test - public void whenNotSpecified_allowReplicasBelowMinDynamicClusterSizeFromDomain() { + void whenNotSpecified_allowReplicasBelowMinDynamicClusterSizeFromDomain() { configureCluster("cluster1"); configureDomain(domain).withAllowReplicasBelowMinDynClusterSize(false); @@ -344,13 +344,13 @@ public void whenNotSpecified_allowReplicasBelowMinDynamicClusterSizeFromDomain() } @Test - public void whenNoClusterSpec_allowReplicasBelowMinDynamicClusterSizeHasDefault() { + void whenNoClusterSpec_allowReplicasBelowMinDynamicClusterSizeHasDefault() { assertThat(domain.isAllowReplicasBelowMinDynClusterSize("cluster-with-no-spec"), equalTo(DEFAULT_ALLOW_REPLICAS_BELOW_MIN_DYN_CLUSTER_SIZE)); } @Test - public void whenBothClusterAndDomainSpecified_allowReplicasBelowMinDynamicClusterSizeFromCluster() { + void whenBothClusterAndDomainSpecified_allowReplicasBelowMinDynamicClusterSizeFromCluster() { configureCluster("cluster1").withAllowReplicasBelowDynClusterSize(false); configureDomain(domain).withAllowReplicasBelowMinDynClusterSize(true); @@ -359,14 +359,14 @@ public void whenBothClusterAndDomainSpecified_allowReplicasBelowMinDynamicCluste } @Test - public void afterMaxConcurrentStartupSetForCluster_canReadIt() { + void afterMaxConcurrentStartupSetForCluster_canReadIt() { configureCluster("cluster1").withMaxConcurrentStartup(3); assertThat(domain.getMaxConcurrentStartup("cluster1"), equalTo(3)); } @Test - public void whenNotSpecified_maxConcurrentStartupHasDefault() { + void whenNotSpecified_maxConcurrentStartupHasDefault() { configureCluster("cluster1"); configureDomain(domain).withMaxConcurrentStartup(null); @@ -375,7 +375,7 @@ public void whenNotSpecified_maxConcurrentStartupHasDefault() { } @Test - public void whenNotSpecified_maxConcurrentStartupFromDomain() { + void whenNotSpecified_maxConcurrentStartupFromDomain() { configureCluster("cluster1"); configureDomain(domain).withMaxConcurrentStartup(2); @@ -384,13 +384,13 @@ public void whenNotSpecified_maxConcurrentStartupFromDomain() { } @Test - public void whenNoClusterSpec_maxConcurrentStartupHasDefault() { + void whenNoClusterSpec_maxConcurrentStartupHasDefault() { assertThat(domain.getMaxConcurrentStartup("cluster-with-no-spec"), equalTo(DEFAULT_MAX_CLUSTER_CONCURRENT_START_UP)); } @Test - public void whenBothClusterAndDomainSpecified_maxConcurrentStartupFromCluster() { + void whenBothClusterAndDomainSpecified_maxConcurrentStartupFromCluster() { configureCluster("cluster1").withMaxConcurrentStartup(1); configureDomain(domain).withMaxConcurrentStartup(0); @@ -399,14 +399,14 @@ public void whenBothClusterAndDomainSpecified_maxConcurrentStartupFromCluster() } @Test - public void afterMaxConcurrentShutdownSetForCluster_canReadIt() { + void afterMaxConcurrentShutdownSetForCluster_canReadIt() { configureCluster("cluster1").withMaxConcurrentShutdown(3); assertThat(domain.getMaxConcurrentShutdown("cluster1"), equalTo(3)); } @Test - public void whenNotSpecified_maxConcurrentShutdownHasDefault() { + void whenNotSpecified_maxConcurrentShutdownHasDefault() { configureCluster("cluster1"); configureDomain(domain).withMaxConcurrentShutdown(null); @@ -415,7 +415,7 @@ public void whenNotSpecified_maxConcurrentShutdownHasDefault() { } @Test - public void whenNotSpecified_maxConcurrentShutdownFromDomain() { + void whenNotSpecified_maxConcurrentShutdownFromDomain() { configureDomain(domain).withMaxConcurrentShutdown(2); assertThat(domain.getMaxConcurrentShutdown("cluster1"), @@ -423,13 +423,13 @@ public void whenNotSpecified_maxConcurrentShutdownFromDomain() { } @Test - public void whenNoClusterSpec_maxConcurrentShutdownHasDefault() { + void whenNoClusterSpec_maxConcurrentShutdownHasDefault() { assertThat(domain.getMaxConcurrentShutdown("cluster-with-no-spec"), equalTo(DEFAULT_MAX_CLUSTER_CONCURRENT_SHUTDOWN)); } @Test - public void whenBothClusterAndDomainSpecified_maxConcurrentShutdownFromCluster() { + void whenBothClusterAndDomainSpecified_maxConcurrentShutdownFromCluster() { configureCluster("cluster1").withMaxConcurrentShutdown(1); configureDomain(domain).withMaxConcurrentShutdown(0); @@ -438,7 +438,7 @@ public void whenBothClusterAndDomainSpecified_maxConcurrentShutdownFromCluster() } @Test - public void whenBothClusterAndServerStateSpecified_managedServerUsesServerState() { + void whenBothClusterAndServerStateSpecified_managedServerUsesServerState() { configureServer(SERVER1).withDesiredState("STAND-BY"); configureCluster(CLUSTER_NAME).withDesiredState("NEVER"); @@ -448,7 +448,7 @@ public void whenBothClusterAndServerStateSpecified_managedServerUsesServerState( } @Test - public void whenSpecifiedOnServer_managedServerHasEnvironmentVariables() { + void whenSpecifiedOnServer_managedServerHasEnvironmentVariables() { configureServer(SERVER1) .withEnvironmentVariable(NAME1, VALUE1) .withEnvironmentVariable(NAME2, VALUE2); @@ -459,7 +459,7 @@ public void whenSpecifiedOnServer_managedServerHasEnvironmentVariables() { } @Test - public void whenSpecifiedOnCluster_managedServerHasEnvironmentVariables() { + void whenSpecifiedOnCluster_managedServerHasEnvironmentVariables() { configureCluster(CLUSTER_NAME) .withEnvironmentVariable(NAME1, VALUE1) .withEnvironmentVariable(NAME2, VALUE2); @@ -470,7 +470,7 @@ public void whenSpecifiedOnCluster_managedServerHasEnvironmentVariables() { } @Test - public void whenDesiredStateAdminAndSpecifiedOnCluster_managedServerHasEnvironmentVariables() { + void whenDesiredStateAdminAndSpecifiedOnCluster_managedServerHasEnvironmentVariables() { configureCluster(CLUSTER_NAME) .withDesiredState("ADMIN") .withEnvironmentVariable("JAVA_OPTIONS", "value"); @@ -481,7 +481,7 @@ public void whenDesiredStateAdminAndSpecifiedOnCluster_managedServerHasEnvironme } @Test - public void whenDomainReadFromYaml_unconfiguredServerHasDomainDefaults() throws IOException { + void whenDomainReadFromYaml_unconfiguredServerHasDomainDefaults() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); ServerSpec serverSpec = domain.getServer("server0", null); @@ -493,7 +493,7 @@ public void whenDomainReadFromYaml_unconfiguredServerHasDomainDefaults() throws } @Test - public void whenDomainReadFromYaml_Server1OverridesDefaults() throws IOException { + void whenDomainReadFromYaml_Server1OverridesDefaults() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); ServerSpec serverSpec = domain.getServer("server1", null); @@ -509,7 +509,7 @@ public void whenDomainReadFromYaml_Server1OverridesDefaults() throws IOException } @Test - public void whenDomainReadFromYaml_Server2OverridesDefaults() throws IOException { + void whenDomainReadFromYaml_Server2OverridesDefaults() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); ServerSpec serverSpec = domain.getServer("server2", null); @@ -517,7 +517,7 @@ public void whenDomainReadFromYaml_Server2OverridesDefaults() throws IOException } @Test - public void whenDomainReadFromYaml_Cluster2OverridesDefaults() throws IOException { + void whenDomainReadFromYaml_Cluster2OverridesDefaults() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); assertThat(domain.getReplicaCount("cluster2"), equalTo(5)); diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainV2Test.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainV2Test.java index 2ebb895a97e..19876614c33 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainV2Test.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainV2Test.java @@ -44,7 +44,7 @@ import static org.hamcrest.core.Is.is; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class DomainV2Test extends DomainTestBase { +class DomainV2Test extends DomainTestBase { private static final int DEFAULT_REPLICA_LIMIT = 0; private static final int INITIAL_DELAY = 17; @@ -67,120 +67,120 @@ protected DomainConfigurator configureDomain(Domain domain) { } @Test - public void whenDomainOnPV_logHomeDefaultsToEnabled() { + void whenDomainOnPV_logHomeDefaultsToEnabled() { configureDomain(domain).withDomainHomeInImage(false); assertThat(domain.isLogHomeEnabled(), is(true)); } @Test - public void whenDomainOnPvAndLogHomeDisabled_returnOverride() { + void whenDomainOnPvAndLogHomeDisabled_returnOverride() { configureDomain(domain).withDomainHomeInImage(false).withLogHomeEnabled(false); assertThat(domain.isLogHomeEnabled(), is(false)); } @Test - public void whenDomainInImage_logHomeDefaultsToDisabled() { + void whenDomainInImage_logHomeDefaultsToDisabled() { configureDomain(domain).withDomainHomeInImage(true); assertThat(domain.isLogHomeEnabled(), is(false)); } @Test - public void whenDomainInImageAndLogHomeEnabled_returnOverride() { + void whenDomainInImageAndLogHomeEnabled_returnOverride() { configureDomain(domain).withDomainHomeInImage(true).withLogHomeEnabled(true); assertThat(domain.isLogHomeEnabled(), is(true)); } @Test - public void whenLogHomeSet_returnIt() { + void whenLogHomeSet_returnIt() { configureDomain(domain).withLogHome("/my/logs/"); assertThat(domain.getLogHome(), equalTo("/my/logs/")); } @Test - public void whenLogHomeSetWithoutTrailingSlash_appendOne() { + void whenLogHomeSetWithoutTrailingSlash_appendOne() { configureDomain(domain).withLogHome("/my/logs"); assertThat(domain.getLogHome(), equalTo("/my/logs/")); } @Test - public void whenLogHomeSetNull_returnDefaultLogHome() { + void whenLogHomeSetNull_returnDefaultLogHome() { configureDomain(domain).withLogHome(null); assertThat(domain.getLogHome(), equalTo("/shared/logs/" + DOMAIN_UID)); } @Test - public void whenLogHomeSetToBlanks_returnDefaultLogHome() { + void whenLogHomeSetToBlanks_returnDefaultLogHome() { configureDomain(domain).withLogHome(" "); assertThat(domain.getLogHome(), equalTo("/shared/logs/" + DOMAIN_UID)); } @Test - public void whenLogHomeDisabled_effectiveLogHomeIsNull() { + void whenLogHomeDisabled_effectiveLogHomeIsNull() { configureDomain(domain).withLogHomeEnabled(false).withLogHome("/my/logs/"); assertThat(domain.getEffectiveLogHome(), nullValue()); } @Test - public void whenLogHomeEnabled_effectiveLogHomeEqualsLogHome() { + void whenLogHomeEnabled_effectiveLogHomeEqualsLogHome() { configureDomain(domain).withLogHomeEnabled(true).withLogHome("/my/logs/"); assertThat(domain.getEffectiveLogHome(), equalTo("/my/logs/")); } @Test - public void whenClusterNotConfiguredAndNoDomainReplicaCount_countIsZero() { + void whenClusterNotConfiguredAndNoDomainReplicaCount_countIsZero() { assertThat(domain.getReplicaCount("nosuchcluster"), equalTo(0)); } @Test - public void whenClusterNotConfiguredAndDomainHasReplicaCount_useIt() { + void whenClusterNotConfiguredAndDomainHasReplicaCount_useIt() { configureDomain(domain).withDefaultReplicaCount(3); assertThat(domain.getReplicaCount("nosuchcluster"), equalTo(3)); } @Test - public void whenStartupPolicyUnspecified_adminServerStartsUp() { + void whenStartupPolicyUnspecified_adminServerStartsUp() { assertThat(domain.getAdminServerSpec().shouldStart(0), is(true)); } @Test - public void whenStartupPolicyUnspecified_nonClusteredServerStartsUp() { + void whenStartupPolicyUnspecified_nonClusteredServerStartsUp() { assertThat(domain.getServer("server1", null).shouldStart(0), is(true)); } @Test - public void whenStartupPolicyUnspecified_clusteredServerStartsUpIfLimitNotReached() { + void whenStartupPolicyUnspecified_clusteredServerStartsUpIfLimitNotReached() { configureCluster("cluster1").withReplicas(3); assertThat(domain.getServer("server1", null).shouldStart(1), is(true)); } @Test - public void whenStartupPolicyUnspecified_clusteredServerDoesNotStartUpIfLimitReached() { + void whenStartupPolicyUnspecified_clusteredServerDoesNotStartUpIfLimitReached() { configureCluster("cluster1").withReplicas(3); assertThat(domain.getServer("server1", "cluster1").shouldStart(4), is(false)); } @Test - public void whenStartupPolicyNever_nonClusteredServerDoesNotStartUp() { + void whenStartupPolicyNever_nonClusteredServerDoesNotStartUp() { configureDomain(domain).withDefaultServerStartPolicy(START_NEVER); assertThat(domain.getServer("server1", null).shouldStart(0), is(false)); } @Test - public void whenStartupPolicyAlways_clusteredServerStartsUpEvenIfLimitReached() { + void whenStartupPolicyAlways_clusteredServerStartsUpEvenIfLimitReached() { configureDomain(domain).withDefaultServerStartPolicy(START_ALWAYS); configureCluster("cluster1").withReplicas(3); @@ -188,12 +188,12 @@ public void whenStartupPolicyAlways_clusteredServerStartsUpEvenIfLimitReached() } @Test - public void whenAdminServerChannelsNotDefined_exportedNamesIsEmpty() { + void whenAdminServerChannelsNotDefined_exportedNamesIsEmpty() { assertThat(domain.getAdminServerChannelNames(), empty()); } @Test - public void whenServerStartStateConfiguredOnClusterAndServer_useServerSetting() { + void whenServerStartStateConfiguredOnClusterAndServer_useServerSetting() { configureCluster("cluster1").withServerStartState("cluster"); configureServer("server1").withServerStartState("server"); @@ -201,7 +201,7 @@ public void whenServerStartStateConfiguredOnClusterAndServer_useServerSetting() } @Test - public void whenServerStartPolicyAlwaysConfiguredOnlyOnDomain_startServer() { + void whenServerStartPolicyAlwaysConfiguredOnlyOnDomain_startServer() { configureDomain(domain).withDefaultServerStartPolicy(ConfigurationConstants.START_ALWAYS); configureServer("server1"); @@ -209,38 +209,38 @@ public void whenServerStartPolicyAlwaysConfiguredOnlyOnDomain_startServer() { } @Test - public void whenServerStartPolicyNever_dontStartServer() { + void whenServerStartPolicyNever_dontStartServer() { configureServer("server1").withServerStartPolicy(START_NEVER); assertThat(domain.getServer("server1", "cluster1").shouldStart(0), is(false)); } @Test - public void whenServerStartPolicyAlways_startServer() { + void whenServerStartPolicyAlways_startServer() { configureServer("server1").withServerStartPolicy(ConfigurationConstants.START_ALWAYS); assertThat(domain.getServer("server1", "cluster1").shouldStart(0), is(true)); } @Test - public void whenNonClusteredServerStartPolicyUndefined_startServer() { + void whenNonClusteredServerStartPolicyUndefined_startServer() { assertThat(domain.getServer("server1", null).shouldStart(0), is(true)); } @Test - public void whenUnconfiguredClusterHasDefaultNumberOfReplicas_dontStartServer() { + void whenUnconfiguredClusterHasDefaultNumberOfReplicas_dontStartServer() { assertThat(domain.getServer("server1", "cls1").shouldStart(DEFAULT_REPLICA_LIMIT), is(false)); } @Test - public void whenClusteredServerStartPolicyInheritedAndNeedMoreServers_startServer() { + void whenClusteredServerStartPolicyInheritedAndNeedMoreServers_startServer() { configureCluster("cluster1").withReplicas(5); assertThat(domain.getServer("server1", "cluster1").shouldStart(4), is(true)); } @Test - public void whenClusteredServerStartPolicyIfNeededAndDontNeedMoreServers_dontStartServer() { + void whenClusteredServerStartPolicyIfNeededAndDontNeedMoreServers_dontStartServer() { configureServer("server1").withServerStartPolicy(ConfigurationConstants.START_IF_NEEDED); configureCluster("cluster1").withReplicas(5); @@ -248,7 +248,7 @@ public void whenClusteredServerStartPolicyIfNeededAndDontNeedMoreServers_dontSta } @Test - public void whenDomainStartPolicyNever_ignoreServerSettings() { + void whenDomainStartPolicyNever_ignoreServerSettings() { configureDomain(domain).withDefaultServerStartPolicy(ConfigurationConstants.START_NEVER); configureServer("server1").withServerStartPolicy(ConfigurationConstants.START_ALWAYS); @@ -256,7 +256,7 @@ public void whenDomainStartPolicyNever_ignoreServerSettings() { } @Test - public void whenClusterStartPolicyNever_ignoreServerSettings() { + void whenClusterStartPolicyNever_ignoreServerSettings() { configureCluster("cluster1").withServerStartPolicy(ConfigurationConstants.START_NEVER); configureServer("server1").withServerStartPolicy(ConfigurationConstants.START_ALWAYS); @@ -264,7 +264,7 @@ public void whenClusterStartPolicyNever_ignoreServerSettings() { } @Test - public void whenDomainStartPolicyAdminOnly_dontStartManagedServer() { + void whenDomainStartPolicyAdminOnly_dontStartManagedServer() { configureDomain(domain).withDefaultServerStartPolicy(ConfigurationConstants.START_ADMIN_ONLY); configureServer("server1").withServerStartPolicy(ConfigurationConstants.START_ALWAYS); @@ -272,7 +272,7 @@ public void whenDomainStartPolicyAdminOnly_dontStartManagedServer() { } @Test - public void whenDomainStartPolicyAdminOnlyAndAdminServerNever_dontStartAdminServer() { + void whenDomainStartPolicyAdminOnlyAndAdminServerNever_dontStartAdminServer() { configureDomain(domain).withDefaultServerStartPolicy(ConfigurationConstants.START_ADMIN_ONLY); configureAdminServer().withServerStartPolicy(ConfigurationConstants.START_NEVER); @@ -280,7 +280,7 @@ public void whenDomainStartPolicyAdminOnlyAndAdminServerNever_dontStartAdminServ } @Test - public void whenDomainStartPolicyAdminOnlyAndAdminServerIfNeeded_startAdminServer() { + void whenDomainStartPolicyAdminOnlyAndAdminServerIfNeeded_startAdminServer() { configureDomain(domain).withDefaultServerStartPolicy(ConfigurationConstants.START_ADMIN_ONLY); configureAdminServer().withServerStartPolicy(ConfigurationConstants.START_IF_NEEDED); @@ -288,7 +288,7 @@ public void whenDomainStartPolicyAdminOnlyAndAdminServerIfNeeded_startAdminServe } @Test - public void whenEnvironmentConfiguredOnMultipleLevels_useCombination() { + void whenEnvironmentConfiguredOnMultipleLevels_useCombination() { configureDomain(domain) .withEnvironmentVariable("name1", "domain") .withEnvironmentVariable("name2", "domain"); @@ -312,7 +312,7 @@ private V1EnvVar envVar(String name, String value) { } @Test - public void livenessProbeSettings_returnsConfiguredValues() { + void livenessProbeSettings_returnsConfiguredValues() { configureServer(SERVER1).withLivenessProbeSettings(INITIAL_DELAY, TIMEOUT, PERIOD); ServerSpec spec = domain.getServer(SERVER1, CLUSTER_NAME); @@ -322,7 +322,7 @@ public void livenessProbeSettings_returnsConfiguredValues() { } @Test - public void whenLivenessProbeConfiguredOnMultipleLevels_useCombination() { + void whenLivenessProbeConfiguredOnMultipleLevels_useCombination() { configureDomain(domain).withDefaultLivenessProbeSettings(INITIAL_DELAY, -2, -3); configureCluster(CLUSTER_NAME).withLivenessProbeSettings(null, TIMEOUT, -4); configureServer(SERVER1).withLivenessProbeSettings(null, null, PERIOD); @@ -335,7 +335,7 @@ public void whenLivenessProbeConfiguredOnMultipleLevels_useCombination() { } @Test - public void readinessProbeSettings_returnsConfiguredValues() { + void readinessProbeSettings_returnsConfiguredValues() { configureServer(SERVER1).withReadinessProbeSettings(INITIAL_DELAY, TIMEOUT, PERIOD); ServerSpec spec = domain.getServer(SERVER1, CLUSTER_NAME); @@ -345,7 +345,7 @@ public void readinessProbeSettings_returnsConfiguredValues() { } @Test - public void whenReadinessProbeConfiguredOnMultipleLevels_useCombination() { + void whenReadinessProbeConfiguredOnMultipleLevels_useCombination() { configureDomain(domain).withDefaultReadinessProbeSettings(INITIAL_DELAY, -2, -3); configureCluster(CLUSTER_NAME).withReadinessProbeSettings(null, TIMEOUT, -4); configureServer(SERVER1).withReadinessProbeSettings(null, null, PERIOD); @@ -358,7 +358,7 @@ public void whenReadinessProbeConfiguredOnMultipleLevels_useCombination() { } @Test - public void whenDomainsAreConfiguredAlike_objectsAreEqual() { + void whenDomainsAreConfiguredAlike_objectsAreEqual() { Domain domain1 = createDomain(); configureDomain(domain).configureCluster("cls1"); @@ -368,7 +368,7 @@ public void whenDomainsAreConfiguredAlike_objectsAreEqual() { } @Test - public void whenNodeSelectorConfiguredOnMultipleLevels_useCombination() { + void whenNodeSelectorConfiguredOnMultipleLevels_useCombination() { configureDomain(domain) .withNodeSelector("key1", "domain") .withNodeSelector("key2", "domain") @@ -391,7 +391,7 @@ public void whenNodeSelectorConfiguredOnMultipleLevels_useCombination() { } @Test - public void whenRestartVersionConfiguredOnMultipleLevels_useCombination() { + void whenRestartVersionConfiguredOnMultipleLevels_useCombination() { configureDomain(domain).withRestartVersion("1"); configureCluster(CLUSTER_NAME).withRestartVersion("2"); configureServer(SERVER1).withRestartVersion("3"); @@ -420,7 +420,7 @@ public void whenRestartVersionConfiguredOnMultipleLevels_useCombination() { } @Test - public void whenResourceRequirementsConfiguredOnDomain() { + void whenResourceRequirementsConfiguredOnDomain() { configureDomainWithResourceRequirements(domain); assertThat( domain.getSpec().getResources().getRequests(), hasResourceQuantity("memory", "64Mi")); @@ -430,7 +430,7 @@ public void whenResourceRequirementsConfiguredOnDomain() { } @Test - public void whenResourceRequirementsConfiguredOnClusterOverrideDomain() { + void whenResourceRequirementsConfiguredOnClusterOverrideDomain() { configureDomainWithResourceRequirements(domain); V1ResourceRequirements msResourceReq = domain.getServer("any", CLUSTER_NAME).getResources(); @@ -442,7 +442,7 @@ public void whenResourceRequirementsConfiguredOnClusterOverrideDomain() { } @Test - public void whenResourceRequirementsConfiguredOnManagedServerOverrideClusterAndDomain() { + void whenResourceRequirementsConfiguredOnManagedServerOverrideClusterAndDomain() { configureDomainWithResourceRequirements(domain); V1ResourceRequirements ms1ResourceReq = domain.getServer(SERVER1, CLUSTER_NAME).getResources(); @@ -457,7 +457,7 @@ public void whenResourceRequirementsConfiguredOnManagedServerOverrideClusterAndD } @Test - public void whenResourceRequirementsConfiguredOnAdminServerOverrideClusterAndDomain() { + void whenResourceRequirementsConfiguredOnAdminServerOverrideClusterAndDomain() { configureDomainWithResourceRequirements(domain); V1ResourceRequirements asResourceReq = domain.getAdminServerSpec().getResources(); @@ -489,7 +489,7 @@ private void configureDomainWithResourceRequirements(Domain domain) { } @Test - public void whenPodSecurityContextConfiguredOnManagedServerOverrideClusterAndDomain() { + void whenPodSecurityContextConfiguredOnManagedServerOverrideClusterAndDomain() { configureDomainWithPodSecurityContext(domain); V1PodSecurityContext ms1PodSecCtx = domain.getServer(SERVER1, CLUSTER_NAME).getPodSecurityContext(); @@ -514,7 +514,7 @@ public void whenPodSecurityContextConfiguredOnManagedServerOverrideClusterAndDom } @Test - public void whenPodSecurityContextConfiguredOnClusterOverrideDomain() { + void whenPodSecurityContextConfiguredOnClusterOverrideDomain() { configureDomainWithPodSecurityContext(domain); V1PodSecurityContext msPodSecCtx = domain.getServer("any", CLUSTER_NAME).getPodSecurityContext(); @@ -535,7 +535,7 @@ public void whenPodSecurityContextConfiguredOnClusterOverrideDomain() { } @Test - public void whenPodSecurityContextConfiguredOnAdminServerOverrideClusterAndDomain() { + void whenPodSecurityContextConfiguredOnAdminServerOverrideClusterAndDomain() { configureDomainWithPodSecurityContext(domain); V1PodSecurityContext asPodSecCtx = domain.getAdminServerSpec().getPodSecurityContext(); @@ -590,7 +590,7 @@ private void configureDomainWithPodSecurityContext(Domain domain) { } @Test - public void whenContainerSecurityContextConfiguredOnManagedServerOverrideClusterAndDomain() { + void whenContainerSecurityContextConfiguredOnManagedServerOverrideClusterAndDomain() { configureDomainWithContainerSecurityContext(domain); V1SecurityContext ms1ContainerSecSpec = domain.getServer(SERVER1, CLUSTER_NAME).getContainerSecurityContext(); @@ -607,7 +607,7 @@ public void whenContainerSecurityContextConfiguredOnManagedServerOverrideCluster } @Test - public void whenContainerSecurityContextConfiguredOnClusterOverrideDomain() { + void whenContainerSecurityContextConfiguredOnClusterOverrideDomain() { configureDomainWithContainerSecurityContext(domain); V1SecurityContext ms2ContainerSecSpec = domain.getServer("any", CLUSTER_NAME).getContainerSecurityContext(); @@ -627,7 +627,7 @@ public void whenContainerSecurityContextConfiguredOnClusterOverrideDomain() { } @Test - public void whenContainerSecurityContextConfiguredOnAdminServerOverrideClusterAndDomain() { + void whenContainerSecurityContextConfiguredOnAdminServerOverrideClusterAndDomain() { configureDomainWithContainerSecurityContext(domain); V1SecurityContext asContainerSecSpec = domain.getAdminServerSpec().getContainerSecurityContext(); @@ -684,7 +684,7 @@ private void configureDomainWithContainerSecurityContext(Domain domain) { } @Test - public void whenDomainsHaveDifferentClusters_objectsAreNotEqual() { + void whenDomainsHaveDifferentClusters_objectsAreNotEqual() { Domain domain1 = createDomain(); configureDomain(domain).configureCluster("cls1").withReplicas(2); @@ -694,7 +694,7 @@ public void whenDomainsHaveDifferentClusters_objectsAreNotEqual() { } @Test - public void whenDomainReadFromYaml_unconfiguredServerHasDomainDefaults() throws IOException { + void whenDomainReadFromYaml_unconfiguredServerHasDomainDefaults() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); ServerSpec serverSpec = domain.getServer("server0", null); @@ -712,35 +712,35 @@ public void whenDomainReadFromYaml_unconfiguredServerHasDomainDefaults() throws } @Test - public void whenDomainReadFromYamlWithNoSetting_defaultsToDomainHomeInImage() throws IOException { + void whenDomainReadFromYamlWithNoSetting_defaultsToDomainHomeInImage() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); assertThat(domain.getDomainHomeSourceType(), equalTo(DomainSourceType.Image)); } @Test - public void whenDomainReadFromYaml_domainHomeInImageIsDisabled() throws IOException { + void whenDomainReadFromYaml_domainHomeInImageIsDisabled() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); assertThat(domain.getDomainHomeSourceType(), equalTo(DomainSourceType.PersistentVolume)); } @Test - public void whenDomainReadFromYamlWithNoSetting_defaultsToServerOutInPodLog() throws IOException { + void whenDomainReadFromYamlWithNoSetting_defaultsToServerOutInPodLog() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); assertThat(domain.isIncludeServerOutInPodLog(), is(true)); } @Test - public void whenDomainReadFromYaml_serverOutInPodLogIsSet() throws IOException { + void whenDomainReadFromYaml_serverOutInPodLogIsSet() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); assertThat(domain.isIncludeServerOutInPodLog(), is(false)); } @Test - public void whenDomainReadFromYaml_unconfiguredClusteredServerHasDomainDefaults() + void whenDomainReadFromYaml_unconfiguredClusteredServerHasDomainDefaults() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); ServerSpec serverSpec = domain.getServer("server0", "cluster0"); @@ -759,7 +759,7 @@ public void whenDomainReadFromYaml_unconfiguredClusteredServerHasDomainDefaults( } @Test - public void whenDomainReadFromYaml_adminServerOverridesDefaults() throws IOException { + void whenDomainReadFromYaml_adminServerOverridesDefaults() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); ServerSpec serverSpec = domain.getAdminServerSpec(); @@ -767,7 +767,7 @@ public void whenDomainReadFromYaml_adminServerOverridesDefaults() throws IOExcep } @Test - public void whenDomainReadFromYaml_server1OverridesDefaults() throws IOException { + void whenDomainReadFromYaml_server1OverridesDefaults() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); ServerSpec serverSpec = domain.getServer("server1", "cluster1"); @@ -787,7 +787,7 @@ public void whenDomainReadFromYaml_server1OverridesDefaults() throws IOException } @Test - public void whenDomainReadFromYaml_cluster2OverridesDefaults() throws IOException { + void whenDomainReadFromYaml_cluster2OverridesDefaults() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); ServerSpec serverSpec = domain.getServer("server2", "cluster2"); @@ -805,7 +805,7 @@ public void whenDomainReadFromYaml_cluster2OverridesDefaults() throws IOExceptio } @Test - public void whenDomainReadFromYaml_AdminAndManagedOverrideDomainNodeSelectors() + void whenDomainReadFromYaml_AdminAndManagedOverrideDomainNodeSelectors() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); final ServerSpec server1Spec = domain.getServer("server1", null); @@ -819,7 +819,7 @@ public void whenDomainReadFromYaml_AdminAndManagedOverrideDomainNodeSelectors() } @Test - public void whenDomainReadFromYaml_ManagedServerOverrideDomainResourceRequirements() + void whenDomainReadFromYaml_ManagedServerOverrideDomainResourceRequirements() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); final V1ResourceRequirements server1ResReq = domain.getServer("server1", null).getResources(); @@ -841,7 +841,7 @@ public void whenDomainReadFromYaml_ManagedServerOverrideDomainResourceRequiremen } @Test - public void whenDomainReadFromYaml_AdminAndManagedOverrideResourceRequirements() + void whenDomainReadFromYaml_AdminAndManagedOverrideResourceRequirements() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); V1ResourceRequirements asResReq = domain.getAdminServerSpec().getResources(); @@ -861,7 +861,7 @@ public void whenDomainReadFromYaml_AdminAndManagedOverrideResourceRequirements() } @Test - public void whenDomainReadFromYaml_AdminServiceIsDefined() throws IOException { + void whenDomainReadFromYaml_AdminServiceIsDefined() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); AdminService adminService = domain.getAdminServerSpec().getAdminService(); @@ -876,14 +876,14 @@ public void whenDomainReadFromYaml_AdminServiceIsDefined() throws IOException { } @Test - public void whenDomain2ReadFromYaml_unknownClusterUseDefaultReplicaCount() throws IOException { + void whenDomain2ReadFromYaml_unknownClusterUseDefaultReplicaCount() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); assertThat(domain.getReplicaCount("unknown"), equalTo(3)); } @Test - public void whenDomain2ReadFromYaml_unconfiguredClusterUseDefaultReplicaCount() + void whenDomain2ReadFromYaml_unconfiguredClusterUseDefaultReplicaCount() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); @@ -891,7 +891,7 @@ public void whenDomain2ReadFromYaml_unconfiguredClusterUseDefaultReplicaCount() } @Test - public void whenDomain2ReadFromYaml_serverReadsDomainDefaultOfNever() throws IOException { + void whenDomain2ReadFromYaml_serverReadsDomainDefaultOfNever() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); ServerSpec serverSpec = domain.getServer("server2", null); @@ -899,7 +899,7 @@ public void whenDomain2ReadFromYaml_serverReadsDomainDefaultOfNever() throws IOE } @Test - public void whenDomain2ReadFromYaml_serverConfiguresReadinessProbe() throws IOException { + void whenDomain2ReadFromYaml_serverConfiguresReadinessProbe() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); ServerSpec serverSpec = domain.getServer("server2", "cluster1"); @@ -909,7 +909,7 @@ public void whenDomain2ReadFromYaml_serverConfiguresReadinessProbe() throws IOEx } @Test - public void whenDomain2ReadFromYaml_serverConfiguresLivenessProbe() throws IOException { + void whenDomain2ReadFromYaml_serverConfiguresLivenessProbe() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); ServerSpec serverSpec = domain.getServer("server2", "cluster1"); @@ -919,14 +919,14 @@ public void whenDomain2ReadFromYaml_serverConfiguresLivenessProbe() throws IOExc } @Test - public void whenDomain2ReadFromYaml_clusterHasNodeSelector() throws IOException { + void whenDomain2ReadFromYaml_clusterHasNodeSelector() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); ServerSpec serverSpec = domain.getServer(SERVER2, "cluster1"); assertThat(serverSpec.getNodeSelectors(), hasEntry("os", "linux")); } @Test - public void whenDomain2ReadFromYaml_clusterAndManagedServerHaveDifferentNodeSelectors() + void whenDomain2ReadFromYaml_clusterAndManagedServerHaveDifferentNodeSelectors() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); ServerSpec serverSpec = domain.getServer("server2", "cluster1"); @@ -935,7 +935,7 @@ public void whenDomain2ReadFromYaml_clusterAndManagedServerHaveDifferentNodeSele } @Test - public void whenDomain2ReadFromYaml_ManagedServerInheritContainerSecurityContextFromDomain() + void whenDomain2ReadFromYaml_ManagedServerInheritContainerSecurityContextFromDomain() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); @@ -951,7 +951,7 @@ public void whenDomain2ReadFromYaml_ManagedServerInheritContainerSecurityContext } @Test - public void whenDomain2ReadFromYamlTwice_objectsEquals() + void whenDomain2ReadFromYamlTwice_objectsEquals() throws IOException { Domain domain1 = readDomain(DOMAIN_V2_SAMPLE_YAML_2); Domain domain2 = readDomain(DOMAIN_V2_SAMPLE_YAML_2); @@ -960,7 +960,7 @@ public void whenDomain2ReadFromYamlTwice_objectsEquals() } @Test - public void whenDomain2ReadFromYamlTwice_matchingIntrospectionVersionValuesLeaveDomainsEqual() + void whenDomain2ReadFromYamlTwice_matchingIntrospectionVersionValuesLeaveDomainsEqual() throws IOException { Domain domain1 = readDomain(DOMAIN_V2_SAMPLE_YAML_2); Domain domain2 = readDomain(DOMAIN_V2_SAMPLE_YAML_2); @@ -971,7 +971,7 @@ public void whenDomain2ReadFromYamlTwice_matchingIntrospectionVersionValuesLeave } @Test - public void whenDomain2ReadFromYamlTwice_differentIntrospectionVersionValuesLeaveDomainsUnequal() + void whenDomain2ReadFromYamlTwice_differentIntrospectionVersionValuesLeaveDomainsUnequal() throws IOException { Domain domain1 = readDomain(DOMAIN_V2_SAMPLE_YAML_2); Domain domain2 = readDomain(DOMAIN_V2_SAMPLE_YAML_2); @@ -982,7 +982,7 @@ public void whenDomain2ReadFromYamlTwice_differentIntrospectionVersionValuesLeav } @Test - public void whenDomain2ReadFromYaml_ManagedServerInheritContainerSecurityContextFromCluster() + void whenDomain2ReadFromYaml_ManagedServerInheritContainerSecurityContextFromCluster() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); @@ -1000,7 +1000,7 @@ public void whenDomain2ReadFromYaml_ManagedServerInheritContainerSecurityContext } @Test - public void whenDomain2ReadFromYaml_AdminServerInheritContainerSecurityContextFromDomain() + void whenDomain2ReadFromYaml_AdminServerInheritContainerSecurityContextFromDomain() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); @@ -1016,7 +1016,7 @@ public void whenDomain2ReadFromYaml_AdminServerInheritContainerSecurityContextFr } @Test - public void whenDomain2ReadFromYaml_ManagedServerInheritPodSecurityContextFromDomain() + void whenDomain2ReadFromYaml_ManagedServerInheritPodSecurityContextFromDomain() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); V1PodSecurityContext server2PodSecCtx = @@ -1030,7 +1030,7 @@ public void whenDomain2ReadFromYaml_ManagedServerInheritPodSecurityContextFromDo } @Test - public void whenDomain2ReadFromYaml_ManagedServerInheritPodSecurityContextFromCluster() + void whenDomain2ReadFromYaml_ManagedServerInheritPodSecurityContextFromCluster() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); V1PodSecurityContext server1PodSecCtx = @@ -1044,7 +1044,7 @@ public void whenDomain2ReadFromYaml_ManagedServerInheritPodSecurityContextFromCl } @Test - public void whenDomain2ReadFromYaml_AdminServerInheritPodSecurityContextFromDomain() + void whenDomain2ReadFromYaml_AdminServerInheritPodSecurityContextFromDomain() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); V1PodSecurityContext asPodSecCtx = domain.getAdminServerSpec().getPodSecurityContext(); @@ -1057,7 +1057,7 @@ public void whenDomain2ReadFromYaml_AdminServerInheritPodSecurityContextFromDoma } @Test - public void whenDomain2ReadFromYaml_InitContainersAreReadFromServerSpec() throws IOException { + void whenDomain2ReadFromYaml_InitContainersAreReadFromServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); List serverSpecInitContainers = domain.getSpec().getInitContainers(); @@ -1069,7 +1069,7 @@ public void whenDomain2ReadFromYaml_InitContainersAreReadFromServerSpec() throws } @Test - public void whenDomain2ReadFromYaml_InitContainersAreReadFromAdminServerSpec() + void whenDomain2ReadFromYaml_InitContainersAreReadFromAdminServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); @@ -1085,7 +1085,7 @@ public void whenDomain2ReadFromYaml_InitContainersAreReadFromAdminServerSpec() } @Test - public void whenDomain2ReadFromYaml_InitContainersAreReadFromManagedServerSpec() + void whenDomain2ReadFromYaml_InitContainersAreReadFromManagedServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); @@ -1103,7 +1103,7 @@ public void whenDomain2ReadFromYaml_InitContainersAreReadFromManagedServerSpec() } @Test - public void whenDomain2ReadFromYaml_InitContainersAreInheritedFromServerSpec() + void whenDomain2ReadFromYaml_InitContainersAreInheritedFromServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); @@ -1117,7 +1117,7 @@ public void whenDomain2ReadFromYaml_InitContainersAreInheritedFromServerSpec() } @Test - public void whenDomain2ReadFromYaml_InitContainersAreReadFromClusteredServerSpec() + void whenDomain2ReadFromYaml_InitContainersAreReadFromClusteredServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); @@ -1134,7 +1134,7 @@ public void whenDomain2ReadFromYaml_InitContainersAreReadFromClusteredServerSpec } @Test - public void whenDomain2ReadFromYaml_ContainersAreReadFromServerSpec() throws IOException { + void whenDomain2ReadFromYaml_ContainersAreReadFromServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); List serverSpecContainers = domain.getSpec().getContainers(); @@ -1146,7 +1146,7 @@ public void whenDomain2ReadFromYaml_ContainersAreReadFromServerSpec() throws IOE } @Test - public void whenDomain2ReadFromYaml_ContainersAreReadFromAdminServerSpec() throws IOException { + void whenDomain2ReadFromYaml_ContainersAreReadFromAdminServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); List serverSpecContainers = domain.getAdminServerSpec().getContainers(); @@ -1161,7 +1161,7 @@ public void whenDomain2ReadFromYaml_ContainersAreReadFromAdminServerSpec() throw } @Test - public void whenDomain2ReadFromYaml_ContainersAreReadFromManagedServerSpec() throws IOException { + void whenDomain2ReadFromYaml_ContainersAreReadFromManagedServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); List serverSpecContainers = domain.getServer("server1", null).getContainers(); @@ -1176,7 +1176,7 @@ public void whenDomain2ReadFromYaml_ContainersAreReadFromManagedServerSpec() thr } @Test - public void whenDomain2ReadFromYaml_ContainersAreInheritedFromServerSpec() throws IOException { + void whenDomain2ReadFromYaml_ContainersAreInheritedFromServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); List serverSpecContainers = domain.getServer("server2", null).getContainers(); @@ -1188,7 +1188,7 @@ public void whenDomain2ReadFromYaml_ContainersAreInheritedFromServerSpec() throw } @Test - public void whenDomain2ReadFromYaml_ContainersAreReadFromClusteredServerSpec() + void whenDomain2ReadFromYaml_ContainersAreReadFromClusteredServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); @@ -1204,7 +1204,7 @@ public void whenDomain2ReadFromYaml_ContainersAreReadFromClusteredServerSpec() } @Test - public void whenDomain2ReadFromYaml_ShutdownIsReadFromSpec() throws IOException { + void whenDomain2ReadFromYaml_ShutdownIsReadFromSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); Shutdown shutdown = domain.getSpec().getShutdown(); @@ -1213,7 +1213,7 @@ public void whenDomain2ReadFromYaml_ShutdownIsReadFromSpec() throws IOException } @Test - public void whenDomain2ReadFromYaml_ShutdownIsReadFromClusterSpec() throws IOException { + void whenDomain2ReadFromYaml_ShutdownIsReadFromClusterSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); Shutdown shutdown = domain.getCluster("cluster2").getShutdown(); @@ -1223,7 +1223,7 @@ public void whenDomain2ReadFromYaml_ShutdownIsReadFromClusterSpec() throws IOExc } @Test - public void whenDomain2ReadFromYaml_ShutdownIsReadFromServerSpec() throws IOException { + void whenDomain2ReadFromYaml_ShutdownIsReadFromServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); Shutdown shutdown = domain.getServer("server2", "cluster2").getShutdown(); @@ -1233,7 +1233,7 @@ public void whenDomain2ReadFromYaml_ShutdownIsReadFromServerSpec() throws IOExce } @Test - public void whenDomain2ReadFromYaml_RestartPolicyIsReadFromSpec() throws IOException { + void whenDomain2ReadFromYaml_RestartPolicyIsReadFromSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_5); String restartPolicy = domain.getSpec().getRestartPolicy(); @@ -1241,7 +1241,7 @@ public void whenDomain2ReadFromYaml_RestartPolicyIsReadFromSpec() throws IOExcep } @Test - public void whenDomain2ReadFromYaml_RestartPolicyIsReadFromClusterSpec() throws IOException { + void whenDomain2ReadFromYaml_RestartPolicyIsReadFromClusterSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_5); String restartPolicy = domain.getCluster("cluster2").getRestartPolicy(); @@ -1249,7 +1249,7 @@ public void whenDomain2ReadFromYaml_RestartPolicyIsReadFromClusterSpec() throws } @Test - public void whenDomain2ReadFromYaml_RuntimeClassNameIsReadFromSpec() throws IOException { + void whenDomain2ReadFromYaml_RuntimeClassNameIsReadFromSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_5); String runtimeClassName = domain.getSpec().getRuntimeClassName(); @@ -1257,7 +1257,7 @@ public void whenDomain2ReadFromYaml_RuntimeClassNameIsReadFromSpec() throws IOEx } @Test - public void whenDomain2ReadFromYaml_RuntimeClassNameIsReadFromClusterSpec() throws IOException { + void whenDomain2ReadFromYaml_RuntimeClassNameIsReadFromClusterSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_5); String runtimeClassName = domain.getCluster("cluster2").getRuntimeClassName(); @@ -1265,7 +1265,7 @@ public void whenDomain2ReadFromYaml_RuntimeClassNameIsReadFromClusterSpec() thro } @Test - public void whenDomain2ReadFromYaml_SchedulerNameIsReadFromSpec() throws IOException { + void whenDomain2ReadFromYaml_SchedulerNameIsReadFromSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_5); String schedulerName = domain.getSpec().getSchedulerName(); @@ -1273,7 +1273,7 @@ public void whenDomain2ReadFromYaml_SchedulerNameIsReadFromSpec() throws IOExcep } @Test - public void whenDomain2ReadFromYaml_SchedulerClassNameIsReadFromClusterSpec() throws IOException { + void whenDomain2ReadFromYaml_SchedulerClassNameIsReadFromClusterSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_5); String schedulerName = domain.getCluster("cluster2").getSchedulerName(); @@ -1281,7 +1281,7 @@ public void whenDomain2ReadFromYaml_SchedulerClassNameIsReadFromClusterSpec() th } @Test - public void whenDomain2ReadFromYaml_sessionAffinityIsReadFromClusteredServerSpec() + void whenDomain2ReadFromYaml_sessionAffinityIsReadFromClusteredServerSpec() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); @@ -1290,7 +1290,7 @@ public void whenDomain2ReadFromYaml_sessionAffinityIsReadFromClusteredServerSpec } @Test - public void whenDomain2ReadFromYaml_sessionAffinityIsNotPresent() + void whenDomain2ReadFromYaml_sessionAffinityIsNotPresent() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); @@ -1299,27 +1299,27 @@ public void whenDomain2ReadFromYaml_sessionAffinityIsNotPresent() } @Test - public void whenDomain2ReadFromYaml_serviceAnnotationsFound() throws IOException { + void whenDomain2ReadFromYaml_serviceAnnotationsFound() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); ServerSpec serverSpec = domain.getServer("server2", "cluster1"); assertThat(serverSpec.getServiceAnnotations(), hasEntry("testKey3", "testValue3")); } @Test - public void whenDomain3ReadFromYaml_hasExportedNaps() throws IOException { + void whenDomain3ReadFromYaml_hasExportedNaps() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_3); assertThat(domain.getAdminServerChannelNames(), containsInAnyOrder("channelA", "channelB")); } @Test - public void whenDomain3ReadFromYaml_adminServerHasNodeSelector() throws IOException { + void whenDomain3ReadFromYaml_adminServerHasNodeSelector() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_3); assertThat(domain.getAdminServerSpec().getNodeSelectors(), hasEntry("os", "linux")); } @Test - public void whenDomain3ReadFromYaml_adminServerHasAnnotationsAndLabels() throws IOException { + void whenDomain3ReadFromYaml_adminServerHasAnnotationsAndLabels() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_3); assertThat( domain.getAdminServerSpec().getServiceAnnotations(), hasEntry("testKey3", "testValue3")); @@ -1328,13 +1328,13 @@ public void whenDomain3ReadFromYaml_adminServerHasAnnotationsAndLabels() throws } @Test - public void whenDomain3ReadFromYaml_AdminServerRestartVersion() throws IOException { + void whenDomain3ReadFromYaml_AdminServerRestartVersion() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_3); assertThat(domain.getAdminServerSpec().getServerRestartVersion(), is("1")); } @Test - public void whenDomain3ReadFromYaml_NoRestartVersion() throws IOException { + void whenDomain3ReadFromYaml_NoRestartVersion() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_3); final ServerSpec clusteredServer = domain.getServer("anyServer", "anyCluster"); final ServerSpec nonClusteredServer = domain.getServer("anyServer", null); @@ -1347,7 +1347,7 @@ public void whenDomain3ReadFromYaml_NoRestartVersion() throws IOException { } @Test - public void whenDomainReadFromYaml_DomainRestartVersion() throws IOException { + void whenDomainReadFromYaml_DomainRestartVersion() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); assertThat(domain.getAdminServerSpec().getDomainRestartVersion(), is("1")); assertThat(domain.getAdminServerSpec().getClusterRestartVersion(), nullValue()); @@ -1355,7 +1355,7 @@ public void whenDomainReadFromYaml_DomainRestartVersion() throws IOException { } @Test - public void whenDomainReadFromYaml_ClusterRestartVersion() throws IOException { + void whenDomainReadFromYaml_ClusterRestartVersion() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); ServerSpec serverSpec = domain.getServer("server1", "cluster2"); @@ -1365,7 +1365,7 @@ public void whenDomainReadFromYaml_ClusterRestartVersion() throws IOException { } @Test - public void whenDomainReadFromYaml_ServerRestartVersion() throws IOException { + void whenDomainReadFromYaml_ServerRestartVersion() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); ServerSpec serverSpec = domain.getServer("server2", null); @@ -1375,13 +1375,13 @@ public void whenDomainReadFromYaml_ServerRestartVersion() throws IOException { } @Test - public void whenDomainReadFromYaml_livenessCustomScriptMatches() throws IOException { + void whenDomainReadFromYaml_livenessCustomScriptMatches() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML); assertThat(domain.getLivenessProbeCustomScript(), is(LIVENESS_PROBE_CUSTOM_SCRIPT)); } @Test - public void whenVolumesConfiguredOnMultipleLevels_useCombination() { + void whenVolumesConfiguredOnMultipleLevels_useCombination() { configureDomain(domain) .withAdditionalVolume("name1", "/domain-tmp1") .withAdditionalVolume("name2", "/domain-tmp2"); @@ -1403,7 +1403,7 @@ public void whenVolumesConfiguredOnMultipleLevels_useCombination() { } @Test - public void whenVolumeMountsConfiguredOnMultipleLevels_useCombination() { + void whenVolumeMountsConfiguredOnMultipleLevels_useCombination() { configureDomain(domain) .withAdditionalVolumeMount("name1", "/domain-test1") .withAdditionalVolumeMount("name2", "/domain-test2"); @@ -1425,7 +1425,7 @@ public void whenVolumeMountsConfiguredOnMultipleLevels_useCombination() { } @Test - public void whenDuplicateVolumesConfiguredOnMultipleLevels_useCombination() { + void whenDuplicateVolumesConfiguredOnMultipleLevels_useCombination() { configureDomain(domain) .withAdditionalVolume("name1", "/domain-tmp1") .withAdditionalVolume("name2", "/domain-tmp2") @@ -1444,7 +1444,7 @@ public void whenDuplicateVolumesConfiguredOnMultipleLevels_useCombination() { } @Test - public void whenDuplicateVolumeMountsConfiguredOnMultipleLevels_useCombination() { + void whenDuplicateVolumeMountsConfiguredOnMultipleLevels_useCombination() { configureDomain(domain) .withAdditionalVolumeMount("name1", "/domain-test1") .withAdditionalVolumeMount("name2", "/domain-test2") @@ -1463,70 +1463,70 @@ public void whenDuplicateVolumeMountsConfiguredOnMultipleLevels_useCombination() } @Test - public void whenDomainHomeInImageSpecified_useValue() { + void whenDomainHomeInImageSpecified_useValue() { configureDomain(domain).withDomainHomeInImage(false); assertThat(domain.getSpec().isDomainHomeInImage(), is(false)); } @Test - public void whenLogHomeNotSet_useDefault() { + void whenLogHomeNotSet_useDefault() { configureDomain(domain); assertThat(domain.getLogHome(), equalTo("/shared/logs/uid1")); } @Test - public void whenLogHomeSet_useValue() { + void whenLogHomeSet_useValue() { configureDomain(domain).withLogHome("/custom/logs/"); assertThat(domain.getLogHome(), equalTo("/custom/logs/")); } @Test - public void whenLogHomeEnabledSet_useValue() { + void whenLogHomeEnabledSet_useValue() { configureDomain(domain).withLogHomeEnabled(true); assertThat(domain.getSpec().isLogHomeEnabled(), is(true)); } @Test - public void whenLivenessProbeCustomScriptSet_useValue() { + void whenLivenessProbeCustomScriptSet_useValue() { configureDomain(domain).withLivenessProbeCustomScript(LIVENESS_PROBE_CUSTOM_SCRIPT); assertThat(domain.getLivenessProbeCustomScript(), equalTo(LIVENESS_PROBE_CUSTOM_SCRIPT)); } @Test - public void domainHomeTest_standardHome1() { + void domainHomeTest_standardHome1() { configureDomain(domain).withDomainHomeSourceType(FromModel); assertThat(domain.getDomainHome(), equalTo("/u01/domains/uid1")); } @Test - public void domainHomeTest_standardHome2() { + void domainHomeTest_standardHome2() { configureDomain(domain).withDomainHomeInImage(false); assertThat(domain.getDomainHome(), equalTo("/shared/domains/uid1")); } @Test - public void domainHomeTest_standardHome3() { + void domainHomeTest_standardHome3() { configureDomain(domain).withDomainHomeInImage(true); assertThat(domain.getDomainHome(), equalTo("/u01/oracle/user_projects/domains")); } @Test - public void domainHomeTest_customHome1() { + void domainHomeTest_customHome1() { configureDomain(domain).withDomainHome("/custom/domain/home"); assertThat(domain.getDomainHome(), equalTo("/custom/domain/home")); } @Test - public void whenPodLabelsAppliedOnMultipleLevels_useCombination() { + void whenPodLabelsAppliedOnMultipleLevels_useCombination() { configureDomain(domain) .withPodLabel("label1", "domain-label-value1") .withPodLabel("label2", "domain-label-value2"); @@ -1553,7 +1553,7 @@ public void whenPodLabelsAppliedOnMultipleLevels_useCombination() { } @Test - public void whenPodAnnotationsAppliedOnMultipleLevels_useCombination() { + void whenPodAnnotationsAppliedOnMultipleLevels_useCombination() { configureDomain(domain) .withPodAnnotation("annotation1", "domain-annotation-value1") .withPodAnnotation("annotation2", "domain-annotation-value2"); @@ -1580,7 +1580,7 @@ public void whenPodAnnotationsAppliedOnMultipleLevels_useCombination() { } @Test - public void whenDuplicatePodLabelsConfiguredOnMultipleLevels_useCombination() { + void whenDuplicatePodLabelsConfiguredOnMultipleLevels_useCombination() { configureDomain(domain) .withPodLabel("label1", "domain-label-value1") .withPodLabel("label2", "domain-label-value2"); @@ -1602,7 +1602,7 @@ public void whenDuplicatePodLabelsConfiguredOnMultipleLevels_useCombination() { } @Test - public void whenDuplicatePodAnnotationsConfiguredOnMultipleLevels_useCombination() { + void whenDuplicatePodAnnotationsConfiguredOnMultipleLevels_useCombination() { configureDomain(domain) .withPodAnnotation("annotation1", "domain-annotation-value1") .withPodAnnotation("annotation2", "domain-annotation-value2"); @@ -1631,21 +1631,21 @@ private V1VolumeMount volumeMount(String name, String path) { } @Test - public void whenNoDistributionStrategySpecified_defaultToDynamic() throws IOException { + void whenNoDistributionStrategySpecified_defaultToDynamic() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_2); assertThat(domain.getOverrideDistributionStrategy(), equalTo(OverrideDistributionStrategy.DYNAMIC)); } @Test - public void whenDistributionStrategySpecified_readIt() throws IOException { + void whenDistributionStrategySpecified_readIt() throws IOException { Domain domain = readDomain(DOMAIN_V2_SAMPLE_YAML_4); assertThat(domain.getOverrideDistributionStrategy(), equalTo(OverrideDistributionStrategy.ON_RESTART)); } @Test - public void whenDistributionStrategyConfigured_returnIt() { + void whenDistributionStrategyConfigured_returnIt() { configureDomain(domain).withConfigOverrideDistributionStrategy(OverrideDistributionStrategy.ON_RESTART); assertThat(domain.getOverrideDistributionStrategy(), equalTo(OverrideDistributionStrategy.ON_RESTART)); diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainValidationTest.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainValidationTest.java index 7e78519c64b..ae2ebfe23d0 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainValidationTest.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/DomainValidationTest.java @@ -28,7 +28,6 @@ import static oracle.kubernetes.operator.DomainSourceType.FromModel; import static oracle.kubernetes.operator.DomainSourceType.Image; import static oracle.kubernetes.operator.ProcessingConstants.DOMAIN_TOPOLOGY; -import static oracle.kubernetes.operator.helpers.DomainIntrospectorJobTest.TEST_VOLUME_NAME; import static oracle.kubernetes.operator.helpers.PodHelperTestBase.getAuxiliaryImage; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.empty; @@ -38,7 +37,7 @@ import static org.hamcrest.Matchers.stringContainsInOrder; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class DomainValidationTest extends DomainValidationBaseTest { +class DomainValidationTest extends DomainValidationBaseTest { private static final String ENV_NAME1 = "MY_ENV"; private static final String RAW_VALUE_1 = "123"; @@ -47,6 +46,7 @@ public class DomainValidationTest extends DomainValidationBaseTest { private static final String BAD_MOUNT_PATH_1 = "$DOMAIN_HOME/servers/$SERVER_NAME"; private static final String BAD_MOUNT_PATH_2 = "$(DOMAIN_HOME/servers/$(SERVER_NAME"; private static final String BAD_MOUNT_PATH_3 = "$()DOMAIN_HOME/servers/SERVER_NAME"; + public static final String TEST_VOLUME_NAME = "test"; public static final String WRONG_VOLUME_NAME = "BadVolume"; private final Domain domain = createTestDomain(); @@ -86,7 +86,7 @@ public void tearDown() { } @Test - public void whenManagerServerSpecsHaveUniqueNames_dontReportError() { + void whenManagerServerSpecsHaveUniqueNames_dontReportError() { domain.getSpec().getManagedServers().add(new ManagedServer().withServerName("ms1")); domain.getSpec().getManagedServers().add(new ManagedServer().withServerName("ms2")); @@ -94,7 +94,7 @@ public void whenManagerServerSpecsHaveUniqueNames_dontReportError() { } @Test - public void whenManagerServerSpecsHaveDuplicateNames_reportError() { + void whenManagerServerSpecsHaveDuplicateNames_reportError() { domain.getSpec().getManagedServers().add(new ManagedServer().withServerName("ms1")); domain.getSpec().getManagedServers().add(new ManagedServer().withServerName("ms1")); @@ -103,7 +103,7 @@ public void whenManagerServerSpecsHaveDuplicateNames_reportError() { } @Test - public void whenManagerServerSpecsHaveDns1123DuplicateNames_reportError() { + void whenManagerServerSpecsHaveDns1123DuplicateNames_reportError() { domain.getSpec().getManagedServers().add(new ManagedServer().withServerName("Server-1")); domain.getSpec().getManagedServers().add(new ManagedServer().withServerName("server_1")); @@ -112,7 +112,7 @@ public void whenManagerServerSpecsHaveDns1123DuplicateNames_reportError() { } @Test - public void whenDomainConfiguredWithAuxiliaryImageButNoAuxiliaryImageVolumes_reportError() { + void whenDomainConfiguredWithAuxiliaryImageButNoAuxiliaryImageVolumes_reportError() { configureDomain(domain) .withAuxiliaryImages(Collections.singletonList(getAuxiliaryImage("wdt-image:v1"))); @@ -122,7 +122,7 @@ public void whenDomainConfiguredWithAuxiliaryImageButNoAuxiliaryImageVolumes_rep } @Test - public void whenDomainConfiguredWithAuxiliaryImageButNoMatchingAuxiliaryImageVolumes_reportError() { + void whenDomainConfiguredWithAuxiliaryImageButNoMatchingAuxiliaryImageVolumes_reportError() { configureDomain(domain) .withAuxiliaryImageVolumes(Collections.singletonList(new AuxiliaryImageVolume().name(WRONG_VOLUME_NAME))) .withAuxiliaryImages(Collections.singletonList(getAuxiliaryImage("wdt-image:v1"))); @@ -133,7 +133,7 @@ public void whenDomainConfiguredWithAuxiliaryImageButNoMatchingAuxiliaryImageVol } @Test - public void whenDomainConfiguredWithAuxiliaryImageButNoVolumeName_reportError() { + void whenDomainConfiguredWithAuxiliaryImageButNoVolumeName_reportError() { configureDomain(domain) .withAuxiliaryImageVolumes(Collections.singletonList(new AuxiliaryImageVolume().name(TEST_VOLUME_NAME))) .withAuxiliaryImages(Collections.singletonList(new AuxiliaryImage().image("wdt-image:v1"))); @@ -143,7 +143,7 @@ public void whenDomainConfiguredWithAuxiliaryImageButNoVolumeName_reportError() } @Test - public void whenDomainConfiguredWithAuxiliaryImageAndMatchingAuxiliaryImageVolumes_noErrorsReported() { + void whenDomainConfiguredWithAuxiliaryImageAndMatchingAuxiliaryImageVolumes_noErrorsReported() { configureDomain(domain) .withAuxiliaryImageVolumes(Collections.singletonList(new AuxiliaryImageVolume().name(TEST_VOLUME_NAME))) .withAuxiliaryImages(Collections.singletonList(getAuxiliaryImage("wdt-image:v1"))); @@ -153,7 +153,7 @@ public void whenDomainConfiguredWithAuxiliaryImageAndMatchingAuxiliaryImageVolum } @Test - public void whenDomainConfiguredWithAuxiliaryImageVolumesWithNullName_reportError() { + void whenDomainConfiguredWithAuxiliaryImageVolumesWithNullName_reportError() { configureDomain(domain) .withAuxiliaryImageVolumes(Collections.singletonList(new AuxiliaryImageVolume())); @@ -163,7 +163,7 @@ public void whenDomainConfiguredWithAuxiliaryImageVolumesWithNullName_reportErro } @Test - public void whenDomainConfiguredWithAuxiliaryImageVolumesWithSameMountPath_reportError() { + void whenDomainConfiguredWithAuxiliaryImageVolumesWithSameMountPath_reportError() { List auxiliaryImageVolumes = new ArrayList<>(); auxiliaryImageVolumes.add(new AuxiliaryImageVolume().name("TestVolume").mountPath("/shared")); auxiliaryImageVolumes.add(new AuxiliaryImageVolume().name("TestVolume").mountPath("/shared")); @@ -175,7 +175,7 @@ public void whenDomainConfiguredWithAuxiliaryImageVolumesWithSameMountPath_repor } @Test - public void whenDomainConfiguredWithAuxiliaryImageVolumesWithSameName_reportError() { + void whenDomainConfiguredWithAuxiliaryImageVolumesWithSameName_reportError() { List auxiliaryImageVolumes = new ArrayList<>(); auxiliaryImageVolumes.add(new AuxiliaryImageVolume().name(TEST_VOLUME_NAME)); auxiliaryImageVolumes.add(new AuxiliaryImageVolume().name(TEST_VOLUME_NAME).mountPath("/common1")); @@ -188,7 +188,7 @@ public void whenDomainConfiguredWithAuxiliaryImageVolumesWithSameName_reportErro } @Test - public void whenClusterSpecsHaveUniqueNames_dontReportError() { + void whenClusterSpecsHaveUniqueNames_dontReportError() { domain.getSpec().getClusters().add(new Cluster().withClusterName("cluster1")); domain.getSpec().getClusters().add(new Cluster().withClusterName("cluster2")); @@ -196,7 +196,7 @@ public void whenClusterSpecsHaveUniqueNames_dontReportError() { } @Test - public void whenClusterSpecsHaveDuplicateNames_reportError() { + void whenClusterSpecsHaveDuplicateNames_reportError() { domain.getSpec().getClusters().add(new Cluster().withClusterName("cluster1")); domain.getSpec().getClusters().add(new Cluster().withClusterName("cluster1")); @@ -205,7 +205,7 @@ public void whenClusterSpecsHaveDuplicateNames_reportError() { } @Test - public void whenClusterSpecsHaveDns1123DuplicateNames_reportError() { + void whenClusterSpecsHaveDns1123DuplicateNames_reportError() { domain.getSpec().getClusters().add(new Cluster().withClusterName("Cluster-1")); domain.getSpec().getClusters().add(new Cluster().withClusterName("cluster_1")); @@ -214,14 +214,14 @@ public void whenClusterSpecsHaveDns1123DuplicateNames_reportError() { } @Test - public void whenLogHomeDisabled_dontReportError() { + void whenLogHomeDisabled_dontReportError() { configureDomain(domain).withLogHomeEnabled(false); assertThat(domain.getValidationFailures(resourceLookup), empty()); } @Test - public void whenVolumeMountHasNonValidPath_reportError() { + void whenVolumeMountHasNonValidPath_reportError() { configureDomain(domain).withAdditionalVolumeMount("sharedlogs", "shared/logs"); assertThat(domain.getValidationFailures(resourceLookup), @@ -229,7 +229,7 @@ public void whenVolumeMountHasNonValidPath_reportError() { } @Test - public void whenVolumeMountHasLogHomeDirectory_dontReportError() { + void whenVolumeMountHasLogHomeDirectory_dontReportError() { configureDomain(domain).withLogHomeEnabled(true).withLogHome("/shared/logs/mydomain"); configureDomain(domain).withAdditionalVolumeMount("sharedlogs", "/shared/logs"); @@ -237,7 +237,7 @@ public void whenVolumeMountHasLogHomeDirectory_dontReportError() { } @Test - public void whenNoVolumeMountHasSpecifiedLogHomeDirectory_reportError() { + void whenNoVolumeMountHasSpecifiedLogHomeDirectory_reportError() { configureDomain(domain).withLogHomeEnabled(true).withLogHome("/private/log/mydomain"); configureDomain(domain).withAdditionalVolumeMount("sharedlogs", "/shared/logs"); @@ -246,7 +246,7 @@ public void whenNoVolumeMountHasSpecifiedLogHomeDirectory_reportError() { } @Test - public void whenNoVolumeMountHasImplicitLogHomeDirectory_reportError() { + void whenNoVolumeMountHasImplicitLogHomeDirectory_reportError() { configureDomain(domain).withLogHomeEnabled(true); assertThat(domain.getValidationFailures(resourceLookup), @@ -254,7 +254,7 @@ public void whenNoVolumeMountHasImplicitLogHomeDirectory_reportError() { } @Test - public void whenDomainHasAdditionalVolumeMountsWithInvalidChar_1_reportError() { + void whenDomainHasAdditionalVolumeMountsWithInvalidChar_1_reportError() { configureDomain(domain) .withAdditionalVolumeMount("volume1", BAD_MOUNT_PATH_1); @@ -264,7 +264,7 @@ public void whenDomainHasAdditionalVolumeMountsWithInvalidChar_1_reportError() { } @Test - public void whenDomainHasAdditionalVolumeMountsWithInvalidChar_2_reportError() { + void whenDomainHasAdditionalVolumeMountsWithInvalidChar_2_reportError() { configureDomain(domain) .withAdditionalVolumeMount("volume2", BAD_MOUNT_PATH_2); @@ -274,7 +274,7 @@ public void whenDomainHasAdditionalVolumeMountsWithInvalidChar_2_reportError() { } @Test - public void whenDomainHasAdditionalVolumeMountsWithInvalidChar_3_reportError() { + void whenDomainHasAdditionalVolumeMountsWithInvalidChar_3_reportError() { configureDomain(domain) .withAdditionalVolumeMount("volume3", BAD_MOUNT_PATH_3); @@ -284,7 +284,7 @@ public void whenDomainHasAdditionalVolumeMountsWithInvalidChar_3_reportError() { } @Test - public void whenDomainHasAdditionalVolumeMountsWithReservedVariables_dontReportError() { + void whenDomainHasAdditionalVolumeMountsWithReservedVariables_dontReportError() { configureDomain(domain) .withAdditionalVolumeMount("volume1", RAW_MOUNT_PATH_1); @@ -292,7 +292,7 @@ public void whenDomainHasAdditionalVolumeMountsWithReservedVariables_dontReportE } @Test - public void whenDomainHasAdditionalVolumeMountsWithCustomVariables_dontReportError() { + void whenDomainHasAdditionalVolumeMountsWithCustomVariables_dontReportError() { configureDomain(domain) .withEnvironmentVariable(ENV_NAME1, RAW_VALUE_1) .withAdditionalVolumeMount("volume1", RAW_MOUNT_PATH_2); @@ -301,7 +301,7 @@ public void whenDomainHasAdditionalVolumeMountsWithCustomVariables_dontReportErr } @Test - public void whenDomainHasAdditionalVolumeMountsWithNonExistingVariables_reportError() { + void whenDomainHasAdditionalVolumeMountsWithNonExistingVariables_reportError() { configureDomain(domain) .withAdditionalVolumeMount("volume1", RAW_MOUNT_PATH_2); @@ -311,7 +311,7 @@ public void whenDomainHasAdditionalVolumeMountsWithNonExistingVariables_reportEr } @Test - public void whenDomainAdminServerHasAdditionalVolumeMountsWithInvalidChar_reportError() { + void whenDomainAdminServerHasAdditionalVolumeMountsWithInvalidChar_reportError() { configureDomain(domain) .configureAdminServer() .getAdminServer() @@ -323,7 +323,7 @@ public void whenDomainAdminServerHasAdditionalVolumeMountsWithInvalidChar_report } @Test - public void whenDomainAdminServerHasAdditionalVolumeMountsWithReservedVariables_dontReportError() { + void whenDomainAdminServerHasAdditionalVolumeMountsWithReservedVariables_dontReportError() { configureDomain(domain) .configureAdminServer() .getAdminServer() @@ -333,7 +333,7 @@ public void whenDomainAdminServerHasAdditionalVolumeMountsWithReservedVariables_ } @Test - public void whenDomainAdminServerHasAdditionalVolumeMountsWithCustomVariables_dontReportError() { + void whenDomainAdminServerHasAdditionalVolumeMountsWithCustomVariables_dontReportError() { configureDomain(domain) .withEnvironmentVariable(ENV_NAME1, RAW_VALUE_1) .configureAdminServer() @@ -344,7 +344,7 @@ public void whenDomainAdminServerHasAdditionalVolumeMountsWithCustomVariables_do } @Test - public void whenDomainAdminServerHasAdditionalVolumeMountsWithNonExistingVariables_reportError() { + void whenDomainAdminServerHasAdditionalVolumeMountsWithNonExistingVariables_reportError() { configureDomain(domain) .configureAdminServer() .getAdminServer() @@ -355,7 +355,7 @@ public void whenDomainAdminServerHasAdditionalVolumeMountsWithNonExistingVariabl } @Test - public void whenClusterServerPodHasAdditionalVolumeMountsWithInvalidChar_reportError() { + void whenClusterServerPodHasAdditionalVolumeMountsWithInvalidChar_reportError() { configureDomain(domain) .configureCluster("Cluster-1").withAdditionalVolumeMount("volume1", BAD_MOUNT_PATH_1); @@ -364,7 +364,7 @@ public void whenClusterServerPodHasAdditionalVolumeMountsWithInvalidChar_reportE } @Test - public void whenClusterServerPodHasAdditionalVolumeMountsWithReservedVariables_dontReportError() { + void whenClusterServerPodHasAdditionalVolumeMountsWithReservedVariables_dontReportError() { configureDomain(domain) .configureCluster("Cluster-1").withAdditionalVolumeMount("volume1", RAW_MOUNT_PATH_1); @@ -372,7 +372,7 @@ public void whenClusterServerPodHasAdditionalVolumeMountsWithReservedVariables_d } @Test - public void whenClusterServerPodHasAdditionalVolumeMountsWithCustomVariables_dontReportError() { + void whenClusterServerPodHasAdditionalVolumeMountsWithCustomVariables_dontReportError() { configureDomain(domain) .withEnvironmentVariable(ENV_NAME1, RAW_VALUE_1) .configureCluster("Cluster-1").withAdditionalVolumeMount("volume1", RAW_MOUNT_PATH_2); @@ -381,7 +381,7 @@ public void whenClusterServerPodHasAdditionalVolumeMountsWithCustomVariables_don } @Test - public void whenClusterServerPodHasAdditionalVolumeMountsWithNonExistingVariables_reportError() { + void whenClusterServerPodHasAdditionalVolumeMountsWithNonExistingVariables_reportError() { configureDomain(domain) .configureCluster("Cluster-1").withAdditionalVolumeMount("volume1", RAW_MOUNT_PATH_2); @@ -390,14 +390,14 @@ public void whenClusterServerPodHasAdditionalVolumeMountsWithNonExistingVariable } @Test - public void whenNonReservedEnvironmentVariableSpecifiedAtDomainLevel_dontReportError() { + void whenNonReservedEnvironmentVariableSpecifiedAtDomainLevel_dontReportError() { configureDomain(domain).withEnvironmentVariable("testname", "testValue"); assertThat(domain.getValidationFailures(resourceLookup), empty()); } @Test - public void whenReservedEnvironmentVariablesSpecifiedAtDomainLevel_reportError() { + void whenReservedEnvironmentVariablesSpecifiedAtDomainLevel_reportError() { configureDomain(domain) .withEnvironmentVariable("ADMIN_NAME", "testValue") .withEnvironmentVariable("INTROSPECT_HOME", "/shared/home/introspection"); @@ -407,7 +407,7 @@ public void whenReservedEnvironmentVariablesSpecifiedAtDomainLevel_reportError() } @Test - public void whenReservedEnvironmentVariablesSpecifiedForAdminServer_reportError() { + void whenReservedEnvironmentVariablesSpecifiedForAdminServer_reportError() { configureDomain(domain) .configureAdminServer() .withEnvironmentVariable("LOG_HOME", "testValue") @@ -418,7 +418,7 @@ public void whenReservedEnvironmentVariablesSpecifiedForAdminServer_reportError( } @Test - public void whenReservedEnvironmentVariablesSpecifiedAtServerLevel_reportError() { + void whenReservedEnvironmentVariablesSpecifiedAtServerLevel_reportError() { configureDomain(domain) .configureServer("ms1") .withEnvironmentVariable("SERVER_NAME", "testValue"); @@ -428,7 +428,7 @@ public void whenReservedEnvironmentVariablesSpecifiedAtServerLevel_reportError() } @Test - public void whenReservedEnvironmentVariablesSpecifiedAtClusterLevel_reportError() { + void whenReservedEnvironmentVariablesSpecifiedAtClusterLevel_reportError() { configureDomain(domain) .configureCluster("cluster1") .withEnvironmentVariable("DOMAIN_HOME", "testValue"); @@ -438,12 +438,12 @@ public void whenReservedEnvironmentVariablesSpecifiedAtClusterLevel_reportError( } @Test - public void whenWebLogicCredentialsSecretNameFound_dontReportError() { + void whenWebLogicCredentialsSecretNameFound_dontReportError() { assertThat(domain.getValidationFailures(resourceLookup), empty()); } @Test - public void whenWebLogicCredentialsSecretNameFoundWithExplicitNamespace_dontReportError() { + void whenWebLogicCredentialsSecretNameFoundWithExplicitNamespace_dontReportError() { configureDomain(domain) .withWebLogicCredentialsSecret(SECRET_NAME, NS); @@ -451,7 +451,7 @@ public void whenWebLogicCredentialsSecretNameFoundWithExplicitNamespace_dontRepo } @Test - public void whenWebLogicCredentialsSecretNamespaceUndefined_useDomainNamespace() { + void whenWebLogicCredentialsSecretNamespaceUndefined_useDomainNamespace() { configureDomain(domain) .withWebLogicCredentialsSecret(SECRET_NAME, null); @@ -459,7 +459,7 @@ public void whenWebLogicCredentialsSecretNamespaceUndefined_useDomainNamespace() } @Test - public void whenWebLogicCredentialsSecretNameNotFound_reportError() { + void whenWebLogicCredentialsSecretNameNotFound_reportError() { resourceLookup.undefineResource(SECRET_NAME, KubernetesResourceType.Secret, NS); assertThat(domain.getValidationFailures(resourceLookup), @@ -467,7 +467,7 @@ public void whenWebLogicCredentialsSecretNameNotFound_reportError() { } @Test - public void whenBadWebLogicCredentialsSecretNamespaceSpecified_reportError() { + void whenBadWebLogicCredentialsSecretNamespaceSpecified_reportError() { resourceLookup.defineResource(SECRET_NAME, KubernetesResourceType.Secret, "badNamespace"); configureDomain(domain) .withWebLogicCredentialsSecret(SECRET_NAME, "badNamespace"); @@ -477,7 +477,7 @@ public void whenBadWebLogicCredentialsSecretNamespaceSpecified_reportError() { } @Test - public void whenImagePullSecretSpecifiedButDoesNotExist_reportError() { + void whenImagePullSecretSpecifiedButDoesNotExist_reportError() { configureDomain(domain).withDefaultImagePullSecret(new V1LocalObjectReference().name("no-such-secret")); assertThat(domain.getValidationFailures(resourceLookup), @@ -486,7 +486,7 @@ public void whenImagePullSecretSpecifiedButDoesNotExist_reportError() { } @Test - public void whenImagePullSecretExists_dontReportError() { + void whenImagePullSecretExists_dontReportError() { resourceLookup.defineResource("a-secret", KubernetesResourceType.Secret, NS); configureDomain(domain).withDefaultImagePullSecret(new V1LocalObjectReference().name("a-secret")); @@ -494,7 +494,7 @@ public void whenImagePullSecretExists_dontReportError() { } @Test - public void whenConfigOverrideSecretSpecifiedButDoesNotExist_reportError() { + void whenConfigOverrideSecretSpecifiedButDoesNotExist_reportError() { configureDomain(domain).withConfigOverrideSecrets("override-secret"); assertThat(domain.getValidationFailures(resourceLookup), @@ -503,7 +503,7 @@ public void whenConfigOverrideSecretSpecifiedButDoesNotExist_reportError() { } @Test - public void whenConfigOverrideSecretExists_dontReportError() { + void whenConfigOverrideSecretExists_dontReportError() { resourceLookup.defineResource("override-secret", KubernetesResourceType.Secret, NS); configureDomain(domain).withConfigOverrideSecrets("override-secret"); @@ -511,7 +511,7 @@ public void whenConfigOverrideSecretExists_dontReportError() { } @Test - public void whenConfigOverrideCmExistsTypeImage_dontReportError() { + void whenConfigOverrideCmExistsTypeImage_dontReportError() { resourceLookup.defineResource("overrides-cm-image", KubernetesResourceType.ConfigMap, NS); configureDomain(domain).withConfigOverrides("overrides-cm-image").withDomainHomeSourceType(Image); @@ -519,7 +519,7 @@ public void whenConfigOverrideCmExistsTypeImage_dontReportError() { } @Test - public void whenConfigOverrideCmExistsTypeFromModel_reportError() { + void whenConfigOverrideCmExistsTypeFromModel_reportError() { resourceLookup.defineResource("overrides-cm-model", KubernetesResourceType.ConfigMap, NS); resourceLookup.defineResource("wdt-cm-secret", KubernetesResourceType.Secret, NS); configureDomain(domain).withConfigOverrides("overrides-cm-model") @@ -532,7 +532,7 @@ public void whenConfigOverrideCmExistsTypeFromModel_reportError() { } @Test - public void whenWdtConfigMapExists_fromModel_dontReportError() { + void whenWdtConfigMapExists_fromModel_dontReportError() { resourceLookup.defineResource("wdt-cm", KubernetesResourceType.ConfigMap, NS); resourceLookup.defineResource("wdt-cm-secret-model1", KubernetesResourceType.Secret, NS); configureDomain(domain) @@ -544,7 +544,7 @@ public void whenWdtConfigMapExists_fromModel_dontReportError() { } @Test - public void whenWdtConfigMapSpecifiedButDoesNotExist_fromModel_reportError() { + void whenWdtConfigMapSpecifiedButDoesNotExist_fromModel_reportError() { resourceLookup.defineResource("wdt-cm-secret-model2", KubernetesResourceType.Secret, NS); configureDomain(domain).withRuntimeEncryptionSecret("wdt-cm-secret-model2") .withModelConfigMap("wdt-configmap") @@ -556,7 +556,7 @@ public void whenWdtConfigMapSpecifiedButDoesNotExist_fromModel_reportError() { } @Test - public void whenWdtConfigMapSpecifiedButDoesNotExist_Image_dontReportError() { + void whenWdtConfigMapSpecifiedButDoesNotExist_Image_dontReportError() { configureDomain(domain).withDomainHomeSourceType(Image) .withModelConfigMap("wdt-configmap"); @@ -564,7 +564,7 @@ public void whenWdtConfigMapSpecifiedButDoesNotExist_Image_dontReportError() { } @Test - public void whenRuntimeEncryptionSecretSpecifiedButDoesNotExist_Image_dontReportError() { + void whenRuntimeEncryptionSecretSpecifiedButDoesNotExist_Image_dontReportError() { configureDomain(domain).withDomainHomeSourceType(Image) .withRuntimeEncryptionSecret("runtime-secret"); @@ -572,14 +572,14 @@ public void whenRuntimeEncryptionSecretSpecifiedButDoesNotExist_Image_dontReport } @Test - public void whenRuntimeEncryptionSecretUnspecified_Image_dontReportError() { + void whenRuntimeEncryptionSecretUnspecified_Image_dontReportError() { configureDomain(domain).withDomainHomeSourceType(Image); assertThat(domain.getValidationFailures(resourceLookup), empty()); } @Test - public void whenRuntimeEncryptionSecretSpecifiedButDoesNotExist_fromModel_reportError() { + void whenRuntimeEncryptionSecretSpecifiedButDoesNotExist_fromModel_reportError() { configureDomain(domain).withDomainHomeSourceType(FromModel) .withRuntimeEncryptionSecret("runtime-secret"); @@ -588,7 +588,7 @@ public void whenRuntimeEncryptionSecretSpecifiedButDoesNotExist_fromModel_report } @Test - public void whenRuntimeEncryptionSecretExists_fromModel_dontReportError() { + void whenRuntimeEncryptionSecretExists_fromModel_dontReportError() { configureDomain(domain).withDomainHomeSourceType(FromModel) .withRuntimeEncryptionSecret("runtime-good-secret"); resourceLookup.defineResource("runtime-good-secret", KubernetesResourceType.Secret, NS); @@ -597,7 +597,7 @@ public void whenRuntimeEncryptionSecretExists_fromModel_dontReportError() { } @Test - public void whenRuntimeEncryptionSecretUnspecified_fromModel_reportError() { + void whenRuntimeEncryptionSecretUnspecified_fromModel_reportError() { configureDomain(domain).withDomainHomeSourceType(FromModel); assertThat(domain.getValidationFailures(resourceLookup), @@ -606,7 +606,7 @@ public void whenRuntimeEncryptionSecretUnspecified_fromModel_reportError() { } @Test - public void whenWalletPasswordSecretSpecifiedButDoesNotExist_fromModel_reportError() { + void whenWalletPasswordSecretSpecifiedButDoesNotExist_fromModel_reportError() { configureDomain(domain).withDomainHomeSourceType(FromModel) .withRuntimeEncryptionSecret("runtime-encryption-secret-good") .withOpssWalletPasswordSecret("wallet-password-secret-missing"); @@ -618,7 +618,7 @@ public void whenWalletPasswordSecretSpecifiedButDoesNotExist_fromModel_reportErr } @Test - public void whenWalletFileSecretSpecifiedButDoesNotExist_Image_reportError() { + void whenWalletFileSecretSpecifiedButDoesNotExist_Image_reportError() { configureDomain(domain).withDomainHomeSourceType(FromModel) .withRuntimeEncryptionSecret("runtime-encryption-secret-good") .withOpssWalletFileSecret("wallet-file-secret-missing"); @@ -631,7 +631,7 @@ public void whenWalletFileSecretSpecifiedButDoesNotExist_Image_reportError() { } @Test - public void whenWalletPasswordSecretExists_fromModel_dontReportError() { + void whenWalletPasswordSecretExists_fromModel_dontReportError() { configureDomain(domain).withDomainHomeSourceType(FromModel) .withRuntimeEncryptionSecret("runtime-encryption-secret-good") .withOpssWalletPasswordSecret("wallet-password-secret-good"); @@ -642,7 +642,7 @@ public void whenWalletPasswordSecretExists_fromModel_dontReportError() { } @Test - public void whenWalletFileSecretExists_fromModel_dontReportError() { + void whenWalletFileSecretExists_fromModel_dontReportError() { configureDomain(domain).withDomainHomeSourceType(FromModel) .withRuntimeEncryptionSecret("runtime-encryption-secret-good") .withOpssWalletFileSecret("wallet-file-secret-good"); @@ -653,7 +653,7 @@ public void whenWalletFileSecretExists_fromModel_dontReportError() { } @Test - public void whenWalletPasswordSecretUnspecified_fromModel_jrf_reportError() { + void whenWalletPasswordSecretUnspecified_fromModel_jrf_reportError() { configureDomain(domain).withDomainHomeSourceType(FromModel) .withRuntimeEncryptionSecret("runtime-encryption-secret-good") .withDomainType("JRF"); @@ -665,7 +665,7 @@ public void whenWalletPasswordSecretUnspecified_fromModel_jrf_reportError() { } @Test - public void whenWalletFileSecretUnspecified_fromModel_jrf_dontReportError() { + void whenWalletFileSecretUnspecified_fromModel_jrf_dontReportError() { configureDomain(domain).withDomainHomeSourceType(FromModel) .withDomainType("JRF") .withRuntimeEncryptionSecret("runtime-encryption-secret-good") @@ -678,7 +678,7 @@ public void whenWalletFileSecretUnspecified_fromModel_jrf_dontReportError() { } @Test - public void whenWalletPasswordSecretUnspecified_Image_dontReportError() { + void whenWalletPasswordSecretUnspecified_Image_dontReportError() { configureDomain(domain).withDomainHomeSourceType(Image) .withOpssWalletFileSecret("wallet-file-secret"); @@ -688,7 +688,7 @@ public void whenWalletPasswordSecretUnspecified_Image_dontReportError() { } @Test - public void whenWalletPasswordSecretUnspecified_fromModel_wls_dontReportError() { + void whenWalletPasswordSecretUnspecified_fromModel_wls_dontReportError() { configureDomain(domain).withDomainHomeSourceType(Image) .withRuntimeEncryptionSecret("runtime-encryption-secret-good") .withDomainType("WLS") @@ -701,7 +701,7 @@ public void whenWalletPasswordSecretUnspecified_fromModel_wls_dontReportError() } @Test - public void whenExposingDefaultChannelIfIstio_Enabled() { + void whenExposingDefaultChannelIfIstio_Enabled() { configureDomain(domain) .withDomainHomeSourceType(Image) .withIstio() @@ -716,7 +716,7 @@ public void whenExposingDefaultChannelIfIstio_Enabled() { } @Test - public void whenDomainUidExceedMaxAllowed_reportError() { + void whenDomainUidExceedMaxAllowed_reportError() { String domainUID = "mydomainthatislongerthan46charactersandshouldfail"; Domain myDomain = createTestDomain(domainUID); configureDomain(myDomain) @@ -732,7 +732,7 @@ public void whenDomainUidExceedMaxAllowed_reportError() { } @Test - public void whenDomainUidExceedMaxAllowedWithCustomSuffix_reportError() { + void whenDomainUidExceedMaxAllowedWithCustomSuffix_reportError() { String domainUID = "mydomainthatislongerthan42charactersandshould"; Domain myDomain = createTestDomain(domainUID); configureDomain(myDomain) @@ -749,7 +749,7 @@ public void whenDomainUidExceedMaxAllowedWithCustomSuffix_reportError() { } @Test - public void whenDomainUidNotExceedMaxAllowedWithCustomSuffix_dontReportError() { + void whenDomainUidNotExceedMaxAllowedWithCustomSuffix_dontReportError() { String domainUID = "mydomainthatislongerthan42charactersandshould"; Domain myDomain = createTestDomain(domainUID); configureDomain(myDomain) @@ -765,7 +765,7 @@ public void whenDomainUidNotExceedMaxAllowedWithCustomSuffix_dontReportError() { } @Test - public void whenDomainUidNotExceedMaxAllowedWithEmptyCustomSuffix_dontReportError() { + void whenDomainUidNotExceedMaxAllowedWithEmptyCustomSuffix_dontReportError() { String domainUID = "mydomainthatislongerthan42charactersandshould"; Domain myDomain = createTestDomain(domainUID); configureDomain(myDomain) @@ -781,7 +781,7 @@ public void whenDomainUidNotExceedMaxAllowedWithEmptyCustomSuffix_dontReportErro } @Test - public void whenDomainUidPlusASNameNotExceedMaxAllowed_externalServiceDisabled_dontReportError() { + void whenDomainUidPlusASNameNotExceedMaxAllowed_externalServiceDisabled_dontReportError() { String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); String asName = "servernamecontains30character"; @@ -797,7 +797,7 @@ public void whenDomainUidPlusASNameNotExceedMaxAllowed_externalServiceDisabled_d } @Test - public void whenDomainUidPlusASNameNotExceedMaxAllowed_externalServiceEnabled_dontReportError() { + void whenDomainUidPlusASNameNotExceedMaxAllowed_externalServiceEnabled_dontReportError() { String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); String asName = "servernamecontains26chars"; @@ -815,7 +815,7 @@ public void whenDomainUidPlusASNameNotExceedMaxAllowed_externalServiceEnabled_do } @Test - public void whenDomainUidPlusASNameExceedMaxAllowed_externalServiceEnabled_reportTwoErrors() { + void whenDomainUidPlusASNameExceedMaxAllowed_externalServiceEnabled_reportTwoErrors() { String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); String asName = "servernamecontains32characterss"; @@ -836,7 +836,7 @@ public void whenDomainUidPlusASNameExceedMaxAllowed_externalServiceEnabled_repor } @Test - public void whenDomainUidPlusASNameExceedMaxAllowed_externalServiceDisabled_reportOneError() { + void whenDomainUidPlusASNameExceedMaxAllowed_externalServiceDisabled_reportOneError() { String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); String asName = "servernamecontains32characterss"; @@ -853,7 +853,7 @@ public void whenDomainUidPlusASNameExceedMaxAllowed_externalServiceDisabled_repo } @Test - public void whenDomainUidPlusASNameOnlyExternalServiceExceedMaxAllowed_reportOneError() { + void whenDomainUidPlusASNameOnlyExternalServiceExceedMaxAllowed_reportOneError() { String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); String asName = "servernamecontains30characters"; @@ -871,7 +871,7 @@ public void whenDomainUidPlusASNameOnlyExternalServiceExceedMaxAllowed_reportOne } @Test - public void whenDomainUidPlusASNameNotExceedMaxAllowedWithCustomSuffix_dontReportError() { + void whenDomainUidPlusASNameNotExceedMaxAllowedWithCustomSuffix_dontReportError() { String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); String asName = "servernamecontains21c"; @@ -889,7 +889,7 @@ public void whenDomainUidPlusASNameNotExceedMaxAllowedWithCustomSuffix_dontRepor } @Test - public void whenDomainUidPlusASNameNotExceedMaxAllowedWithEmptyCustomSuffix_dontReportError() { + void whenDomainUidPlusASNameNotExceedMaxAllowedWithEmptyCustomSuffix_dontReportError() { String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); String asName = "servernamecontains30characters"; @@ -907,7 +907,7 @@ public void whenDomainUidPlusASNameNotExceedMaxAllowedWithEmptyCustomSuffix_dont } @Test - public void whenDomainUidPlusASNameExceedMaxAllowedWithCustomSuffix_reportTwoErrors() { + void whenDomainUidPlusASNameExceedMaxAllowedWithCustomSuffix_reportTwoErrors() { String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); String asName = "servernamecontains31characterss"; @@ -929,7 +929,7 @@ public void whenDomainUidPlusASNameExceedMaxAllowedWithCustomSuffix_reportTwoErr } @Test - public void whenDomainUidPlusMSNameNotExceedMaxAllowed_dontReportError() { + void whenDomainUidPlusMSNameNotExceedMaxAllowed_dontReportError() { String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); String msName = "servernamecontains29characte"; @@ -947,7 +947,7 @@ public void whenDomainUidPlusMSNameNotExceedMaxAllowed_dontReportError() { } @Test - public void whenDomainUidPlusMSNameNotExceedMaxAllowedWithClusterSize9_dontReportError() { + void whenDomainUidPlusMSNameNotExceedMaxAllowedWithClusterSize9_dontReportError() { WlsDomainConfig domainConfigWithCluster = createDomainConfig("CLUSTER-9"); String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); @@ -968,7 +968,7 @@ public void whenDomainUidPlusMSNameNotExceedMaxAllowedWithClusterSize9_dontRepor } @Test - public void whenDomainUidPlusMSNameNotExceedMaxAllowedWithClusterSize99_dontReportError() { + void whenDomainUidPlusMSNameNotExceedMaxAllowedWithClusterSize99_dontReportError() { WlsDomainConfig domainConfigWithCluster = createDomainConfig("CLUSTER-99-good"); String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); @@ -990,7 +990,7 @@ public void whenDomainUidPlusMSNameNotExceedMaxAllowedWithClusterSize99_dontRepo } @Test - public void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize9_reportError() { + void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize9_reportError() { WlsDomainConfig domainConfigWithCluster = createDomainConfig("CLUSTER-9-bad"); String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); @@ -1022,7 +1022,7 @@ public void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize9_reportError( } @Test - public void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize99_reportError() { + void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize99_reportError() { WlsDomainConfig domainConfigWithCluster = createDomainConfig("CLUSTER-99-bad"); String domainUID = "mydomainnamecontains32characterS"; Domain myDomain = createTestDomain(domainUID); @@ -1053,7 +1053,7 @@ public void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize99_reportError } @Test - public void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize100_noExtrSpaceShouldBeReserved_dontReportError() { + void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize100_noExtrSpaceShouldBeReserved_dontReportError() { WlsDomainConfig domainConfigWithCluster = createDomainConfig("CLUSTER-100-good"); String domainUID = "mydomainnamecontains32charactess"; Domain myDomain2 = createTestDomain(domainUID); @@ -1075,7 +1075,7 @@ public void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize100_noExtrSpac } @Test - public void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize9ButClusterPaddingDisabled_dontReportError() { + void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize9ButClusterPaddingDisabled_dontReportError() { WlsDomainConfig domainConfigWithCluster = createDomainConfig("CLUSTER-9-bad-ok"); String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); @@ -1104,7 +1104,7 @@ public void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize9ButClusterPad } @Test - public void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize99ButClusterPaddingDisabled_reportError() { + void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize99ButClusterPaddingDisabled_reportError() { WlsDomainConfig domainConfigWithCluster = createDomainConfig("CLUSTER-99-bad-ok"); String domainUID = "mydomainnamecontains32characterS"; Domain myDomain = createTestDomain(domainUID); @@ -1131,7 +1131,7 @@ public void whenDomainUidPlusMSNameExceedMaxAllowedWithClusterSize99ButClusterPa } @Test - public void whenDomainUidPlusClusterNameNotExceedMaxAllowed_dontReportError() { + void whenDomainUidPlusClusterNameNotExceedMaxAllowed_dontReportError() { String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); String clusterName = "clusternamecontain21c"; @@ -1149,7 +1149,7 @@ public void whenDomainUidPlusClusterNameNotExceedMaxAllowed_dontReportError() { } @Test - public void whenDomainUidPlusClusterNameExceedMaxAllowed_reportError() { + void whenDomainUidPlusClusterNameExceedMaxAllowed_reportError() { String domainUID = "mydomainnamecontains32characters"; Domain myDomain = createTestDomain(domainUID); String clusterName = "servernamecontains31characters"; @@ -1168,7 +1168,7 @@ public void whenDomainUidPlusClusterNameExceedMaxAllowed_reportError() { } @Test - public void whenDomainServerHasListenPort_dontReportError() { + void whenDomainServerHasListenPort_dontReportError() { String domainUID = "TestDomainForRest"; WlsDomainConfig domainConfigWithCluster = createDomainConfig("TestClusterForRest"); Domain myDomain = createTestDomain(domainUID); @@ -1194,7 +1194,7 @@ public void whenDomainServerHasListenPort_dontReportError() { } @Test - public void whenDomainServerHasSSLListenPort_dontReportError() { + void whenDomainServerHasSSLListenPort_dontReportError() { String domainUID = "TestDomainForRest"; WlsDomainConfig domainConfigWithCluster = createDomainConfig("TestClusterForRest"); Domain myDomain = createTestDomain(domainUID); @@ -1220,7 +1220,7 @@ public void whenDomainServerHasSSLListenPort_dontReportError() { } @Test - public void whenDomainServerHasAdminPort_dontReportError() { + void whenDomainServerHasAdminPort_dontReportError() { String domainUID = "TestDomainForRest"; WlsDomainConfig domainConfigWithCluster = createDomainConfig("TestClusterForRest"); Domain myDomain = createTestDomain(domainUID); @@ -1246,7 +1246,7 @@ public void whenDomainServerHasAdminPort_dontReportError() { } @Test - public void whenDomainServerHasAdminNAP_dontReportError() { + void whenDomainServerHasAdminNAP_dontReportError() { String domainUID = "TestDomainForRest"; WlsDomainConfig domainConfigWithCluster = createDomainConfig("TestClusterForRest"); Domain myDomain = createTestDomain(domainUID); @@ -1273,7 +1273,7 @@ public void whenDomainServerHasAdminNAP_dontReportError() { } @Test - public void whenDomainServerNoAvailablePortForREST_reportError() { + void whenDomainServerNoAvailablePortForREST_reportError() { String domainUID = "TestDomainForRest"; WlsDomainConfig domainConfigWithCluster = createDomainConfig("TestClusterForRest"); Domain myDomain = createTestDomain(domainUID); diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/OperatorUtilsTest.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/OperatorUtilsTest.java index 3fd4ba66fcc..44f2ae7c889 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/OperatorUtilsTest.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/OperatorUtilsTest.java @@ -15,25 +15,25 @@ import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.lessThan; -public class OperatorUtilsTest { +class OperatorUtilsTest { @Test - public void verifyThatMember2Foo_before_member12foo() { + void verifyThatMember2Foo_before_member12foo() { assertThat(compareSortingStrings("member2foo", "member12foo"), lessThan(0)); } @Test - public void verifyThatCompareSortingStrings_worksOnStringWith20Digits() { + void verifyThatCompareSortingStrings_worksOnStringWith20Digits() { assertThat(compareSortingStrings("member2foo", "member12345678901234567890foo"), lessThan(0)); } @Test - public void verifyThatCreateSortedMapWithNull_returnsEmptyMap() { + void verifyThatCreateSortedMapWithNull_returnsEmptyMap() { assertThat(createSortedMap(null), anEmptyMap()); } @Test - public void verifyThatCreateSortedMap_returnsSortedMap() { + void verifyThatCreateSortedMap_returnsSortedMap() { Map map = new HashMap<>(); map.put("server2", "server2-value"); map.put("server10", "server10-value"); diff --git a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ServerStatusTest.java b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ServerStatusTest.java index fac5c4641da..aec1f9b2a06 100644 --- a/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ServerStatusTest.java +++ b/operator/src/test/java/oracle/kubernetes/weblogic/domain/model/ServerStatusTest.java @@ -10,7 +10,7 @@ import static org.hamcrest.Matchers.lessThan; import static org.hamcrest.junit.MatcherAssert.assertThat; -public class ServerStatusTest { +class ServerStatusTest { static final ServerStatus cluster1Server1 = new ServerStatus().withClusterName("cluster-1").withServerName("server1"); @@ -33,7 +33,7 @@ public class ServerStatusTest { static final ServerStatus nullClusterNullServer = new ServerStatus(); @Test - public void verify_Equal_compareTo() { + void verify_Equal_compareTo() { assertThat("compareTo should return 0 if both ServerStatus have null cluster and server names", nullClusterNullServer.compareTo(new ServerStatus()), equalTo(0)); assertThat("compareTo should return 0 if both ServerStatus have same cluster and server names", @@ -47,7 +47,7 @@ public void verify_Equal_compareTo() { } @Test - public void verifyThat_adminServer_before_notAdminServerWithSameServerName() { + void verifyThat_adminServer_before_notAdminServerWithSameServerName() { assertThat("ServerStatus for admin server should be ordered before ServerStatus for non admin server", adminServer.compareTo(new ServerStatus().withServerName("admin-server")), equalTo(-1)); assertThat("ServerStatus for non admin server should be ordered after ServerStatus for admin server", @@ -55,7 +55,7 @@ public void verifyThat_adminServer_before_notAdminServerWithSameServerName() { } @Test - public void verifyThat_statusWithoutCluster_before_statusWithCluster() { + void verifyThat_statusWithoutCluster_before_statusWithCluster() { assertThat("ServerStatus without cluster name should be ordered before ServerStatus with cluster name", standAloneServer1.compareTo(cluster1Server1), lessThan(0)); assertThat("ServerStatus with cluster name should be ordered after ServerStatus without cluster name", @@ -63,7 +63,7 @@ public void verifyThat_statusWithoutCluster_before_statusWithCluster() { } @Test - public void verifyThat_cluster1_before_cluster2() { + void verifyThat_cluster1_before_cluster2() { assertThat("ServerStatus for cluster-1 should be ordered before ServerStatus for cluster-2", cluster1Server1.compareTo(cluster2Server1), lessThan(0)); assertThat("ServerStatus for cluster-2 should be ordered after ServerStatus for cluster-1", @@ -71,7 +71,7 @@ public void verifyThat_cluster1_before_cluster2() { } @Test - public void verifyThat_cluster1_before_cluster10() { + void verifyThat_cluster1_before_cluster10() { assertThat("ServerStatus for cluster-1 should be ordered before ServerStatus for cluster-10", cluster1Server1.compareTo(cluster10Server1), lessThan(0)); assertThat("ServerStatus for cluster-10 should be ordered after ServerStatus for cluster-1", @@ -79,7 +79,7 @@ public void verifyThat_cluster1_before_cluster10() { } @Test - public void verifyThat_cluster2_before_cluster10() { + void verifyThat_cluster2_before_cluster10() { assertThat("ServerStatus for cluster-2 should be ordered before ServerStatus for cluster-10", cluster2Server1.compareTo(cluster10Server1), lessThan(0)); assertThat("ServerStatus for cluster-10 should be ordered after ServerStatus for cluster-2", @@ -87,7 +87,7 @@ public void verifyThat_cluster2_before_cluster10() { } @Test - public void verifyThat_server1_before_server2() { + void verifyThat_server1_before_server2() { assertThat("ServerStatus for server1 should be ordered before ServerStatus for server2", standAloneServer1.compareTo(standAloneServer2), lessThan(0)); assertThat("ServerStatus for server2 should be ordered after ServerStatus for server1", @@ -100,7 +100,7 @@ public void verifyThat_server1_before_server2() { } @Test - public void verifyThat_server1_before_server10() { + void verifyThat_server1_before_server10() { assertThat("ServerStatus for server1 should be ordered before ServerStatus for server10", standAloneServer1.compareTo(standAloneServer10), lessThan(0)); assertThat("ServerStatus for server10 should be ordered after ServerStatus for server1", @@ -113,7 +113,7 @@ public void verifyThat_server1_before_server10() { } @Test - public void verifyThat_server2_before_server10() { + void verifyThat_server2_before_server10() { assertThat("ServerStatus for server2 should be ordered before ServerStatus for server10", standAloneServer2.compareTo(standAloneServer10), lessThan(0)); assertThat("ServerStatus for server10 should be ordered after ServerStatus for server2", @@ -126,7 +126,7 @@ public void verifyThat_server2_before_server10() { } @Test - public void verifyThat_adminServer_before_serverA() { + void verifyThat_adminServer_before_serverA() { assertThat("ServerStatus for admin server should be ordered before ServerStatus for non admin server", adminServer.compareTo(standAloneServerA), lessThan(0)); assertThat("ServerStatus for non admin server should be ordered after ServerStatus for admin server", @@ -141,7 +141,7 @@ public void verifyThat_adminServer_before_serverA() { // We use the volatile adminServer flag to control sorting, but it is not part of the JSON schema of the status, // therefore it cannot figure in the equals() test, which is used to decide whether we need to update the status. @Test - public void equalsMethodsIgnoresIsAdminServer() { + void equalsMethodsIgnoresIsAdminServer() { assertThat( new ServerStatus().withClusterName("1").withServerName("1"), equalTo(new ServerStatus().withClusterName("1").withServerName("1").withIsAdminServer(true)));