diff options
Diffstat (limited to 'integrity-monitor/src/test')
11 files changed, 0 insertions, 5714 deletions
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java deleted file mode 100644 index c5b2e193..00000000 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Integrity Monitor - * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2023-2024 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.common.im; - -import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.util.Map; -import java.util.Map.Entry; -import java.util.Properties; -import java.util.concurrent.Semaphore; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.util.ReflectionTestUtils; - -class AllSeemsWellTest extends IntegrityMonitorTestBase { - private static final String ALL_SEEMS_WELL_MSG = "'AllSeemsWellTest - ALLSEEMSWELL'"; - - private static Logger logger = LoggerFactory.getLogger(AllSeemsWellTest.class); - - private static String resourceName; - - private Properties myProp; - private Semaphore monitorSem; - private Semaphore junitSem; - - /** - * Set up for test class. - */ - @BeforeAll - public static void setUpClass() throws Exception { - IntegrityMonitorTestBase.setUpBeforeClass(DEFAULT_DB_URL_PREFIX + AllSeemsWellTest.class.getSimpleName()); - - resourceName = IntegrityMonitorTestBase.SITE_NAME + "." + IntegrityMonitorTestBase.NODE_TYPE; - } - - @AfterAll - public static void tearDownClass() { - IntegrityMonitorTestBase.tearDownAfterClass(); - } - - /** - * Set up for test cases. - * @throws Exception if an error occurs - */ - @BeforeEach - public void setUp() throws Exception { - super.setUpTest(); - - myProp = makeProperties(); - - monitorSem = new Semaphore(0); - junitSem = new Semaphore(0); - - IntegrityMonitor im = new IntegrityMonitor(resourceName, myProp) { - - @Override - protected void runStarted() throws InterruptedException { - monitorSem.acquire(); - - junitSem.release(); - monitorSem.acquire(); - } - - @Override - protected void monitorCompleted() throws InterruptedException { - junitSem.release(); - monitorSem.acquire(); - } - }; - - ReflectionTestUtils.setField(IntegrityMonitor.class, IM_INSTANCE_FIELD, im); - } - - @AfterEach - public void tearDown() { - super.tearDownTest(); - } - - @Test - void testAllSeemsWell() throws Exception { - logger.debug("\nIntegrityMonitorTest: Entering testAllSeemsWell\n\n"); - - // parameters are passed via a properties file - myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, ""); - myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "false"); - myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1"); - myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1"); - myProp.put(IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD, "1"); - - IntegrityMonitor.updateProperties(myProp); - - IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp); - - StateManagement sm = im.getStateManager(); - - // Give it time to set the states in the DB - waitStateChange(); - - // Check the state - logger.debug( - "\n\ntestAllSeemsWell starting im state \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\n" - + "StandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - assertEquals(StateManagement.ENABLED, sm.getOpState()); - - // Indicate a failure - im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLNOTWELL, - "'AllSeemsWellTest - ALLNOTWELL'"); - - // Wait for the state to change due to ALLNOTWELL - waitStateChange(); - // Check the state - logger.debug( - "\n\ntestAllSeemsWell after ALLNOTWELL: im state \nAdminState = {}\nOpState() = {}\nAvailStatus = " - + "{}\nStandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - Map<String, String> allNotWellMap = im.getAllNotWellMap(); - if (logger.isDebugEnabled()) { - for (Entry<String, String> ent : allNotWellMap.entrySet()) { - logger.debug("AllSeemsWellTest: allNotWellMap: key = {} msg = {}", ent.getKey(), ent.getValue()); - } - } - assertEquals(1, allNotWellMap.size()); - - assertTrue(im.getAllSeemsWellMap().isEmpty()); - - // Return to normal - im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL, - ALL_SEEMS_WELL_MSG); - - // Wait for the state to change due to ALLNOTWELL - waitStateChange(); - // Check the state - logger.debug( - "\n\ntestAllSeemsWell after ALLSEEMSWELL: im state \nAdminState = {}\nOpState() = {}\nAvailStatus = " - + "{}\nStandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - assertEquals(StateManagement.ENABLED, sm.getOpState()); - - allNotWellMap = im.getAllNotWellMap(); - assertTrue(allNotWellMap.isEmpty()); - - Map<String, String> allSeemsWellMap = im.getAllSeemsWellMap(); - assertEquals(1, allSeemsWellMap.size()); - if (logger.isDebugEnabled()) { - for (Entry<String, String> ent : allSeemsWellMap.entrySet()) { - logger.debug("AllSeemsWellTest: allSeemsWellMap: key = {} msg = {}", ent.getKey(), ent.getValue()); - } - } - - // Check for null parameters - assertThatIllegalArgumentException().isThrownBy( - () -> im.allSeemsWell(null, IntegrityMonitorProperties.ALLSEEMSWELL, ALL_SEEMS_WELL_MSG)); - - assertThatIllegalArgumentException().isThrownBy( - () -> im.allSeemsWell("", IntegrityMonitorProperties.ALLSEEMSWELL, ALL_SEEMS_WELL_MSG)); - - assertThatIllegalArgumentException().isThrownBy( - () -> im.allSeemsWell(this.getClass().getName(), null, ALL_SEEMS_WELL_MSG)); - - assertThatIllegalArgumentException().isThrownBy( - () -> im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL, null)); - - assertThatIllegalArgumentException().isThrownBy( - () -> im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL, "")); - - logger.debug("\n\ntestAllSeemsWell: Exit\n\n"); - } - - /** - * Waits for the state to change. - * - * @throws InterruptedException if the thread is interrupted - */ - private void waitStateChange() throws InterruptedException { - monitorSem.release(); - waitSem(junitSem); - } - -} diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java deleted file mode 100644 index ca7ef27d..00000000 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Integrity Monitor - * ================================================================================ - * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.common.im; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.Test; -import org.onap.policy.common.im.jmx.ComponentAdminException; -import org.onap.policy.common.utils.test.ExceptionsTester; - -/** - * Tests various Exception subclasses. - */ -class ExceptionsTest extends ExceptionsTester { - - @Test - void testStateTransitionException() { - assertEquals(4, test(StateTransitionException.class)); - } - - @Test - void testStateManagementException() { - assertEquals(4, test(StateManagementException.class)); - } - - @Test - void testStandbyStatusException() { - assertEquals(5, test(StandbyStatusException.class)); - } - - @Test - void testIntegrityMonitorPropertiesException() { - assertEquals(4, test(IntegrityMonitorPropertiesException.class)); - } - - @Test - void testIntegrityMonitorException() { - assertEquals(5, test(IntegrityMonitorException.class)); - } - - @Test - void testForwardProgressException() { - assertEquals(4, test(ForwardProgressException.class)); - } - - @Test - void testAllSeemsWellException() { - assertEquals(4, test(AllSeemsWellException.class)); - } - - @Test - void testAdministrativeStateException() { - assertEquals(4, test(AdministrativeStateException.class)); - } - - @Test - void testComponentAdminException() { - assertEquals(4, test(ComponentAdminException.class)); - } -} diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java deleted file mode 100644 index f866df47..00000000 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java +++ /dev/null @@ -1,982 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Integrity Monitor - * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. - * Modificaitons Copyright (C) 2023-2024 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.common.im; - -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.fail; - -import jakarta.persistence.EntityTransaction; -import jakarta.persistence.Query; -import jakarta.persistence.TemporalType; -import java.util.Date; -import java.util.List; -import java.util.Properties; -import java.util.concurrent.Semaphore; -import java.util.concurrent.TimeUnit; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.onap.policy.common.im.jpa.ForwardProgressEntity; -import org.onap.policy.common.im.jpa.ResourceRegistrationEntity; -import org.onap.policy.common.im.jpa.StateManagementEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.util.ReflectionTestUtils; - -/* - * All JUnits are designed to run in the local development environment - * where they have write privileges and can execute time-sensitive - * tasks. - */ -class IntegrityMonitorTest extends IntegrityMonitorTestBase { - private static final String STANDBY_STATUS = "StandbyStatus = {}\n"; - private static final String RESTARTING_MSG = "\ntestSanityJmx restarting the IntegrityMonitor"; - private static final String FALSE_STRING = "false"; - private static final String GROUP1_DEP1 = "group1_dep1"; - private static final String RESOURCE = "resource"; - private static final String SITE_A_PAP2 = "siteA_pap2"; - private static final String SITE_B_PAP1 = "siteB_pap1"; - private static final String SITE_B_PAP2 = "siteB_pap2"; - - private static final String ENABLE_NO_DEPENDENCY_MSG = - """ - - - sm.enableNoDependency() - AdminState = {} - OpState() = {} - AvailStatus = {} - StandbyStatus = {} - """; - - private static final Logger logger = LoggerFactory.getLogger(IntegrityMonitorTest.class); - - /** - * Number of monitor cycles it takes between dependency health checks. - */ - private static final int DEPENDENCY_CHECK_CYCLES = 6; - - private static String resourceName; - - private Properties myProp; - private EntityTransaction et; - private Semaphore monitorSem; - private Semaphore junitSem; - - /** - * Set up for test class. - */ - @BeforeAll - public static void setUpClass() throws Exception { - IntegrityMonitorTestBase.setUpBeforeClass(DEFAULT_DB_URL_PREFIX + IntegrityMonitorTest.class.getSimpleName()); - - resourceName = IntegrityMonitorTestBase.SITE_NAME + "." + IntegrityMonitorTestBase.NODE_TYPE; - } - - /** - * Tear down after test class. - */ - @AfterAll - public static void tearDownClass() { - IntegrityMonitorTestBase.tearDownAfterClass(); - } - - /** - * Set up for test cases. - */ - @BeforeEach - public void setUp() { - super.setUpTest(); - - myProp = makeProperties(); - et = null; - } - - /** - * Tear down after test cases. - */ - @AfterEach - public void tearDown() { - if (et != null && et.isActive()) { - try { - et.rollback(); - - } catch (RuntimeException e) { - logger.error("cannot rollback transaction", e); - } - } - - super.tearDownTest(); - } - - /* - * The following test verifies the following test cases: New Install New Install - Bad - * Dependency data Recovery from bad dependency data Lock Lock restart Unlock Unlock restart - */ - @Test - void testSanityJmx() throws Exception { - logger.debug("\nIntegrityMonitorTest: Entering testSanityJmx\n\n"); - - String dependent = "group1_logparser"; - - // parameters are passed via a properties file - myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, dependent); - myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, "true"); - // Disable the integrity monitor so it will not interfere - myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1"); - // Disable the refresh state audit - myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1"); - // Disable the state audit - myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1"); - // Disable the test transaction - myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1"); - // Disable the write FPC - myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1"); - // Speed up the check - myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "1"); - // Fail dependencies after three seconds - myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "3"); - - IntegrityMonitor im = makeMonitor(resourceName, myProp); - logger.debug( - "\n\ntestSanityJmx starting im state \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\n" - + STANDBY_STATUS, - im.getStateManager().getAdminState(), im.getStateManager().getOpState(), - im.getStateManager().getAvailStatus(), im.getStateManager().getStandbyStatus()); - // add an entry to Resource registration table in the DB for the - // dependent resource - - et = em.getTransaction(); - et.begin(); - Query rquery = em.createQuery("Select r from ResourceRegistrationEntity r where r.resourceName=:rn"); - rquery.setParameter("rn", dependent); - - @SuppressWarnings("rawtypes") - List rrList = rquery.getResultList(); - ResourceRegistrationEntity rrx = null; - if (rrList.isEmpty()) { - // register resource by adding entry to table in DB - logger.debug("Adding resource {} to ResourceRegistration table", dependent); - rrx = new ResourceRegistrationEntity(); - // set columns in entry - rrx.setResourceName(dependent); - rrx.setResourceUrl("service:jmx:somewhere:9999"); - rrx.setNodeType("logparser"); - rrx.setSite("siteA"); - } - em.persist(rrx); - // flush to the DB - em.flush(); - - // commit transaction - et.commit(); - - /* - * wait for FPManager to perform dependency health check. Once that's done, it - * should now be stale and the sanity check should fail - */ - waitCycles(DEPENDENCY_CHECK_CYCLES); - - final IntegrityMonitor im2 = im; - assertThatThrownBy(im2::evaluateSanity).isInstanceOf(IntegrityMonitorException.class); - - // undo dependency groups and jmx test properties settings - myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, ""); - myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, FALSE_STRING); - IntegrityMonitor.updateProperties(myProp); - - logger.debug("\ntestSantityJmx ending properties: {}", myProp); - - // We know at this point that the IM is disable-dependency. We want to - // be - // sure it will recover from this condition since the properties were - // updated. - - logger.debug( - "\n\ntestSanityJmx ending im state\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\n" - + STANDBY_STATUS, - im.getStateManager().getAdminState(), im.getStateManager().getOpState(), - im.getStateManager().getAvailStatus(), im.getStateManager().getStandbyStatus()); - - logger.debug(RESTARTING_MSG); - // Create a new instance. It should recover from the disabled-dependency - // condition - im = makeMonitor(resourceName, myProp); - - logger.debug( - """ - - - testSanityJmx state after creating new im - AdminState = {} - OpState() = {} - AvailStatus = {} - StandbyStatus = {} - """, - im.getStateManager().getAdminState(), im.getStateManager().getOpState(), - im.getStateManager().getAvailStatus(), im.getStateManager().getStandbyStatus()); - - // Verify the state - assertEquals(StateManagement.UNLOCKED, im.getStateManager().getAdminState()); - assertEquals(StateManagement.ENABLED, im.getStateManager().getOpState()); - assertEquals(StateManagement.NULL_VALUE, im.getStateManager().getAvailStatus()); - assertEquals(StateManagement.NULL_VALUE, im.getStateManager().getStandbyStatus()); - - // Test state manager via the IntegrityMonitor - StateManagement sm = im.getStateManager(); - - // Verify lock state - sm.lock(); - logger.debug("\n\nsm.lock()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - assertEquals(StateManagement.LOCKED, sm.getAdminState()); - - // Verify lock persists across a restart - logger.debug(RESTARTING_MSG); - // Create a new instance. It should come up with the admin state locked - im = makeMonitor(resourceName, myProp); - sm = im.getStateManager(); - logger.debug( - """ - - - testSanityJmx restart with AdminState=locked - AdminState = {} - OpState() = {} - AvailStatus = {} - StandbyStatus = {} - """, - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - assertEquals(StateManagement.LOCKED, sm.getAdminState()); - - // Verify unlock - sm.unlock(); - logger.debug( - "\n\ntestSanityJmx sm.unlock\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - assertEquals(StateManagement.UNLOCKED, sm.getAdminState()); - - // Verify unlock restart - logger.debug(RESTARTING_MSG); - // Create a new instance. It should come up with the admin state locked - im = makeMonitor(resourceName, myProp); - sm = im.getStateManager(); - logger.debug( - """ - - - testSanityJmx restart with AdminState=unlocked - AdminState = {} - OpState() = {} - AvailStatus = {} - StandbyStatus = {} - """, - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - assertEquals(StateManagement.UNLOCKED, sm.getAdminState()); - - logger.debug("\n\ntestSanityJmx: Exit\n\n"); - } - - @Test - void testIm() throws Exception { - logger.debug("\nIntegrityMonitorTest: Entering testIM\n\n"); - - // Disable the integrity monitor so it will not interfere - myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1"); - // Disable dependency checking - myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1"); - // Disable the refresh state audit - myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1"); - // Disable the state audit - myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1"); - // Disable the test transaction - myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1"); - // Disable writing the FPC - myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1"); - - IntegrityMonitor im = makeMonitor(resourceName, myProp); - - logger.debug("\n\nim initial state: \nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n", - im.getStateManager().getAdminState(), im.getStateManager().getOpState(), - im.getStateManager().getAvailStatus(), im.getStateManager().getStandbyStatus()); - - waitCycles(1); - - // test evaluate sanity - im.evaluateSanity(); - - // Test startTransaction - should work since it is unlocked - im.startTransaction(); - - // Test state manager via the IntegrityMonitor - StateManagement sm = im.getStateManager(); - - sm.lock(); - - logger.debug("\n\nsm.lock()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - assertEquals(StateManagement.LOCKED, sm.getAdminState()); - - // test startTransaction. It should fail since it is locked - assertThatThrownBy(im::startTransaction).isInstanceOf(IntegrityMonitorException.class); - - sm.unlock(); - logger.debug("\n\nsm.unlock()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - assertEquals(StateManagement.UNLOCKED, sm.getAdminState()); - - // test startTransaction. It should succeed - im.startTransaction(); - - sm.disableDependency(); - logger.debug( - "\n\nsm.disableDependency()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - assertEquals(StateManagement.DISABLED, sm.getOpState()); - assertEquals(StateManagement.DEPENDENCY, sm.getAvailStatus()); - - // test startTransaction. It should succeed since standby status is null - // and unlocked - im.startTransaction(); - - sm.enableNoDependency(); - - logger.debug( - ENABLE_NO_DEPENDENCY_MSG, - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - assertEquals(StateManagement.ENABLED, sm.getOpState()); - // test startTransaction. It should succeed since standby status is null - // and unlocked - im.startTransaction(); - - sm.disableFailed(); - logger.debug("\n\nsm.disableFailed()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - assertEquals(StateManagement.DISABLED, sm.getOpState()); - assertEquals(StateManagement.FAILED, sm.getAvailStatus()); - // test startTransaction. It should succeed since standby status is null - // and unlocked - im.startTransaction(); - - sm.enableNotFailed(); - - logger.debug( - "\n\nsm.enabledNotFailed()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - assertEquals(StateManagement.ENABLED, sm.getOpState()); - // test startTransaction. It should succeed since standby status is null - // and unlocked - im.startTransaction(); - - sm.demote(); - - logger.debug("\n\nsm.demote()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - assertEquals(StateManagement.HOT_STANDBY, sm.getStandbyStatus()); - - // test startTransaction. It should fail since it is standby - assertThatThrownBy(im::startTransaction).isInstanceOf(IntegrityMonitorException.class); - - sm.promote(); - - logger.debug("\n\nsm.promote()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\nStandbyStatus = {}\n", - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - assertEquals(StateManagement.PROVIDING_SERVICE, sm.getStandbyStatus()); - - // test startTransaction. It should succeed since it is providing - // service - im.startTransaction(); - - // Test the multi-valued availability status - sm.disableDependency(); - sm.disableFailed(); - - logger.debug( - "\n\nsm.disableDependency(), sm.disableFailed\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\n" - + STANDBY_STATUS, - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - assertEquals(StateManagement.DEPENDENCY_FAILED, sm.getAvailStatus()); - - // Test startTransaction. Should fail since standby status is cold - // standby - assertThatThrownBy(im::startTransaction).isInstanceOf(IntegrityMonitorException.class); - - sm.enableNoDependency(); - - logger.debug( - ENABLE_NO_DEPENDENCY_MSG, - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - assertEquals(StateManagement.FAILED, sm.getAvailStatus()); - // Test startTransaction. Should fail since standby status is cold - // standby - assertThatThrownBy(im::startTransaction).isInstanceOf(IntegrityMonitorException.class); - - sm.disableDependency(); - sm.enableNotFailed(); - - logger.debug( - "\n\nsm.disableDependency(),sm.enableNotFailed()\nAdminState = {}\nOpState() = {}\nAvailStatus = {}\n" - + STANDBY_STATUS, - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - - assertEquals(StateManagement.DEPENDENCY, sm.getAvailStatus()); - // Test startTransaction. Should fail since standby status is cold - // standby - assertThatThrownBy(im::startTransaction).isInstanceOf(IntegrityMonitorException.class); - - sm.enableNoDependency(); - logger.debug( - ENABLE_NO_DEPENDENCY_MSG, - sm.getAdminState(), sm.getOpState(), sm.getAvailStatus(), sm.getStandbyStatus()); - assertEquals(StateManagement.ENABLED, sm.getOpState()); - // test startTransaction. It should fail since standby status is hot - // standby - assertThatThrownBy(im::startTransaction).isInstanceOf(IntegrityMonitorException.class); - - logger.debug("\n\ntestIM: Exit\n\n"); - } - - @Test - void testSanityState() throws Exception { - logger.debug("\nIntegrityMonitorTest: Entering testSanityState\n\n"); - - // parameters are passed via a properties file - myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, "group1_dep1,group1_dep2; group2_dep1"); - // Disable the integrity monitor so it will not interfere - myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1"); - // Disable the refresh state audit - myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1"); - // Disable dependency checking so it does not interfere - myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1"); - // Disable the state audit - myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1"); - // Disable the test transaction - myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1"); - // Disable writing the FPC - myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1"); - // Max interval for use in deciding if a FPC entry is stale in seconds - myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "120"); - - final IntegrityMonitor im = makeMonitor(resourceName, myProp); - - waitCycles(1); - - // Add a group1 dependent resources to put an entry in the forward - // progress table - ForwardProgressEntity fpe = new ForwardProgressEntity(); - ForwardProgressEntity fpe2 = new ForwardProgressEntity(); - fpe.setFpcCount(0); - fpe.setResourceName(GROUP1_DEP1); - fpe2.setFpcCount(0); - fpe2.setResourceName("group1_dep2"); - et = em.getTransaction(); - et.begin(); - em.persist(fpe); - em.persist(fpe2); - em.flush(); - et.commit(); - - // Add a group2 dependent resource to the StateManagementEntity DB table - // and set its admin state to locked - // Expect sanity test to fail. - StateManagement stateManager = new StateManagement(emf, "group2_dep1"); - stateManager.lock(); - - new StateManagement(emf, GROUP1_DEP1); - new StateManagement(emf, "group1_dep2"); - - // Call the dependency check directly instead of waiting for FPManager - // to do it. - logger.debug("\n\nIntegrityMonitor.testSanityState: calling im.dependencyCheck()\n\n"); - im.dependencyCheck(); - assertThatThrownBy(im::evaluateSanity).isInstanceOf(IntegrityMonitorException.class); - - logger.debug("\n\ntestSanityState: Exit\n\n"); - } - - @Test - void testRefreshStateAudit() throws Exception { - logger.debug("\nIntegrityMonitorTest: testRefreshStateAudit Enter\n\n"); - - // parameters are passed via a properties file - myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, ""); - myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, FALSE_STRING); - // Disable the integrity monitor so it will not interfere - myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1"); - // Disable the refresh state audit - myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1"); - // Disable dependency checking so it does not interfere - myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1"); - // Disable the state audit - myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1"); - // Disable the test transaction - myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1"); - // Disable writing the FPC - myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1"); - - final IntegrityMonitor im = makeMonitor(resourceName, myProp); - - waitCycles(1); - - // the state here is unlocked, enabled, null, null - StateManagementEntity sme = null; - - Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource"); - - query.setParameter(RESOURCE, resourceName); - - // Just test that we are retrieving the right object - @SuppressWarnings("rawtypes") - List resourceList = query.getResultList(); - if (resourceList.isEmpty()) { - logger.debug("Record not found, resourceName: {}", resourceName); - fail("missing record"); - } - - // exist - sme = (StateManagementEntity) resourceList.get(0); - em.refresh(sme); - - logger.debug( - """ - ??? -- Retrieve StateManagementEntity from database -- - sme.getResourceName() = {} - sme.getAdminState() = {} - sme.getOpState() = {} - sme.getAvailStatus() = {} - sme.getStandbyStatus() = {}""", - sme.getResourceName(), sme.getAdminState(), sme.getOpState(), sme.getAvailStatus(), - sme.getStandbyStatus()); - - assertEquals(StateManagement.UNLOCKED, sme.getAdminState()); - assertEquals(StateManagement.ENABLED, sme.getOpState()); - assertEquals(StateManagement.NULL_VALUE, sme.getAvailStatus()); - assertEquals(StateManagement.NULL_VALUE, sme.getStandbyStatus()); - logger.debug("--"); - - et = em.getTransaction(); - et.begin(); - - sme.setStandbyStatus(StateManagement.COLD_STANDBY); - em.persist(sme); - em.flush(); - et.commit(); - - // Run the refreshStateAudit - im.executeRefreshStateAudit(); - - // The refreshStateAudit should run and change the state to - // unlocked,enabled,null,hotstandby - StateManagementEntity sme1 = null; - - Query query1 = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource"); - - query1.setParameter(RESOURCE, resourceName); - - @SuppressWarnings("rawtypes") - List resourceList1 = query1.getResultList(); - if (!resourceList1.isEmpty()) { - // exist - sme1 = (StateManagementEntity) resourceList1.get(0); - em.refresh(sme1); - logger.debug( - """ - ??? -- Retrieve StateManagementEntity from database -- - sme1.getResourceName() = {} - sme1.getAdminState() = {} - sme1.getOpState() = {} - sme1.getAvailStatus() = {} - sme1.getStandbyStatus() = {}""", - sme1.getResourceName(), sme1.getAdminState(), sme1.getOpState(), sme1.getAvailStatus(), - sme1.getStandbyStatus()); - - assertEquals(StateManagement.UNLOCKED, sme1.getAdminState()); - assertEquals(StateManagement.ENABLED, sme1.getOpState()); - assertEquals(StateManagement.NULL_VALUE, sme1.getAvailStatus()); - assertEquals(StateManagement.HOT_STANDBY, sme1.getStandbyStatus()); - logger.debug("--"); - } else { - logger.debug("Record not found, resourceName: {}", resourceName); - fail("record not found"); - } - - logger.debug("\nIntegrityMonitorTest: testRefreshStateAudit Exit\n\n"); - } - - @Test - void testStateCheck() throws Exception { - logger.debug("\nIntegrityMonitorTest: Entering testStateCheck\n\n"); - - // parameters are passed via a properties file - myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, GROUP1_DEP1); - myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, FALSE_STRING); - myProp.put(IntegrityMonitorProperties.FAILED_COUNTER_THRESHOLD, "1"); - /* - * The monitorInterval is set to 10 and the failedCounterThreshold is 1 because stateCheck() - * uses the faileCounterThreshold * monitorInterval to determine if an entry is stale, it - * will be stale after 10 seconds. - */ - myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "5"); - /* - * We accelerate the test transaction and write FPC intervals because we don't want there to - * be any chance of a FPC failure because of the short monitor interval - */ - myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "1"); - myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "2"); - // Disable the refresh state audit - myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1"); - // The maximum time in seconds to determine that a FPC entry is stale - myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "5"); - myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "5"); - - // Note: do ***NOT*** do waitStep() here - - // Add a group1 dependent resources to put an entry in the forward - // progress table - // This sets lastUpdated to the current time - ForwardProgressEntity fpe = new ForwardProgressEntity(); - fpe.setFpcCount(0); - fpe.setResourceName(GROUP1_DEP1); - et = em.getTransaction(); - et.begin(); - em.persist(fpe); - em.flush(); - et.commit(); - - new StateManagement(emf, GROUP1_DEP1); - - IntegrityMonitor im = makeMonitor(resourceName, myProp); - - im.evaluateSanity(); - - /* - * wait for FPManager to perform dependency health check. Once that's done, it - * should now be stale and the sanity check should fail - */ - waitCycles(DEPENDENCY_CHECK_CYCLES); - - assertThatThrownBy(im::evaluateSanity).isInstanceOf(IntegrityMonitorException.class); - - logger.debug("\n\ntestStateCheck: Exit\n\n"); - } - - @Test - void testGetAllForwardProgressEntity() throws Exception { - logger.debug("\nIntegrityMonitorTest: Entering testGetAllForwardProgressEntity\n\n"); - // parameters are passed via a properties file - myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, ""); - myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, FALSE_STRING); - // Disable the integrity monitor so it will not interfere - myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1"); - // Disable the refresh state audit - myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1"); - // Disable dependency checking so it does not interfere - myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1"); - // Disable the state audit - myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1"); - // Disable the test transaction - myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1"); - // Disable writing the FPC - myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1"); - - final IntegrityMonitor im = makeMonitor(resourceName, myProp); - waitCycles(1); - - logger.debug("\nIntegrityMonitorTest: Creating ForwardProgressEntity entries\n\n"); - // Add resource entries in the forward progress table - final ForwardProgressEntity fpe = new ForwardProgressEntity(); - final ForwardProgressEntity fpe2 = new ForwardProgressEntity(); - final ForwardProgressEntity fpe3 = new ForwardProgressEntity(); - fpe.setFpcCount(0); - fpe.setResourceName(SITE_A_PAP2); - fpe2.setFpcCount(0); - fpe2.setResourceName(SITE_B_PAP1); - fpe3.setFpcCount(0); - fpe3.setResourceName(SITE_B_PAP2); - et = em.getTransaction(); - et.begin(); - em.persist(fpe); - em.persist(fpe2); - em.persist(fpe3); - em.flush(); - et.commit(); - - logger.debug( - "\nIntegrityMonitorTest:testGetAllForwardProgressEntity Calling im.getAllForwardProgressEntity()\n\n"); - List<ForwardProgressEntity> fpeList = im.getAllForwardProgressEntity(); - - assertEquals(4, fpeList.size()); - - logger.debug("\nIntegrityMonitorTest: Exit testGetAllForwardProgressEntity\n\n"); - } - - @Test - void testStateAudit() throws Exception { - logger.debug("\nIntegrityMonitorTest: Entering testStateAudit\n\n"); - - // parameters are passed via a properties file - - // No Dependency Groups - myProp.put(IntegrityMonitorProperties.DEPENDENCY_GROUPS, ""); - // Don't use JMX - myProp.put(IntegrityMonitorProperties.TEST_VIA_JMX, FALSE_STRING); - // Disable the internal sanity monitoring. - myProp.put(IntegrityMonitorProperties.FP_MONITOR_INTERVAL, "-1"); - // Disable the dependency monitoring. - myProp.put(IntegrityMonitorProperties.CHECK_DEPENDENCY_INTERVAL, "-1"); - // Disable the refresh state audit - myProp.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, "-1"); - // Disable the test transaction - myProp.put(IntegrityMonitorProperties.TEST_TRANS_INTERVAL, "-1"); - // Disable the write FPC - myProp.put(IntegrityMonitorProperties.WRITE_FPC_INTERVAL, "-1"); - // Disable the State Audit we will call it directly - myProp.put(IntegrityMonitorProperties.STATE_AUDIT_INTERVAL_MS, "-1"); - // Max interval for use in deciding if a FPC entry is stale in seconds - myProp.put(IntegrityMonitorProperties.MAX_FPC_UPDATE_INTERVAL, "120"); - - final IntegrityMonitor im = makeMonitor(resourceName, myProp); - waitCycles(1); - - logger.debug("\nIntegrityMonitorTest: Creating ForwardProgressEntity entries\n\n"); - // Add resources to put an entry in the forward progress table - final Date staleDate = new Date(0); - final ForwardProgressEntity fpe1 = new ForwardProgressEntity(); - final ForwardProgressEntity fpe2 = new ForwardProgressEntity(); - final ForwardProgressEntity fpe3 = new ForwardProgressEntity(); - fpe1.setFpcCount(0); - fpe1.setResourceName(SITE_A_PAP2); - fpe2.setFpcCount(0); - fpe2.setResourceName(SITE_B_PAP1); - fpe3.setFpcCount(0); - fpe3.setResourceName(SITE_B_PAP2); - logger.debug("\nIntegrityMonitorTest: Creating StateManagementEntity entries\n\n"); - final StateManagementEntity sme1 = new StateManagementEntity(); - final StateManagementEntity sme2 = new StateManagementEntity(); - final StateManagementEntity sme3 = new StateManagementEntity(); - sme1.setResourceName(SITE_A_PAP2); - sme1.setAdminState(StateManagement.UNLOCKED); - sme1.setOpState(StateManagement.ENABLED); - sme1.setAvailStatus(StateManagement.NULL_VALUE); - sme1.setStandbyStatus(StateManagement.NULL_VALUE); - sme2.setResourceName(SITE_B_PAP1); - sme2.setAdminState(StateManagement.UNLOCKED); - sme2.setOpState(StateManagement.ENABLED); - sme2.setAvailStatus(StateManagement.NULL_VALUE); - sme2.setStandbyStatus(StateManagement.NULL_VALUE); - sme3.setResourceName(SITE_B_PAP2); - sme3.setAdminState(StateManagement.UNLOCKED); - sme3.setOpState(StateManagement.ENABLED); - sme3.setAvailStatus(StateManagement.NULL_VALUE); - sme3.setStandbyStatus(StateManagement.NULL_VALUE); - et = em.getTransaction(); - et.begin(); - em.persist(fpe1); - em.persist(fpe2); - em.persist(fpe3); - em.persist(sme1); - em.persist(sme2); - em.persist(sme3); - em.flush(); - et.commit(); - - Query updateQuery = em.createQuery( - "UPDATE ForwardProgressEntity f " + "SET f.lastUpdated = :newDate " + "WHERE f.resourceName=:resource"); - updateQuery.setParameter("newDate", staleDate, TemporalType.TIMESTAMP); - updateQuery.setParameter(RESOURCE, fpe1.getResourceName()); - - et = em.getTransaction(); - et.begin(); - updateQuery.executeUpdate(); - et.commit(); - - logger.debug("\nIntegrityMonitorTest:testStateAudit Calling im.getAllForwardProgressEntity()\n\n"); - List<ForwardProgressEntity> fpeList = im.getAllForwardProgressEntity(); - - logger.debug("\n\n"); - logger.debug("IntegrityMonitorTest:testStateAudit:ForwardProgressEntity entries"); - for (ForwardProgressEntity myFpe : fpeList) { - logger.debug("\n ResourceName: {}\n LastUpdated: {}", myFpe.getResourceName(), - myFpe.getLastUpdated()); - } - logger.debug("\n\n"); - - logger.debug("\nIntegrityMonitorTest:testStateAudit getting list of StateManagementEntity entries\n\n"); - Query query = em.createQuery("SELECT s FROM StateManagementEntity s"); - List<?> smeList = query.getResultList(); - - logger.debug("\n\n"); - logger.debug("IntegrityMonitorTest:testStateAudit:StateManagementEntity entries"); - for (Object mySme : smeList) { - StateManagementEntity tmpSme = (StateManagementEntity) mySme; - em.refresh(tmpSme); - logger.debug( - """ - - ResourceName: {} - AdminState: {} - OpState: {} - AvailStatus: {} - StandbyStatus: {}\ - """, - tmpSme.getResourceName(), tmpSme.getAdminState(), tmpSme.getOpState(), tmpSme.getAvailStatus(), - tmpSme.getStandbyStatus()); - } - logger.debug("\n\n"); - - em.refresh(sme1); - assertEquals(StateManagement.ENABLED, sme1.getOpState()); - - logger.debug("IntegrityMonitorTest:testStateAudit: calling stateAudit()"); - im.executeStateAudit(); - logger.debug("IntegrityMonitorTest:testStateAudit: call to stateAudit() complete"); - - logger.debug("\nIntegrityMonitorTest:testStateAudit getting list of StateManagementEntity entries\n\n"); - smeList = query.getResultList(); - - logger.debug("\n\n"); - logger.debug("IntegrityMonitorTest:testStateAudit:StateManagementEntity entries"); - for (Object mySme : smeList) { - StateManagementEntity tmpSme = (StateManagementEntity) mySme; - em.refresh(tmpSme); - logger.debug( - """ - - ResourceName: {} - AdminState: {} - OpState: {} - AvailStatus: {} - StandbyStatus: {}\ - """, - tmpSme.getResourceName(), tmpSme.getAdminState(), tmpSme.getOpState(), tmpSme.getAvailStatus(), - tmpSme.getStandbyStatus()); - } - logger.debug("\n\n"); - - em.refresh(sme1); - assertEquals(StateManagement.DISABLED, sme1.getOpState()); - - // Now let's add sme2 to the mix - updateQuery = em.createQuery( - "UPDATE ForwardProgressEntity f " + "SET f.lastUpdated = :newDate " + "WHERE f.resourceName=:resource"); - updateQuery.setParameter("newDate", staleDate, TemporalType.TIMESTAMP); - updateQuery.setParameter(RESOURCE, fpe2.getResourceName()); - - et = em.getTransaction(); - et.begin(); - updateQuery.executeUpdate(); - et.commit(); - - // Give it a chance to write the DB and run the audit - logger.debug("IntegrityMonitorTest:testStateAudit: (restart4) Running State Audit"); - waitCycles(1); - im.executeStateAudit(); - waitCycles(1); - logger.debug("IntegrityMonitorTest:testStateAudit: (restart4) State Audit complete"); - - // Now check its state - logger.debug( - "\nIntegrityMonitorTest:testStateAudit (restart4) getting list of StateManagementEntity entries\n\n"); - smeList = query.getResultList(); - - logger.debug("\n\n"); - logger.debug("IntegrityMonitorTest:testStateAudit:StateManagementEntity (restart4) entries"); - for (Object mySme : smeList) { - StateManagementEntity tmpSme = (StateManagementEntity) mySme; - em.refresh(tmpSme); - - logger.debug( - """ - - (restart4) ResourceName: {} - AdminState: {} - OpState: {} - AvailStatus: {} - StandbyStatus: {}\ - """, - tmpSme.getResourceName(), tmpSme.getAdminState(), tmpSme.getOpState(), tmpSme.getAvailStatus(), - tmpSme.getStandbyStatus()); - } - logger.debug("\n\n"); - - em.refresh(sme1); - assertEquals(StateManagement.DISABLED, sme1.getOpState()); - - em.refresh(sme2); - assertEquals(StateManagement.DISABLED, sme2.getOpState()); - - logger.info("\n\ntestStateAudit: Exit\n\n"); - } - - private IntegrityMonitor makeMonitor(String resourceName, Properties myProp) throws Exception { - IntegrityMonitor.deleteInstance(); - - monitorSem = new Semaphore(0); - junitSem = new Semaphore(0); - - IntegrityMonitor im = new IntegrityMonitor(resourceName, myProp) { - - @Override - protected void runStarted() throws InterruptedException { - monitorSem.acquire(); - - junitSem.release(); - monitorSem.acquire(); - } - - @Override - protected void monitorCompleted() throws InterruptedException { - junitSem.release(); - monitorSem.acquire(); - } - }; - - ReflectionTestUtils.setField(IntegrityMonitor.class, IM_INSTANCE_FIELD, im); - - // wait for the monitor thread to start - waitCycles(1); - - return im; - } - - /** - * Waits for several monitor cycles to complete. - * @param ncycles number of cycles to wait - * - * @throws InterruptedException if the thread is interrupted - */ - private void waitCycles(int ncycles) throws InterruptedException { - monitorSem.release(ncycles); - junitSem.tryAcquire(ncycles, WAIT_MS, TimeUnit.MILLISECONDS); - } -} diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java deleted file mode 100644 index eeb34be5..00000000 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Integrity Audit - * ================================================================================ - * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved. - * Modificaitons Copyright (C) 2023-2024 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.common.im; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.Persistence; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Properties; -import java.util.concurrent.Semaphore; -import java.util.concurrent.TimeUnit; -import org.onap.policy.common.utils.jpa.EntityTransCloser; -import org.onap.policy.common.utils.test.log.logback.ExtractAppender; -import org.onap.policy.common.utils.time.CurrentTime; -import org.onap.policy.common.utils.time.TestTime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.util.ReflectionTestUtils; - -/** - * All JUnits are designed to run in the local development environment where they have write - * privileges and can execute time-sensitive tasks. <p/> Many of the test verification steps are - * performed by scanning for items written to the log file. Rather than actually scan the log file, - * an {@link ExtractAppender} is used to monitor events that are logged and extract relevant items. - * In order to attach the appender to the debug log, it assumes that the debug log is a - * <i>logback</i> Logger configured per EELF. <p/> These tests use a temporary, in-memory DB, which - * is dropped once the tests complete. - */ -public class IntegrityMonitorTestBase { - private static Logger logger = LoggerFactory.getLogger(IntegrityMonitorTestBase.class); - - /** - * Name of the instance field within the IntegrityMonitor class. - */ - public static final String IM_INSTANCE_FIELD = "instance"; - - /** - * Name of the instance field within the MonitorTime class. - */ - public static final String TIME_INSTANCE_FIELD = "instance"; - - /** - * Directory containing the slf4j log files. - */ - private static final String SLF4J_LOG_DIR = "logs"; - - private static final String JMX_PORT_PROP = "com.sun.management.jmxremote.port"; - - /** - * Max time, in milliseconds, to wait for a latch to be triggered. - */ - protected static final long WAIT_MS = 5000L; - - /** - * Milliseconds between state refreshes. - */ - protected static final long REFRESH_INTERVAL_MS = 3L * IntegrityMonitor.CYCLE_INTERVAL_MILLIS; - - public static final String DEFAULT_DB_URL_PREFIX = "jdbc:h2:mem:"; - - protected static final String DB_DRIVER = "org.h2.Driver"; - protected static final String DB_USER = "testu"; - protected static final String DB_PASS = "testp"; - protected static final String SITE_NAME = "SiteA"; - protected static final String NODE_TYPE = "pap"; - - // will be defined by the test *Classes* - protected static String dbUrl; - - /** - * Persistence unit. - */ - protected static final String PERSISTENCE_UNIT = "schemaPU"; - - /** - * Properties to be used in all tests. - */ - protected static Properties properties; - - /** - * Entity manager factory pointing to the in-memory DB for A_SEQ_PU. - */ - protected static EntityManagerFactory emf; - - /** - * Entity manager factory pointing to the in-memory DB associated with emf. - */ - protected static EntityManager em; - - /** - * Test time used by tests in lieu of CurrentTime. - */ - private static TestTime testTime; - - /** - * Saved JMX port from system properties, to be restored once all tests complete. - */ - private static Object savedJmxPort; - - /** - * Saved time accessor, to be restored once all tests complete. - */ - private static CurrentTime savedTime; - - - /** - * Saves current configuration information and then sets new values. - * - * @param dbUrl the URL to the DB - * @throws IOException if an IO error occurs - */ - protected static void setUpBeforeClass(String dbUrl) throws IOException { - logger.info("setup"); - - final Properties systemProps = System.getProperties(); - - // truncate the logs - new FileOutputStream(SLF4J_LOG_DIR + "/audit.log").close(); - new FileOutputStream(SLF4J_LOG_DIR + "/debug.log").close(); - new FileOutputStream(SLF4J_LOG_DIR + "/error.log").close(); - new FileOutputStream(SLF4J_LOG_DIR + "/metrics.log").close(); - - IntegrityMonitorTestBase.dbUrl = dbUrl; - - // save data that we have to restore at the end of the test - savedJmxPort = systemProps.get(JMX_PORT_PROP); - savedTime = MonitorTime.getInstance(); - - systemProps.put(JMX_PORT_PROP, "9797"); - - IntegrityMonitor.setUnitTesting(true); - - testTime = new TestTime(); - ReflectionTestUtils.setField(MonitorTime.class, TIME_INSTANCE_FIELD, testTime); - - properties = new Properties(); - properties.put(IntegrityMonitorProperties.DB_DRIVER, DB_DRIVER); - properties.put(IntegrityMonitorProperties.DB_URL, dbUrl); - properties.put(IntegrityMonitorProperties.DB_USER, DB_USER); - properties.put(IntegrityMonitorProperties.DB_PWD, DB_PASS); - properties.put(IntegrityMonitorProperties.SITE_NAME, SITE_NAME); - properties.put(IntegrityMonitorProperties.NODE_TYPE, NODE_TYPE); - properties.put(IntegrityMonitorProperties.REFRESH_STATE_AUDIT_INTERVAL_MS, - String.valueOf(REFRESH_INTERVAL_MS)); - - emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT, makeProperties()); - - // keep this open so the in-memory DB stays around until all tests are - // done - em = emf.createEntityManager(); - - stopMonitor(); - } - - /** - * Restores the configuration to what it was before the test. - */ - protected static void tearDownAfterClass() { - Properties systemProps = System.getProperties(); - if (savedJmxPort == null) { - systemProps.remove(JMX_PORT_PROP); - - } else { - systemProps.put(JMX_PORT_PROP, savedJmxPort); - } - - ReflectionTestUtils.setField(MonitorTime.class, TIME_INSTANCE_FIELD, savedTime); - - IntegrityMonitor.setUnitTesting(false); - - stopMonitor(); - - // this should result in the in-memory DB being deleted - em.close(); - emf.close(); - } - - /** - * Sets up for a test, which includes deleting all records from the IntegrityAuditEntity table. - */ - protected void setUpTest() { - - // Clean up the DB - try (EntityTransCloser et = new EntityTransCloser(em.getTransaction())) { - - em.createQuery("Delete from StateManagementEntity").executeUpdate(); - em.createQuery("Delete from ForwardProgressEntity").executeUpdate(); - em.createQuery("Delete from ResourceRegistrationEntity").executeUpdate(); - - // commit transaction - et.commit(); - } - } - - /** - * Cleans up after a test, removing any ExtractAppenders from the logger and stopping any - * AuditThreads. - */ - protected void tearDownTest() { - stopMonitor(); - } - - /** - * Stops the IntegrityMonitor instance. - */ - private static void stopMonitor() { - try { - IntegrityMonitor.deleteInstance(); - - } catch (IntegrityMonitorException e) { - // no need to log, as exception was already logged - logger.debug("stopMonitor failed", e); - } - } - - /** - * Get current test time. - * - * @return the "current" time, in milliseconds - */ - protected static long getCurrentTestTime() { - return testTime.getMillis(); - } - - /** - * Makes a new Property set that's a clone of {@link #properties}. - * - * @return a new Property set containing all of a copy of all of the {@link #properties} - */ - protected static Properties makeProperties() { - Properties props = new Properties(); - props.putAll(properties); - return props; - } - - /** - * Waits for a semaphore to be acquired. - * - * @param sem semaphore to wait on - * @throws InterruptedException if the thread is interrupted - * @throws AssertionError if the semaphore was not acquired within the allotted time - */ - protected void waitSem(Semaphore sem) throws InterruptedException { - assertTrue(sem.tryAcquire(WAIT_MS, TimeUnit.MILLISECONDS)); - } -} diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/MonitorTimeTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/MonitorTimeTest.java deleted file mode 100644 index a8baae40..00000000 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/MonitorTimeTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Integrity Monitor - * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.common.im; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -import org.junit.jupiter.api.Test; -import org.onap.policy.common.utils.time.CurrentTime; - -/** - * Class that tests MonitorTime. - */ -class MonitorTimeTest { - - @Test - void testGetInstance() { - CurrentTime inst = MonitorTime.getInstance(); - assertNotNull(inst); - - assertEquals(inst, MonitorTime.getInstance()); - } - -} diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateChangeNotifierTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateChangeNotifierTest.java deleted file mode 100644 index 8a71d45a..00000000 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateChangeNotifierTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.common.im; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertSame; -import static org.mockito.Mockito.mock; - -import org.junit.jupiter.api.Test; - -class StateChangeNotifierTest { - private static final String MESSAGE = "my message"; - - private StateChangeNotifier scn; - private StateManagement sm; - - @Test - void test() { - sm = mock(StateManagement.class); - scn = new StateChangeNotifier(); - - scn.update(sm, MESSAGE); - - scn.handleStateChange(); - - assertSame(sm, scn.getStateManagement()); - assertEquals(MESSAGE, scn.getMessage()); - } - -} diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementEntityTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementEntityTest.java deleted file mode 100644 index 266b3221..00000000 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementEntityTest.java +++ /dev/null @@ -1,138 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Integrity Monitor - * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2023-2024 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.common.im; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import jakarta.persistence.Query; -import java.util.List; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.onap.policy.common.im.jpa.StateManagementEntity; -import org.onap.policy.common.utils.jpa.EntityTransCloser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class StateManagementEntityTest extends IntegrityMonitorTestBase { - private static final Logger logger = LoggerFactory.getLogger(StateManagementEntityTest.class); - - /** - * Set up for the test class. - */ - @BeforeAll - public static void setUpClass() throws Exception { - IntegrityMonitorTestBase - .setUpBeforeClass(DEFAULT_DB_URL_PREFIX + StateManagementEntityTest.class.getSimpleName()); - - } - - /** - * Tear down after the test class. - */ - @AfterAll - public static void tearDownClass() { - IntegrityMonitorTestBase.tearDownAfterClass(); - } - - /** - * Set up for the test cases. - */ - @BeforeEach - public void setUp() { - super.setUpTest(); - } - - /** - * Tear down after the test cases. - */ - @AfterEach - public void tearDown() { - super.tearDownTest(); - } - - @Test - void testJpa() { - logger.debug("\n??? logger.infor StateManagementEntityTest: Entering\n\n"); - - // Define the resourceName for the StateManagement constructor - String resourceName = "test_resource1"; - - // - logger.debug("Create StateManagementEntity, resourceName: {}", resourceName); - logger.debug("??? instantiate StateManagementEntity object"); - StateManagementEntity sme = new StateManagementEntity(); - - logger.debug("??? setResourceName : {}", resourceName); - sme.setResourceName(resourceName); - logger.debug("??? getResourceName : {}", sme.getResourceName()); - - sme.setAdminState(StateManagement.UNLOCKED); - assertEquals(StateManagement.UNLOCKED, sme.getAdminState()); - - sme.setOpState(StateManagement.ENABLED); - assertEquals(StateManagement.ENABLED, sme.getOpState()); - - sme.setAvailStatus(StateManagement.NULL_VALUE); - assertEquals(StateManagement.NULL_VALUE, sme.getAvailStatus()); - - sme.setStandbyStatus(StateManagement.COLD_STANDBY); - assertEquals(StateManagement.COLD_STANDBY, sme.getStandbyStatus()); - - try (EntityTransCloser et = new EntityTransCloser(em.getTransaction())) { - logger.debug("??? before persist"); - em.persist(sme); - logger.debug("??? after persist"); - - em.flush(); - logger.debug("??? after flush"); - - et.commit(); - logger.debug("??? after commit"); - } - - Query query = em.createQuery("Select p from StateManagementEntity p where p.resourceName=:resource"); - - query.setParameter("resource", resourceName); - - // Just test that we are retrieving the right object - @SuppressWarnings("rawtypes") - List resourceList = query.getResultList(); - if (!resourceList.isEmpty()) { - // exist - StateManagementEntity sme2 = (StateManagementEntity) resourceList.get(0); - - assertEquals(sme.getResourceName(), sme2.getResourceName()); - assertEquals(sme.getAdminState(), sme2.getAdminState()); - assertEquals(sme.getOpState(), sme2.getOpState()); - assertEquals(sme.getAvailStatus(), sme2.getAvailStatus()); - assertEquals(sme.getStandbyStatus(), sme2.getStandbyStatus()); - logger.debug("--"); - } else { - logger.debug("Record not found, resourceName: {}", resourceName); - } - - logger.debug("\n\nJpaTest: Exit\n\n"); - } -} diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java deleted file mode 100644 index 5dfd01f3..00000000 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java +++ /dev/null @@ -1,297 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Integrity Monitor - * ================================================================================ - * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. - * Modifications Copyright (C) 2023-2024 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.common.im; - -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.EntityTransaction; -import jakarta.persistence.PersistenceException; -import jakarta.persistence.QueryTimeoutException; -import jakarta.persistence.TypedQuery; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; -import org.onap.policy.common.im.jpa.StateManagementEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/* - * All JUnits are designed to run in the local development environment where they have write - * privileges and can execute time-sensitive tasks. - */ -class StateManagementTest extends IntegrityMonitorTestBase { - private static final String LOCKED_DISABLED_FAILED_COLDSTANDBY = "locked,disabled,failed,coldstandby"; - private static final String UNLOCKED_DISABLED_FAILED_COLDSTANDBY = "unlocked,disabled,failed,coldstandby"; - private static final String UNLOCKED_ENABLED_NULL_HOTSTANDBY = "unlocked,enabled,null,hotstandby"; - private static final String UNLOCKED_ENABLED_NULL_NULL = "unlocked,enabled,null,null"; - private static final String UNLOCKED_ENABLED_NULL_PROVIDINGSERVICE = "unlocked,enabled,null,providingservice"; - private static final String TEST_RESOURCE_NAME = "test_resource1"; - - private static final Logger logger = LoggerFactory.getLogger(StateManagementTest.class); - // - - @BeforeAll - public static void setUpClass() throws Exception { - IntegrityMonitorTestBase.setUpBeforeClass(DEFAULT_DB_URL_PREFIX + StateManagementTest.class.getSimpleName()); - - } - - @AfterAll - public static void tearDownClass() { - IntegrityMonitorTestBase.tearDownAfterClass(); - } - - @BeforeEach - public void setUp() { - super.setUpTest(); - } - - @AfterEach - public void tearDown() { - super.tearDownTest(); - } - - @Test - void test() throws Exception { - logger.info("\n\nlogger.infor StateManagementTest: Entering\n\n"); - - // These parameters are in a properties file - try { - final StateManagement sm = new StateManagement(emf, TEST_RESOURCE_NAME); - test_1(sm); - test_2(sm); - } catch (final Exception ex) { - logger.error("Exception: {}", ex.toString()); - throw ex; - } - - logger.info("\n\nStateManagementTest: Exit\n\n"); - } - - private void test_1(final StateManagement sm) throws IntegrityMonitorException { - logger.info("\n??? initial state"); - assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm)); - - logger.info("\n??? test lock()"); - sm.lock(); - assertEquals("locked,enabled,null,null", makeString(sm)); - - logger.info("\n??? test unlock()"); - sm.unlock(); - assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm)); - - logger.info("\n??? test enableNotFailed()"); - sm.enableNotFailed(); - assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm)); - - logger.info("\n??? test disableFailed()"); - sm.disableFailed(); - assertEquals("unlocked,disabled,failed,null", makeString(sm)); - - // P4 If promote() is called while either the opState is disabled or - // the adminState is locked, - // the standbystatus shall transition to coldstandby and a - // StandbyStatusException shall be thrown - logger.info("\n??? promote() test case P4"); - sm.disableFailed(); - sm.lock(); - assertThatThrownBy(sm::promote).isInstanceOf(IntegrityMonitorException.class); - - assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm)); - - // P3 If promote() is called while standbyStatus is coldstandby, the - // state shall not transition - // and a StandbyStatusException shall be thrown - logger.info("\n??? promote() test case P3"); - assertThatThrownBy(sm::promote).isInstanceOf(IntegrityMonitorException.class); - assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm)); - - // P2 If promote() is called while the standbyStatus is null and the - // opState is enabled and adminState is unlocked, - // the state shall transition to providingservice - logger.info("\n??? promote() test case P2"); - final StateManagement sm2 = new StateManagement(emf, "test_resource2"); - sm2.enableNotFailed(); - sm2.unlock(); - assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm2)); - sm2.promote(); - assertEquals(UNLOCKED_ENABLED_NULL_PROVIDINGSERVICE, makeString(sm2)); - - // P5 If promote() is called while standbyStatus is - // providingservice, no action is taken - logger.info("\n??? promote() test case P5"); - sm2.promote(); - assertEquals(UNLOCKED_ENABLED_NULL_PROVIDINGSERVICE, makeString(sm2)); - - // D1 If demote() is called while standbyStatus is providingservice, - // the state shall transition to hotstandby - logger.info("\n??? demote() test case D1"); - sm2.demote(); - assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(sm2)); - - // D4 If demote() is called while standbyStatus is hotstandby, no - // action is taken - logger.info("\n??? demote() test case D4"); - sm2.demote(); - assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(sm2)); - } - - private void test_2(final StateManagement sm) throws IntegrityMonitorException { - // D3 If demote() is called while standbyStatus is null and - // adminState is locked or opState is disabled, - // the state shall transition to coldstandby - logger.info("\n??? demote() test case D3"); - final StateManagement sm3 = new StateManagement(emf, "test_resource3"); - sm3.lock(); - sm3.disableFailed(); - sm3.demote(); - assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm3)); - - // D5 If demote() is called while standbyStatus is coldstandby, no - // action is taken - logger.info("\n??? demote() test case D5"); - sm3.demote(); - assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm3)); - - // D2 If demote() is called while standbyStatus is null and - // adminState is unlocked and opState is enabled, - // the state shall transition to hotstandby - logger.info("\n??? demote() test case D2"); - final StateManagement sm4 = new StateManagement(emf, "test_resource4"); - sm4.unlock(); - sm4.enableNotFailed(); - assertEquals(UNLOCKED_ENABLED_NULL_NULL, makeString(sm4)); - sm4.demote(); - assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(sm4)); - - // P1 If promote() is called while standbyStatus is hotstandby, the - // state shall transition to providingservice. - logger.info("\n??? promote() test case P1"); - sm4.promote(); - assertEquals(UNLOCKED_ENABLED_NULL_PROVIDINGSERVICE, makeString(sm4)); - - // State change notification - logger.info("\n??? State change notification test case 1 - lock()"); - final StateChangeNotifier stateChangeNotifier = new StateChangeNotifier(); - sm.addObserver(stateChangeNotifier); - sm.lock(); - assertEquals(LOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); - - logger.info("\n??? State change notification test case 2 - unlock()"); - sm.unlock(); - assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); - - logger.info("\n??? State change notification test case 3 - enabled()"); - sm.enableNotFailed(); - assertEquals(UNLOCKED_ENABLED_NULL_HOTSTANDBY, makeString(stateChangeNotifier.getStateManagement())); - - logger.info("\n??? State change notification test case 4 - disableFailed()"); - sm.disableFailed(); - assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); - - logger.info("\n??? State change notification test case 5 - demote()"); - sm.demote(); - assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(stateChangeNotifier.getStateManagement())); - - logger.info("\n??? State change notification test case 6 - promote()"); - assertThatThrownBy(sm::promote).isInstanceOf(IntegrityMonitorException.class); - assertEquals(UNLOCKED_DISABLED_FAILED_COLDSTANDBY, makeString(sm)); - } - - @Test - @SuppressWarnings("unchecked") - void test_StateManagementInitialization_ThrowException_ifEntityManagerCreateQuerythrowsAnyException() { - assertThatThrownBy(() -> { - final EntityManager mockedEm = getMockedEntityManager(); - final EntityManagerFactory mockedEmf = getMockedEntityManagerFactory(mockedEm); - - doThrow(PersistenceException.class).when(mockedEm).createQuery(anyString(), - any(StateManagementEntity.class.getClass())); - - new StateManagement(mockedEmf, TEST_RESOURCE_NAME); - }).isInstanceOf(StateManagementException.class); - } - - @Test - @SuppressWarnings("unchecked") - void test_StateManagementInitialization_ThrowStateManagementException_ifEntityManagerThrowsAnyException() { - assertThatThrownBy(() -> { - final EntityManager mockedEm = getMockedEntityManager(); - final EntityManagerFactory mockedEmf = getMockedEntityManagerFactory(mockedEm); - final TypedQuery<StateManagementEntity> mockedQuery = mock(TypedQuery.class); - - when(mockedQuery.setFlushMode(Mockito.any())).thenReturn(mockedQuery); - when(mockedQuery.setLockMode(Mockito.any())).thenReturn(mockedQuery); - when(mockedEm.createQuery(anyString(), any(StateManagementEntity.class.getClass()))) - .thenReturn(mockedQuery); - - doThrow(QueryTimeoutException.class).when(mockedQuery).getResultList(); - - new StateManagement(mockedEmf, TEST_RESOURCE_NAME); - }).isInstanceOf(StateManagementException.class); - } - - private EntityManager getMockedEntityManager() { - final EntityManager mockedEm = mock(EntityManager.class); - final EntityTransaction mockedTransaction = mock(EntityTransaction.class); - - when(mockedEm.getTransaction()).thenReturn(mockedTransaction); - return mockedEm; - } - - private EntityManagerFactory getMockedEntityManagerFactory(final EntityManager entityManager) { - final EntityManagerFactory mockedEmf = mock(EntityManagerFactory.class); - when(mockedEmf.createEntityManager()).thenReturn(entityManager); - - return mockedEmf; - - } - - /** - * Converts a state element to a comma-separated string. - * - * @param sm element to be converted - * @return a string representing the element - */ - private String makeString(final StateManagement sm) { - if (sm == null) { - return null; - } - - return sm.getAdminState() - + ',' + sm.getOpState() - + ',' + sm.getAvailStatus() - + ',' + sm.getStandbyStatus(); - } -} diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateTransitionTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateTransitionTest.java deleted file mode 100644 index 8523c9e4..00000000 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateTransitionTest.java +++ /dev/null @@ -1,3566 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Integrity Monitor - * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.common.im; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.Test; - -/* - * All JUnits are designed to run in the local development environment - * where they have write privileges and can execute time-sensitive - * tasks. - */ -class StateTransitionTest { - private static final String HOTSTANDBY = "hotstandby"; - private static final String LOCKED = "locked"; - private static final String PROMOTE = "promote"; - private static final String PROVIDINGSERVICE = "providingservice"; - private static final String UNLOCK = "unlock"; - private static final String UNLOCKED = "unlocked"; - private static final String COLDSTANDBY = "coldstandby"; - private static final String DEMOTE = "demote"; - private static final String DEPENDENCY = "dependency"; - private static final String DEPENDENCY_FAILED = "dependency,failed"; - private static final String DISABLE_DEPENDENCY = "disableDependency"; - private static final String DISABLE_FAILED = "disableFailed"; - private static final String DISABLED = "disabled"; - private static final String ENABLE_NO_DEPENDENCY = "enableNoDependency"; - private static final String ENABLE_NOT_FAILED = "enableNotFailed"; - private static final String ENABLED = "enabled"; - private static final String FAILED = "failed"; - - @Test - void testBad() throws StateTransitionException { - // bad test case - assertEquals("coldstandby,locked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", COLDSTANDBY, "lock")); - - } - - @Test - void test1() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", "null", "lock")); - - } - - @Test - void test2() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", "null", UNLOCK)); - - } - - @Test - void test3() throws StateTransitionException { - assertEquals("null,unlocked,disabled,failed,", makeString(UNLOCKED, ENABLED, "null", "null", DISABLE_FAILED)); - - } - - @Test - void test4() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test5() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, "null", "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test6() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test7() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", "null", PROMOTE)); - - } - - @Test - void test8() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", "null", DEMOTE)); - - } - - @Test - void test9() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", COLDSTANDBY, DEMOTE)); - - } - - @Test - void test10() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", COLDSTANDBY, UNLOCK)); - - } - - @Test - void test11() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, "null", COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test12() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test13() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, "null", COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test14() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test15() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", COLDSTANDBY, PROMOTE)); - - } - - @Test - void test16() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", COLDSTANDBY, DEMOTE)); - - } - - @Test - void test17() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", HOTSTANDBY, DEMOTE)); - - } - - @Test - void test18() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", HOTSTANDBY, UNLOCK)); - - } - - @Test - void test19() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, "null", HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test20() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test21() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, "null", HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test22() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test23() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", HOTSTANDBY, PROMOTE)); - - } - - @Test - void test24() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, "null", HOTSTANDBY, DEMOTE)); - - } - - @Test - void test25() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test26() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test27() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, "null", PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test28() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test29() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, "null", PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test30() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test31() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test32() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, "null", PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test33() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, FAILED, "null", DEMOTE)); - - } - - @Test - void test34() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, FAILED, "null", UNLOCK)); - - } - - @Test - void test35() throws StateTransitionException { - assertEquals("null,unlocked,disabled,failed,", makeString(UNLOCKED, ENABLED, FAILED, "null", DISABLE_FAILED)); - - } - - @Test - void test36() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, FAILED, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test37() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, FAILED, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test38() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test39() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, FAILED, "null", PROMOTE)); - - } - - @Test - void test40() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, FAILED, "null", DEMOTE)); - - } - - @Test - void test41() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test42() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, FAILED, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test43() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, FAILED, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test44() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test45() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, FAILED, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test46() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test47() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test48() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test49() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test50() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, FAILED, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test51() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, FAILED, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test52() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test53() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, FAILED, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test54() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test55() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test56() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test57() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test58() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test59() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, FAILED, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test60() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test61() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, FAILED, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test62() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test63() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test64() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test65() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, DEPENDENCY, "null", DEMOTE)); - - } - - @Test - void test66() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, DEPENDENCY, "null", UNLOCK)); - - } - - @Test - void test67() throws StateTransitionException { - assertEquals("null,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, "null", DISABLE_FAILED)); - - } - - @Test - void test68() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test69() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test70() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test71() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, "null", PROMOTE)); - - } - - @Test - void test72() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, DEPENDENCY, "null", DEMOTE)); - - } - - @Test - void test73() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test74() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test75() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test76() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test77() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test78() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test79() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test80() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test81() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test82() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test83() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test84() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test85() throws StateTransitionException { - assertEquals("hotstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test86() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test87() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test88() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test89() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test90() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test91() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test92() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test93() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test94() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test95() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test96() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test97() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, "null", DEMOTE)); - - } - - @Test - void test98() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, "null", UNLOCK)); - - } - - @Test - void test99() throws StateTransitionException { - assertEquals("null,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, "null", DISABLE_FAILED)); - - } - - @Test - void test100() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test101() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test102() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test103() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, "null", PROMOTE)); - - } - - @Test - void test104() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, "null", DEMOTE)); - - } - - @Test - void test105() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test106() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test107() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test108() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test109() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test110() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test111() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test112() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test113() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test114() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test115() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test116() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test117() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test118() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test119() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test120() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test121() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test122() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test123() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test124() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test125() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test126() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test127() throws StateTransitionException { - assertEquals("providingservice,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test128() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test129() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", makeString(UNLOCKED, DISABLED, "null", "null", DEMOTE)); - - } - - @Test - void test130() throws StateTransitionException { - assertEquals("null,unlocked,disabled,null,", makeString(UNLOCKED, DISABLED, "null", "null", UNLOCK)); - - } - - @Test - void test131() throws StateTransitionException { - assertEquals("null,unlocked,disabled,failed,", makeString(UNLOCKED, DISABLED, "null", "null", DISABLE_FAILED)); - - } - - @Test - void test132() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(UNLOCKED, DISABLED, "null", "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test133() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, "null", "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test134() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, "null", "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test135() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,StandbyStatusException", - makeString(UNLOCKED, DISABLED, "null", "null", PROMOTE)); - - } - - @Test - void test136() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", makeString(UNLOCKED, DISABLED, "null", "null", DEMOTE)); - - } - - @Test - void test137() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", - makeString(UNLOCKED, DISABLED, "null", COLDSTANDBY, DEMOTE)); - - } - - @Test - void test138() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", - makeString(UNLOCKED, DISABLED, "null", COLDSTANDBY, UNLOCK)); - - } - - @Test - void test139() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, "null", COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test140() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, "null", COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test141() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, "null", COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test142() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, "null", COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test143() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,StandbyStatusException", - makeString(UNLOCKED, DISABLED, "null", COLDSTANDBY, PROMOTE)); - - } - - @Test - void test144() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", - makeString(UNLOCKED, DISABLED, "null", COLDSTANDBY, DEMOTE)); - - } - - @Test - void test145() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", makeString(UNLOCKED, DISABLED, "null", HOTSTANDBY, DEMOTE)); - - } - - @Test - void test146() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", makeString(UNLOCKED, DISABLED, "null", HOTSTANDBY, UNLOCK)); - - } - - @Test - void test147() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, "null", HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test148() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, "null", HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test149() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, "null", HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test150() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, "null", HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test151() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,StandbyStatusException", - makeString(UNLOCKED, DISABLED, "null", HOTSTANDBY, PROMOTE)); - - } - - @Test - void test152() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", makeString(UNLOCKED, DISABLED, "null", HOTSTANDBY, DEMOTE)); - - } - - @Test - void test153() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", - makeString(UNLOCKED, DISABLED, "null", PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test154() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", - makeString(UNLOCKED, DISABLED, "null", PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test155() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, "null", PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test156() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, "null", PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test157() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, "null", PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test158() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, "null", PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test159() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,StandbyStatusException", - makeString(UNLOCKED, DISABLED, "null", PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test160() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", - makeString(UNLOCKED, DISABLED, "null", PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test161() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", makeString(UNLOCKED, DISABLED, FAILED, "null", DEMOTE)); - - } - - @Test - void test162() throws StateTransitionException { - assertEquals("null,unlocked,disabled,failed,", makeString(UNLOCKED, DISABLED, FAILED, "null", UNLOCK)); - - } - - @Test - void test163() throws StateTransitionException { - assertEquals("null,unlocked,disabled,failed,", makeString(UNLOCKED, DISABLED, FAILED, "null", DISABLE_FAILED)); - - } - - @Test - void test164() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(UNLOCKED, DISABLED, FAILED, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test165() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, FAILED, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test166() throws StateTransitionException { - assertEquals("null,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test167() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,StandbyStatusException", - makeString(UNLOCKED, DISABLED, FAILED, "null", PROMOTE)); - - } - - @Test - void test168() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", makeString(UNLOCKED, DISABLED, FAILED, "null", DEMOTE)); - - } - - @Test - void test169() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test170() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test171() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test172() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, FAILED, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test173() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, FAILED, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test174() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test175() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,StandbyStatusException", - makeString(UNLOCKED, DISABLED, FAILED, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test176() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test177() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test178() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test179() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test180() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, FAILED, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test181() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, FAILED, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test182() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test183() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,StandbyStatusException", - makeString(UNLOCKED, DISABLED, FAILED, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test184() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test185() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test186() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test187() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test188() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, FAILED, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test189() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, FAILED, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test190() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test191() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,StandbyStatusException", - makeString(UNLOCKED, DISABLED, FAILED, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test192() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test193() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, "null", DEMOTE)); - - } - - @Test - void test194() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,", makeString(UNLOCKED, DISABLED, DEPENDENCY, "null", UNLOCK)); - - } - - @Test - void test195() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, "null", DISABLE_FAILED)); - - } - - @Test - void test196() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test197() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test198() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test199() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,StandbyStatusException", - makeString(UNLOCKED, DISABLED, DEPENDENCY, "null", PROMOTE)); - - } - - @Test - void test200() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, "null", DEMOTE)); - - } - - @Test - void test201() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test202() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test203() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test204() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test205() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test206() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test207() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,StandbyStatusException", - makeString(UNLOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test208() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test209() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test210() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test211() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test212() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test213() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test214() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test215() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,StandbyStatusException", - makeString(UNLOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test216() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test217() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test218() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test219() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test220() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test221() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test222() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test223() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,StandbyStatusException", - makeString(UNLOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test224() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test225() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, "null", DEMOTE)); - - } - - @Test - void test226() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, "null", UNLOCK)); - - } - - @Test - void test227() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, "null", DISABLE_FAILED)); - - } - - @Test - void test228() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test229() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test230() throws StateTransitionException { - assertEquals("null,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test231() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,StandbyStatusException", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, "null", PROMOTE)); - - } - - @Test - void test232() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, "null", DEMOTE)); - - } - - @Test - void test233() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test234() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test235() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test236() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test237() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test238() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test239() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,StandbyStatusException", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test240() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test241() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test242() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test243() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test244() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test245() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test246() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test247() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,StandbyStatusException", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test248() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test249() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test250() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test251() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test252() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test253() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test254() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test255() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,StandbyStatusException", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test256() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(UNLOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test257() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, "null", "null", DEMOTE)); - - } - - @Test - void test258() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(LOCKED, ENABLED, "null", "null", UNLOCK)); - - } - - @Test - void test259() throws StateTransitionException { - assertEquals("null,locked,disabled,failed,", makeString(LOCKED, ENABLED, "null", "null", DISABLE_FAILED)); - - } - - @Test - void test260() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", makeString(LOCKED, ENABLED, "null", "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test261() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, "null", "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test262() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", makeString(LOCKED, ENABLED, "null", "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test263() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, "null", "null", PROMOTE)); - - } - - @Test - void test264() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, "null", "null", DEMOTE)); - - } - - @Test - void test265() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, "null", COLDSTANDBY, DEMOTE)); - - } - - @Test - void test266() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(LOCKED, ENABLED, "null", COLDSTANDBY, UNLOCK)); - - } - - @Test - void test267() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, "null", COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test268() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, "null", COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test269() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, "null", COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test270() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, "null", COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test271() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, "null", COLDSTANDBY, PROMOTE)); - - } - - @Test - void test272() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, "null", COLDSTANDBY, DEMOTE)); - - } - - @Test - void test273() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, "null", HOTSTANDBY, DEMOTE)); - - } - - @Test - void test274() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(LOCKED, ENABLED, "null", HOTSTANDBY, UNLOCK)); - - } - - @Test - void test275() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, "null", HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test276() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, "null", HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test277() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, "null", HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test278() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, "null", HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test279() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, "null", HOTSTANDBY, PROMOTE)); - - } - - @Test - void test280() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, "null", HOTSTANDBY, DEMOTE)); - - } - - @Test - void test281() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, "null", PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test282() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(LOCKED, ENABLED, "null", PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test283() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, "null", PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test284() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, "null", PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test285() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, "null", PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test286() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, "null", PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test287() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, "null", PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test288() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, "null", PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test289() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, "null", DEMOTE)); - - } - - @Test - void test290() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, "null", UNLOCK)); - - } - - @Test - void test291() throws StateTransitionException { - assertEquals("null,locked,disabled,failed,", makeString(LOCKED, ENABLED, FAILED, "null", DISABLE_FAILED)); - - } - - @Test - void test292() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test293() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, FAILED, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test294() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test295() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, FAILED, "null", PROMOTE)); - - } - - @Test - void test296() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, "null", DEMOTE)); - - } - - @Test - void test297() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test298() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test299() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, FAILED, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test300() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, FAILED, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test301() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, FAILED, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test302() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, FAILED, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test303() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, FAILED, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test304() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test305() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test306() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test307() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, FAILED, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test308() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, FAILED, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test309() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, FAILED, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test310() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, FAILED, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test311() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, FAILED, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test312() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test313() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test314() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(LOCKED, ENABLED, FAILED, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test315() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, FAILED, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test316() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, FAILED, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test317() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, FAILED, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test318() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, FAILED, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test319() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, FAILED, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test320() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test321() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, DEPENDENCY, "null", DEMOTE)); - - } - - @Test - void test322() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(LOCKED, ENABLED, DEPENDENCY, "null", UNLOCK)); - - } - - @Test - void test323() throws StateTransitionException { - assertEquals("null,locked,disabled,failed,", makeString(LOCKED, ENABLED, DEPENDENCY, "null", DISABLE_FAILED)); - - } - - @Test - void test324() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", makeString(LOCKED, ENABLED, DEPENDENCY, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test325() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, DEPENDENCY, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test326() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test327() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, DEPENDENCY, "null", PROMOTE)); - - } - - @Test - void test328() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, DEPENDENCY, "null", DEMOTE)); - - } - - @Test - void test329() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test330() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(LOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test331() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test332() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test333() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test334() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test335() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test336() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, DEPENDENCY, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test337() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test338() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", makeString(LOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test339() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test340() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test341() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test342() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test343() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test344() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", makeString(LOCKED, ENABLED, DEPENDENCY, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test345() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test346() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test347() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test348() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test349() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test350() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test351() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test352() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test353() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, "null", DEMOTE)); - - } - - @Test - void test354() throws StateTransitionException { - assertEquals("null,unlocked,enabled,null,", makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, "null", UNLOCK)); - - } - - @Test - void test355() throws StateTransitionException { - assertEquals("null,locked,disabled,failed,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, "null", DISABLE_FAILED)); - - } - - @Test - void test356() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test357() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test358() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test359() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, "null", PROMOTE)); - - } - - @Test - void test360() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, "null", DEMOTE)); - - } - - @Test - void test361() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test362() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test363() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test364() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test365() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test366() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test367() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test368() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test369() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test370() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test371() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test372() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test373() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test374() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test375() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test376() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test377() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test378() throws StateTransitionException { - assertEquals("hotstandby,unlocked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test379() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test380() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test381() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test382() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test383() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,StandbyStatusException", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test384() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, ENABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test385() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,", makeString(LOCKED, DISABLED, "null", "null", DEMOTE)); - - } - - @Test - void test386() throws StateTransitionException { - assertEquals("null,unlocked,disabled,null,", makeString(LOCKED, DISABLED, "null", "null", UNLOCK)); - - } - - @Test - void test387() throws StateTransitionException { - assertEquals("null,locked,disabled,failed,", makeString(LOCKED, DISABLED, "null", "null", DISABLE_FAILED)); - - } - - @Test - void test388() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", makeString(LOCKED, DISABLED, "null", "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test389() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, "null", "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test390() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", makeString(LOCKED, DISABLED, "null", "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test391() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,StandbyStatusException", - makeString(LOCKED, DISABLED, "null", "null", PROMOTE)); - - } - - @Test - void test392() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,", makeString(LOCKED, DISABLED, "null", "null", DEMOTE)); - - } - - @Test - void test393() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,", makeString(LOCKED, DISABLED, "null", COLDSTANDBY, DEMOTE)); - - } - - @Test - void test394() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", makeString(LOCKED, DISABLED, "null", COLDSTANDBY, UNLOCK)); - - } - - @Test - void test395() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, "null", COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test396() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, "null", COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test397() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, "null", COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test398() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, "null", COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test399() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,StandbyStatusException", - makeString(LOCKED, DISABLED, "null", COLDSTANDBY, PROMOTE)); - - } - - @Test - void test400() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,", makeString(LOCKED, DISABLED, "null", COLDSTANDBY, DEMOTE)); - - } - - @Test - void test401() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,", makeString(LOCKED, DISABLED, "null", HOTSTANDBY, DEMOTE)); - - } - - @Test - void test402() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", makeString(LOCKED, DISABLED, "null", HOTSTANDBY, UNLOCK)); - - } - - @Test - void test403() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, "null", HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test404() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, "null", HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test405() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, "null", HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test406() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, "null", HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test407() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,StandbyStatusException", - makeString(LOCKED, DISABLED, "null", HOTSTANDBY, PROMOTE)); - - } - - @Test - void test408() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,", makeString(LOCKED, DISABLED, "null", HOTSTANDBY, DEMOTE)); - - } - - @Test - void test409() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,", - makeString(LOCKED, DISABLED, "null", PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test410() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,null,", - makeString(LOCKED, DISABLED, "null", PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test411() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, "null", PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test412() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, "null", PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test413() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, "null", PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test414() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, "null", PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test415() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,StandbyStatusException", - makeString(LOCKED, DISABLED, "null", PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test416() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,null,", - makeString(LOCKED, DISABLED, "null", PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test417() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", makeString(LOCKED, DISABLED, FAILED, "null", DEMOTE)); - - } - - @Test - void test418() throws StateTransitionException { - assertEquals("null,unlocked,disabled,failed,", makeString(LOCKED, DISABLED, FAILED, "null", UNLOCK)); - - } - - @Test - void test419() throws StateTransitionException { - assertEquals("null,locked,disabled,failed,", makeString(LOCKED, DISABLED, FAILED, "null", DISABLE_FAILED)); - - } - - @Test - void test420() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", makeString(LOCKED, DISABLED, FAILED, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test421() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, FAILED, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test422() throws StateTransitionException { - assertEquals("null,locked,disabled,failed,", - makeString(LOCKED, DISABLED, FAILED, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test423() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,StandbyStatusException", - makeString(LOCKED, DISABLED, FAILED, "null", PROMOTE)); - - } - - @Test - void test424() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", makeString(LOCKED, DISABLED, FAILED, "null", DEMOTE)); - - } - - @Test - void test425() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", makeString(LOCKED, DISABLED, FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test426() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(LOCKED, DISABLED, FAILED, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test427() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, FAILED, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test428() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, FAILED, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test429() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, FAILED, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test430() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, FAILED, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test431() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,StandbyStatusException", - makeString(LOCKED, DISABLED, FAILED, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test432() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", makeString(LOCKED, DISABLED, FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test433() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", makeString(LOCKED, DISABLED, FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test434() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", makeString(LOCKED, DISABLED, FAILED, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test435() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, FAILED, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test436() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, FAILED, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test437() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, FAILED, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test438() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, FAILED, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test439() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,StandbyStatusException", - makeString(LOCKED, DISABLED, FAILED, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test440() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", makeString(LOCKED, DISABLED, FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test441() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test442() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,failed,", - makeString(LOCKED, DISABLED, FAILED, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test443() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, FAILED, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test444() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, FAILED, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test445() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, FAILED, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test446() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, FAILED, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test447() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,StandbyStatusException", - makeString(LOCKED, DISABLED, FAILED, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test448() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test449() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, "null", DEMOTE)); - - } - - @Test - void test450() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,", makeString(LOCKED, DISABLED, DEPENDENCY, "null", UNLOCK)); - - } - - @Test - void test451() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY, "null", DISABLE_FAILED)); - - } - - @Test - void test452() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test453() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test454() throws StateTransitionException { - assertEquals("null,locked,enabled,null,", - makeString(LOCKED, DISABLED, DEPENDENCY, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test455() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,StandbyStatusException", - makeString(LOCKED, DISABLED, DEPENDENCY, "null", PROMOTE)); - - } - - @Test - void test456() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, "null", DEMOTE)); - - } - - @Test - void test457() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test458() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test459() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test460() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test461() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test462() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test463() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,StandbyStatusException", - makeString(LOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test464() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test465() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test466() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test467() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test468() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test469() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test470() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test471() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,StandbyStatusException", - makeString(LOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test472() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test473() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test474() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test475() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test476() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test477() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test478() throws StateTransitionException { - assertEquals("coldstandby,locked,enabled,null,", - makeString(LOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test479() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,StandbyStatusException", - makeString(LOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test480() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test481() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, "null", DEMOTE)); - - } - - @Test - void test482() throws StateTransitionException { - assertEquals("null,unlocked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, "null", UNLOCK)); - - } - - @Test - void test483() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, "null", DISABLE_FAILED)); - - } - - @Test - void test484() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, "null", ENABLE_NOT_FAILED)); - - } - - @Test - void test485() throws StateTransitionException { - assertEquals("null,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, "null", DISABLE_DEPENDENCY)); - - } - - @Test - void test486() throws StateTransitionException { - assertEquals("null,locked,disabled,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, "null", ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test487() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,StandbyStatusException", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, "null", PROMOTE)); - - } - - @Test - void test488() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, "null", DEMOTE)); - - } - - @Test - void test489() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test490() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, UNLOCK)); - - } - - @Test - void test491() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test492() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test493() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test494() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test495() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,StandbyStatusException", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, PROMOTE)); - - } - - @Test - void test496() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, COLDSTANDBY, DEMOTE)); - - } - - @Test - void test497() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test498() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, UNLOCK)); - - } - - @Test - void test499() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, DISABLE_FAILED)); - - } - - @Test - void test500() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, ENABLE_NOT_FAILED)); - - } - - @Test - void test501() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, DISABLE_DEPENDENCY)); - - } - - @Test - void test502() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test503() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,StandbyStatusException", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, PROMOTE)); - - } - - @Test - void test504() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, HOTSTANDBY, DEMOTE)); - - } - - @Test - void test505() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DEMOTE)); - - } - - @Test - void test506() throws StateTransitionException { - assertEquals("coldstandby,unlocked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, UNLOCK)); - - } - - @Test - void test507() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DISABLE_FAILED)); - - } - - @Test - void test508() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, ENABLE_NOT_FAILED)); - - } - - @Test - void test509() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DISABLE_DEPENDENCY)); - - } - - @Test - void test510() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, ENABLE_NO_DEPENDENCY)); - - } - - @Test - void test511() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,StandbyStatusException", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, PROMOTE)); - - } - - @Test - void test512() throws StateTransitionException { - assertEquals("coldstandby,locked,disabled,dependency,failed,", - makeString(LOCKED, DISABLED, DEPENDENCY_FAILED, PROVIDINGSERVICE, DEMOTE)); - } - - /** - * Converts a transition to a string. - */ - private String makeString(String adminState, String opState, String availStatus, String standbyStatus, - String actionName) throws StateTransitionException { - StateTransition st = new StateTransition(); - StateElement se = st.getEndingState(adminState, opState, availStatus, standbyStatus, actionName); - if (se == null) { - return null; - } - - StringBuilder stringBuilder = new StringBuilder(); - - String endingStandbyStatus = se.getEndingStandbyStatus(); - if (endingStandbyStatus != null) { - stringBuilder.append(endingStandbyStatus.replace(".", ",")); - stringBuilder.append(','); - } - - stringBuilder.append(se.getEndingAdminState()); - stringBuilder.append(','); - stringBuilder.append(se.getEndingOpState()); - stringBuilder.append(','); - stringBuilder.append(se.getEndingAvailStatus()); - stringBuilder.append(','); - stringBuilder.append(se.getException()); - - return stringBuilder.toString(); - } -} diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/exceptions/EntityRetrievalExceptionTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/exceptions/EntityRetrievalExceptionTest.java deleted file mode 100644 index abf7d27c..00000000 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/exceptions/EntityRetrievalExceptionTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Integrity Monitor - * ================================================================================ - * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2024 Nordix Foundation - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.common.im.exceptions; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.Test; -import org.onap.policy.common.utils.test.ExceptionsTester; - -class EntityRetrievalExceptionTest extends ExceptionsTester { - - @Test - void testEntityRetrievalException() { - assertEquals(1, test(EntityRetrievalException.class)); - } - -} diff --git a/integrity-monitor/src/test/resources/logback-test.xml b/integrity-monitor/src/test/resources/logback-test.xml deleted file mode 100644 index 70a71950..00000000 --- a/integrity-monitor/src/test/resources/logback-test.xml +++ /dev/null @@ -1,46 +0,0 @@ -<!-- - ============LICENSE_START======================================================= - integrity-monitor - ================================================================================ - Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved. - ================================================================================ - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ============LICENSE_END========================================================= - --> - -<!-- Controls the output of logs for JUnit tests --> - -<configuration> - - <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> - <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> - <Pattern> - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}.%M\(%line\) - %msg%n - </Pattern> - </encoder> - </appender> - <appender name="FILE" class="ch.qos.logback.core.FileAppender"> - <file>logs/debug.log</file> - <encoder> - <Pattern> - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}.%M\(%line\) - %msg%n - </Pattern> - </encoder> - </appender> - - <root level="debug"> - <appender-ref ref="STDOUT" /> - <appender-ref ref="FILE" /> - </root> - -</configuration> |