* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
* 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.
package org.onap.policy.models.sim.pdp;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.models.sim.pdp.exception.PdpSimulatorException;
*
* @author Ajith Sreekumar (ajith.sreekumar@est.tech)
*/
-public class TestPdpSimulatorActivator {
+class TestPdpSimulatorActivator {
private PdpSimulatorActivator activator;
*
* @throws Exception if an error occurs
*/
- @Before
- public void setUp() throws Exception {
+ @BeforeEach
+ void setUp() throws Exception {
Registry.newRegistry();
final String[] pdpSimulatorConfigParameters = { "-c", "src/test/resources/PdpSimulatorConfigParameters.json" };
final PdpSimulatorCommandLineArguments arguments =
*
* @throws Exception if an error occurs
*/
- @After
- public void teardown() throws Exception {
+ @AfterEach
+ void teardown() throws Exception {
if (activator != null && activator.isAlive()) {
activator.terminate();
}
}
@Test
- public void testPdpSimulatorActivator() throws PdpSimulatorException {
+ void testPdpSimulatorActivator() throws PdpSimulatorException {
assertFalse(activator.isAlive());
activator.initialize();
assertTrue(activator.isAlive());
}
@Test
- public void testTerminate() throws Exception {
+ void testTerminate() throws Exception {
activator.initialize();
activator.terminate();
assertFalse(activator.isAlive());
* ============LICENSE_START=======================================================
* Copyright (C) 2019,2023 Nordix Foundation.
* Modifications Copyright (C) 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.
import static org.assertj.core.api.Assertions.assertThatCode;
import java.lang.reflect.Constructor;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* Class to perform unit test of {@link PdpSimulatorConstants}}.
*
* @author Ajith Sreekumar (ajith.sreekumar@est.tech)
*/
-public class TestPdpSimulatorConstants {
+class TestPdpSimulatorConstants {
@Test
- public void test() throws Exception {
+ void test() throws Exception {
// verify that constructor does not throw an exception
assertThatCode(() -> {
Constructor<PdpSimulatorConstants> c = PdpSimulatorConstants.class.getDeclaredConstructor();
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
* Modifications Copyright (C) 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.
package org.onap.policy.models.sim.pdp;
import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.sim.pdp.exception.PdpSimulatorException;
import org.onap.policy.models.sim.pdp.parameters.CommonTestData;
*
* @author Ajith Sreekumar (ajith.sreekumar@est.tech)
*/
-public class TestPdpSimulatorMain {
+class TestPdpSimulatorMain {
private PdpSimulatorMain pdpSimulator;
/**
* Set up.
*/
- @Before
- public void setUp() {
+ @BeforeEach
+ void setUp() {
Registry.newRegistry();
}
*
* @throws Exception if an error occurs
*/
- @After
- public void tearDown() throws Exception {
+ @AfterEach
+ void tearDown() throws Exception {
// shut down activator
final PdpSimulatorActivator activator = Registry.getOrDefault(PdpSimulatorConstants.REG_PDP_SIMULATOR_ACTIVATOR,
PdpSimulatorActivator.class, null);
}
@Test
- public void testPdpSimulator() throws PdpSimulatorException {
+ void testPdpSimulator() throws PdpSimulatorException {
final String[] pdpSimulatorConfigParameters = { "-c", "src/test/resources/PdpSimulatorConfigParameters.json" };
pdpSimulator = new PdpSimulatorMain(pdpSimulatorConfigParameters);
assertTrue(pdpSimulator.getParameters().isValid());
}
@Test
- public void testPdpSimulator_NoArguments() {
+ void testPdpSimulator_NoArguments() {
final String[] pdpSimulatorConfigParameters = {};
pdpSimulator = new PdpSimulatorMain(pdpSimulatorConfigParameters);
assertNull(pdpSimulator.getParameters());
}
@Test
- public void testPdpSimulator_InvalidArguments() {
+ void testPdpSimulator_InvalidArguments() {
final String[] pdpSimulatorConfigParameters = { "src/test/resourcesPdpSimulatorConfigParameters.json" };
pdpSimulator = new PdpSimulatorMain(pdpSimulatorConfigParameters);
assertNull(pdpSimulator.getParameters());
}
@Test
- public void testPdpSimulator_Help() {
+ void testPdpSimulator_Help() {
final String[] pdpSimulatorConfigParameters = { "-h" };
assertThatCode(() -> PdpSimulatorMain.main(pdpSimulatorConfigParameters)).doesNotThrowAnyException();
}
@Test
- public void testPdpSimulator_InvalidParameters() {
+ void testPdpSimulator_InvalidParameters() {
final String[] pdpSimulatorConfigParameters =
{ "-c", "src/test/resources/PdpSimulatorConfigParameters_InvalidName.json" };
pdpSimulator = new PdpSimulatorMain(pdpSimulatorConfigParameters);
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
* 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.
package org.onap.policy.models.sim.pdp.comm;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
*
* @author Ajith Sreekumar (ajith.sreekumar@est.tech)
*/
-public class TestPdpStateChangeListener {
+class TestPdpStateChangeListener {
private static final String PDP_SUBGROUP = "pdpSubgroup";
private static final String PDP_GROUP = "pdpGroup";
private PdpUpdateListener pdpUpdateMessageListener;
*
* @throws Exception if an error occurs
*/
- @Before
- public void setUp() throws Exception {
+ @BeforeEach
+ void setUp() throws Exception {
pdpUpdateMessageListener = new PdpUpdateListener();
pdpStateChangeListener = new PdpStateChangeListener();
Registry.newRegistry();
*
* @throws Exception if an error occurs
*/
- @After
- public void teardown() throws Exception {
+ @AfterEach
+ void teardown() throws Exception {
// clear the pdp simulator activator
if (activator != null && activator.isAlive()) {
}
@Test
- public void testPdpStateChangeMessageListener_passivetopassive() {
+ void testPdpStateChangeMessageListener_passivetopassive() {
final PdpStatus pdpStatus = Registry.get(PdpSimulatorConstants.REG_PDP_STATUS_OBJECT);
performPdpUpdate(pdpStatus.getName());
final PdpStateChange pdpStateChangeMsg = new PdpStateChange();
pdpStateChangeMsg.setName(pdpStatus.getName());
pdpStateChangeListener.onTopicEvent(INFRA, TOPIC, null, pdpStateChangeMsg);
- assertEquals(pdpStatus.getState(), pdpStateChangeMsg.getState());
+ assertEquals(pdpStateChangeMsg.getState(), pdpStatus.getState());
}
@Test
- public void testPdpStateChangeMessageListener_activetoactive() {
+ void testPdpStateChangeMessageListener_activetoactive() {
final PdpStatus pdpStatus = Registry.get(PdpSimulatorConstants.REG_PDP_STATUS_OBJECT);
performPdpUpdate(pdpStatus.getName());
pdpStatus.setState(PdpState.ACTIVE);
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
* 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.
package org.onap.policy.models.sim.pdp.comm;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.pdp.concepts.PdpStatus;
*
* @author Ajith Sreekumar (ajith.sreekumar@est.tech)
*/
-public class TestPdpUpdateListener {
+class TestPdpUpdateListener {
private PdpUpdateListener pdpUpdateMessageListener;
private static final CommInfrastructure INFRA = CommInfrastructure.NOOP;
private static final String TOPIC = "my-topic";
*
* @throws Exception if an error occurs
*/
- @Before
- public void setUp() throws Exception {
+ @BeforeEach
+ void setUp() throws Exception {
Registry.newRegistry();
final String[] pdpSimulatorConfigParameters = { "-c", "src/test/resources/PdpSimulatorConfigParameters.json" };
final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
*
* @throws Exception if an error occurs
*/
- @After
- public void teardown() throws Exception {
+ @AfterEach
+ void teardown() throws Exception {
// clear the pdp simulator activator
if (activator != null && activator.isAlive()) {
}
@Test
- public void testPdpUpdateMssageListener() {
+ void testPdpUpdateMssageListener() {
final PdpStatus pdpStatus = Registry.get(PdpSimulatorConstants.REG_PDP_STATUS_OBJECT);
final PdpUpdate pdpUpdateMsg = new PdpUpdate();
pdpUpdateMsg.setDescription("dummy pdp status for test");
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
+ * 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.
package org.onap.policy.models.sim.pdp.exception;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.test.ExceptionsTester;
/**
*
* @author Ajith Sreekumar (ajith.sreekumar@est.tech)
*/
-public class TestExceptions {
+class TestExceptions {
@Test
- public void test() {
+ void test() {
new ExceptionsTester().test(PdpSimulatorException.class);
new ExceptionsTester().test(PdpSimulatorRunTimeException.class);
}
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
* Modifications Copyright (C) 2021 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.
package org.onap.policy.models.sim.pdp.parameters;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
import org.onap.policy.common.parameters.ValidationResult;
*
* @author Ajith Sreekumar (ajith.sreekumar@est.tech)
*/
-public class TestPdpSimulatorParameterGroup {
+class TestPdpSimulatorParameterGroup {
CommonTestData commonTestData = new CommonTestData();
@Test
- public void testPdpSimulatorParameterGroup_Named() {
+ void testPdpSimulatorParameterGroup_Named() {
final PdpSimulatorParameterGroup pdpSimulatorParameters = new PdpSimulatorParameterGroup("my-name");
assertEquals("my-name", pdpSimulatorParameters.getName());
}
@Test
- public void testPdpSimulatorParameterGroup() {
+ void testPdpSimulatorParameterGroup() {
final PdpSimulatorParameterGroup pdpSimulatorParameters = commonTestData.toObject(
commonTestData.getPdpSimulatorParameterGroupMap(CommonTestData.PDP_SIMULATOR_GROUP_NAME),
PdpSimulatorParameterGroup.class);
}
@Test
- public void testPdpSimulatorParameterGroup_NullName() {
+ void testPdpSimulatorParameterGroup_NullName() {
final PdpSimulatorParameterGroup pdpSimulatorParameters = commonTestData
.toObject(commonTestData.getPdpSimulatorParameterGroupMap(null), PdpSimulatorParameterGroup.class);
final ValidationResult validationResult = pdpSimulatorParameters.validate();
}
@Test
- public void testPdpSimulatorParameterGroup_EmptyName() {
+ void testPdpSimulatorParameterGroup_EmptyName() {
final PdpSimulatorParameterGroup pdpSimulatorParameters = commonTestData
.toObject(commonTestData.getPdpSimulatorParameterGroupMap(""), PdpSimulatorParameterGroup.class);
final ValidationResult validationResult = pdpSimulatorParameters.validate();
}
@Test
- public void testPdpSimulatorParameterGroup_SetName() {
+ void testPdpSimulatorParameterGroup_SetName() {
final PdpSimulatorParameterGroup pdpSimulatorParameters = commonTestData.toObject(
commonTestData.getPdpSimulatorParameterGroupMap(CommonTestData.PDP_SIMULATOR_GROUP_NAME),
PdpSimulatorParameterGroup.class);
}
@Test
- public void testPdpSimulatorParameterGroup_EmptyPdpStatusParameters() {
+ void testPdpSimulatorParameterGroup_EmptyPdpStatusParameters() {
final Map<String, Object> map =
commonTestData.getPdpSimulatorParameterGroupMap(CommonTestData.PDP_SIMULATOR_GROUP_NAME);
map.put("pdpStatusParameters", commonTestData.getPdpStatusParametersMap(true));
}
@Test
- public void testApexStarterParameterGroupp_EmptyTopicParameters() {
+ void testApexStarterParameterGroupp_EmptyTopicParameters() {
final Map<String, Object> map =
commonTestData.getPdpSimulatorParameterGroupMap(CommonTestData.PDP_SIMULATOR_GROUP_NAME);
map.put("topicParameterGroup", commonTestData.getTopicParametersMap(true));
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019, 2021 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.
package org.onap.policy.models.sim.pdp.parameters;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
import java.io.FileNotFoundException;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.cmd.CommandLineException;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.models.sim.pdp.PdpSimulatorCommandLineArguments;
*
* @author Ajith Sreekumar (ajith.sreekumar@est.tech)
*/
-public class TestPdpSimulatorParameterHandler {
+class TestPdpSimulatorParameterHandler {
@Test
- public void testParameterHandlerNoParameterFile() throws CommandLineException {
+ void testParameterHandlerNoParameterFile() throws CommandLineException {
final String[] emptyArgumentString = { "-c", "src/test/resources/NoParametersFile.json" };
final PdpSimulatorCommandLineArguments emptyArguments = new PdpSimulatorCommandLineArguments();
}
@Test
- public void testParameterHandlerEmptyParameters() throws CommandLineException {
+ void testParameterHandlerEmptyParameters() throws CommandLineException {
final String[] noArgumentString = { "-c", "src/test/resources/NoParameters.json" };
final PdpSimulatorCommandLineArguments noArguments = new PdpSimulatorCommandLineArguments();
}
@Test
- public void testParameterHandlerInvalidParameters() throws CommandLineException {
+ void testParameterHandlerInvalidParameters() throws CommandLineException {
final String[] invalidArgumentString = { "-c", "src/test/resources/InvalidParameters.json" };
final PdpSimulatorCommandLineArguments invalidArguments = new PdpSimulatorCommandLineArguments();
}
@Test
- public void testParameterHandlerNoParameters() throws CommandLineException {
+ void testParameterHandlerNoParameters() throws CommandLineException {
final String[] noArgumentString = { "-c", "src/test/resources/EmptyConfigParameters.json" };
final PdpSimulatorCommandLineArguments noArguments = new PdpSimulatorCommandLineArguments();
}
@Test
- public void testPdpSimulatorParameterGroup() throws PdpSimulatorException, CommandLineException {
+ void testPdpSimulatorParameterGroup() throws PdpSimulatorException, CommandLineException {
final String[] pdpSimulatorConfigParameters = { "-c", "src/test/resources/PdpSimulatorConfigParameters.json" };
final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
}
@Test
- public void testPdpSimulatorParameterGroup_InvalidName() throws CommandLineException {
+ void testPdpSimulatorParameterGroup_InvalidName() throws CommandLineException {
final String[] pdpSimulatorConfigParameters = {"-c",
"src/test/resources/PdpSimulatorConfigParameters_InvalidName.json"};
}
@Test
- public void testPdpSimulatorVersion() throws CommandLineException {
+ void testPdpSimulatorVersion() throws CommandLineException {
final String[] pdpSimulatorConfigParameters = { "-v" };
final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
final String version = arguments.parse(pdpSimulatorConfigParameters);
}
@Test
- public void testPdpSimulatorHelp() throws CommandLineException {
+ void testPdpSimulatorHelp() throws CommandLineException {
final String[] pdpSimulatorConfigParameters = { "-h" };
final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
final String help = arguments.parse(pdpSimulatorConfigParameters);
}
@Test
- public void testPdpSimulatorInvalidOption() {
+ void testPdpSimulatorInvalidOption() {
final String[] pdpSimulatorConfigParameters = { "-d" };
final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
}
@Test
- public void testPdpSimulatorProperty() throws CommandLineException {
+ void testPdpSimulatorProperty() throws CommandLineException {
final String[] pdpSimulatorConfigParameters = { "-p", "dummyProperties.json" };
final PdpSimulatorCommandLineArguments arguments = new PdpSimulatorCommandLineArguments();
arguments.parse(pdpSimulatorConfigParameters);
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
* Modifications Copyright (C) 2019, 2021 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.
package org.onap.policy.models.sim.pdp.parameters;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.parameters.ValidationResult;
/**
*
* @author Ajith Sreekumar (ajith.sreekumar@est.tech)
*/
-public class TestPdpStatusParameters {
+class TestPdpStatusParameters {
private static CommonTestData testData = new CommonTestData();
@Test
- public void test() {
+ void test() {
final PdpStatusParameters pdpStatusParameters =
testData.toObject(testData.getPdpStatusParametersMap(false), PdpStatusParameters.class);
final ValidationResult validationResult = pdpStatusParameters.validate();
}
@Test
- public void testValidate() {
+ void testValidate() {
final PdpStatusParameters pdpStatusParameters =
testData.toObject(testData.getPdpStatusParametersMap(false), PdpStatusParameters.class);
final ValidationResult result = pdpStatusParameters.validate();
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Bell Canada.
* Modifications Copyright (C) 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.
package org.onap.policy.models.simulators;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.File;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.parameters.ValidationResult;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
-public class CdsServerParametersTest {
+class CdsServerParametersTest {
@Test
- public void testValidateString() throws CoderException {
+ void testValidateString() throws CoderException {
// some fields missing
ValidationResult result = new CdsServerParameters().validate();
assertFalse(result.isValid());
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 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.
package org.onap.policy.models.simulators;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
import java.io.File;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.parameters.ValidationResult;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
-public class ClassRestServerParametersTest {
+class ClassRestServerParametersTest {
@Test
- public void testValidateString() throws CoderException {
+ void testValidateString() throws CoderException {
// some fields missing
ValidationResult result = new ClassRestServerParameters().validate();
assertFalse(result.isValid());
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.Properties;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClient;
import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.common.utils.security.SelfSignedKeyStore;
-public class MainTest {
+class MainTest {
private static final String PARAMETER_FILE = "simParameters.json";
private static final String HOST = "localhost";
private static final String EXPECTED_EXCEPTION = "expected exception";
/**
* Saves system properties.
*/
- @BeforeClass
+ @BeforeAll
public static void setUpBeforeClass() throws IOException, InterruptedException {
savedValues = new HashMap<>();
/**
* Restores system properties.
*/
- @AfterClass
+ @AfterAll
public static void tearDownAfterClass() {
for (Entry<String, String> ent : savedValues.entrySet()) {
if (ent.getValue() == null) {
/**
* Shuts down the simulator instance.
*/
- @After
- public void tearDown() {
+ @AfterEach
+ void tearDown() {
Main main = Main.getInstance();
if (main != null && main.isAlive()) {
main.shutdown();
* least one of them.
*/
@Test
- public void testMain() throws Exception {
+ void testMain() throws Exception {
Main.main(new String[0]);
assertTrue(Main.getInstance() == null || !Main.getInstance().isAlive());
// don't need to wait long, because buildXxx() does the wait for us
for (int port : new int[] {6666, 6667, 6668, 6669, 6670, 6680}) {
- assertTrue("simulator on port " + port, NetworkUtil.isTcpPortOpen(HOST, port, 1, 100));
+ assertTrue(NetworkUtil.isTcpPortOpen(HOST, port, 1, 100), "simulator on port " + port);
}
// it's sufficient to verify that one of the simulators works
}
@Test
- public void testMainMinimalParameters() {
+ void testMainMinimalParameters() {
Main.main(new String[] {"minParameters.json"});
assertNotNull(Main.getInstance());
assertTrue(Main.getInstance().isAlive());
* Tests readParameters() when the file cannot be found.
*/
@Test
- public void testReadParametersNoFile() {
+ void testReadParametersNoFile() {
assertThatIllegalArgumentException().isThrownBy(() -> new Main("missing-file.json"))
.withCauseInstanceOf(FileNotFoundException.class);
}
* Tests readParameters() when the json cannot be decoded.
*/
@Test
- public void testReadParametersInvalidJson() throws CoderException {
+ void testReadParametersInvalidJson() throws CoderException {
Coder coder = mock(Coder.class);
when(coder.decode(any(String.class), any())).thenThrow(new CoderException(EXPECTED_EXCEPTION));
* Tests buildRestServer() when the server port is not open.
*/
@Test
- public void testBuildRestServerNotOpen() {
+ void testBuildRestServerNotOpen() {
HttpServletServer server = mock(HttpServletServer.class);
Main main = new Main(PARAMETER_FILE) {
* Tests buildRestServer() when the port checker is interrupted.
*/
@Test
- public void testBuildRestServerInterrupted() throws InterruptedException {
+ void testBuildRestServerInterrupted() throws InterruptedException {
HttpServletServer server = mock(HttpServletServer.class);
Main main = new Main(PARAMETER_FILE) {
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 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.
import com.openpojo.validation.rule.impl.SetterMustExistRule;
import com.openpojo.validation.test.impl.GetterTester;
import com.openpojo.validation.test.impl.SetterTester;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.test.ToStringTester;
/**
* @author Chenfei Gao (cgao@research.att.com)
*
*/
-public class PojosTest {
+class PojosTest {
private static final String POJO_PACKAGE = "org.onap.policy.models.tosca.authorative.concepts";
@Test
- public void testPojos() {
+ void testPojos() {
// @formatter:off
final Validator validator = ValidatorBuilder
.create()
* ONAP Policy Models
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 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.
package org.onap.policy.models.tosca.authorative.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* Test the other constructors, as {@link PojosTest} tests the other methods.
*/
-public class ToscaConceptIdentifierOptVersionTest extends ToscaIdentifierTestBase<ToscaConceptIdentifierOptVersion> {
+class ToscaConceptIdentifierOptVersionTest extends ToscaIdentifierTestBase<ToscaConceptIdentifierOptVersion> {
public ToscaConceptIdentifierOptVersionTest() {
super(ToscaConceptIdentifierOptVersion.class, "name", "version");
}
@Test
- public void testAllArgsConstructor_testIsNullVersion() {
+ void testAllArgsConstructor_testIsNullVersion() {
assertThatThrownBy(() -> new ToscaConceptIdentifierOptVersion(null, VERSION))
.isInstanceOf(NullPointerException.class);
}
@Test
- public void testCopyConstructor() throws Exception {
+ void testCopyConstructor() throws Exception {
assertThatThrownBy(() -> new ToscaConceptIdentifierOptVersion((ToscaConceptIdentifierOptVersion) null))
.isInstanceOf(NullPointerException.class);
}
@Test
- public void testCopyToscaPolicyIdentifierConstructor() {
+ void testCopyToscaPolicyIdentifierConstructor() {
assertThatThrownBy(() -> new ToscaConceptIdentifierOptVersion((ToscaConceptIdentifier) null))
.isInstanceOf(NullPointerException.class);
@Test
@Override
- public void testCompareTo() throws Exception {
+ void testCompareTo() throws Exception {
super.testCompareTo();
}
}
* ONAP Policy Models
* ================================================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 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.
package org.onap.policy.models.tosca.authorative.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.parameters.ValidationResult;
import org.onap.policy.models.base.PfConceptKey;
/**
* Test methods not tested by {@link PojosTest}.
*/
-public class ToscaConceptIdentifierTest extends ToscaIdentifierTestBase<ToscaConceptIdentifier> {
+class ToscaConceptIdentifierTest extends ToscaIdentifierTestBase<ToscaConceptIdentifier> {
public ToscaConceptIdentifierTest() {
super(ToscaConceptIdentifier.class, "name", "version");
}
@Test
- public void testAllArgsConstructor() {
+ void testAllArgsConstructor() {
assertThatThrownBy(() -> new ToscaConceptIdentifier(null, VERSION)).isInstanceOf(NullPointerException.class);
assertThatThrownBy(() -> new ToscaConceptIdentifier(NAME, null)).isInstanceOf(NullPointerException.class);
}
@Test
- public void testCopyConstructor() {
+ void testCopyConstructor() {
assertThatThrownBy(() -> new ToscaConceptIdentifier((ToscaConceptIdentifier) null))
.isInstanceOf(NullPointerException.class);
@Test
- public void testPfKey() {
+ void testPfKey() {
assertThatThrownBy(() -> new ToscaConceptIdentifier((PfConceptKey) null))
.isInstanceOf(NullPointerException.class);
}
@Test
- public void testValidatePapRest() throws Exception {
+ void testValidatePapRest() throws Exception {
ToscaConceptIdentifier ident = new ToscaConceptIdentifier(NAME, VERSION);
ValidationResult result = ident.validatePapRest();
assertNotNull(result);
@Test
@Override
- public void testCompareTo() throws Exception {
+ void testCompareTo() throws Exception {
super.testCompareTo();
}
}
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* 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.
package org.onap.policy.models.tosca.authorative.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import com.google.gson.GsonBuilder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class ToscaEntityFilterTest {
+class ToscaEntityFilterTest {
// Logger for this class
private static final Logger LOGGER = LoggerFactory.getLogger(ToscaEntityFilterTest.class);
*
* @throws CoderException on JSON decoding errors
*/
- @BeforeClass
+ @BeforeAll
public static void setupTypeList() throws CoderException {
for (String policyTypeResourceName : policyTypeResourceNames) {
String policyTypeString = ResourceUtils.getResourceAsString(policyTypeResourceName);
}
@Test
- public void testNullList() {
+ void testNullList() {
ToscaEntityFilter<ToscaPolicyType> filter = ToscaEntityFilter.<ToscaPolicyType>builder().build();
assertThatThrownBy(() -> {
}
@Test
- public void testFilterNothing() {
+ void testFilterNothing() {
ToscaEntityFilter<ToscaPolicyType> filter = ToscaEntityFilter.<ToscaPolicyType>builder().build();
List<ToscaPolicyType> filteredList = filter.filter(typeList);
}
@Test
- public void testFilterLatestVersion() {
+ void testFilterLatestVersion() {
ToscaEntityFilter<ToscaPolicyType> filter =
ToscaEntityFilter.<ToscaPolicyType>builder().version(ToscaEntityFilter.LATEST_VERSION).build();
}
@Test
- public void testFilterNameVersion() {
+ void testFilterNameVersion() {
ToscaEntityFilter<ToscaPolicyType> filter =
ToscaEntityFilter.<ToscaPolicyType>builder().name("onap.policies.Monitoring").build();
List<ToscaPolicyType> filteredList = filter.filter(typeList);
* ONAP Policy Models
* ================================================================================
* Copyright (C) 2019-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.
package org.onap.policy.models.tosca.authorative.concepts;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
*
* @param <T> type of key being tested
*/
-public class ToscaIdentifierTestBase<T extends Comparable<T>> {
+class ToscaIdentifierTestBase<T extends Comparable<T>> {
public static final String NAME = "my-name";
public static final String VERSION = "1.2.3";
*
* @throws Exception if an error occurs
*/
- public void testCompareTo() throws Exception {
+ void testCompareTo() throws Exception {
T ident = makeIdent(NAME, VERSION);
assertEquals(0, ident.compareTo(ident));
* ONAP
* ================================================================================
* Copyright (C) 2021 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.
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfKey;
-public class ToscaNameVersionTest {
+class ToscaNameVersionTest {
private static final String MY_NAME = "MyName";
private static final String MY_VERSION = "1.2.3";
private ToscaNameVersion tosca;
- @Before
- public void setUp() {
+ @BeforeEach
+ void setUp() {
tosca = new ToscaNameVersion(MY_NAME, MY_VERSION);
}
@Test
- public void testToscaNameVersionPfKey() {
+ void testToscaNameVersionPfKey() {
tosca = new ToscaNameVersion(new PfConceptKey(MY_NAME, MY_VERSION));
assertEquals(MY_NAME, tosca.getName());
assertEquals(MY_VERSION, tosca.getVersion());
}
@Test
- public void testToscaNameVersionToscaNameVersion() {
+ void testToscaNameVersionToscaNameVersion() {
tosca = new ToscaNameVersion(tosca);
assertEquals(MY_NAME, tosca.getName());
assertEquals(MY_VERSION, tosca.getVersion());
}
@Test
- public void testAsConceptKey() {
+ void testAsConceptKey() {
assertEquals(new PfConceptKey(MY_NAME, MY_VERSION), tosca.asConceptKey());
}
@Test
- public void testCommonCompareTo() {
+ void testCommonCompareTo() {
assertThat(tosca.commonCompareTo(tosca)).isZero();
assertThat(tosca.commonCompareTo(null)).isNotZero();
assertThat(tosca.commonCompareTo(new MyNameVersion(MY_NAME, MY_VERSION))).isNotZero();
}
@Test
- public void testToString() {
+ void testToString() {
assertEquals(MY_NAME + " " + MY_VERSION, tosca.toString());
}
@Test
- public void testToscaNameVersion() {
+ void testToscaNameVersion() {
tosca = new ToscaNameVersion();
assertNull(tosca.getName());
assertNull(tosca.getVersion());
}
@Test
- public void testToscaNameVersionStringString() {
+ void testToscaNameVersionStringString() {
assertEquals(MY_NAME, tosca.getName());
assertEquals(MY_VERSION, tosca.getVersion());
}
* ONAP Policy Models
* ================================================================================
* Copyright (C) 2021 Nordix Foundation.
+ * 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.
package org.onap.policy.models.tosca.authorative.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.ArrayList;
import java.util.HashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ToscaNodeTemplateTest {
+class ToscaNodeTemplateTest {
@Test
- public void testToscaNodeTemplate() {
+ void testToscaNodeTemplate() {
assertThatThrownBy(() -> {
new ToscaNodeTemplate(null);
}).hasMessageMatching("copyObject is marked .*on.*ull but is null");
* ONAP Policy Models
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2020-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2020-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.
package org.onap.policy.models.tosca.authorative.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.LinkedHashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* Tests methods not tested by {@link PojosTest}.
*/
-public class ToscaPolicyTest {
+class ToscaPolicyTest {
@Test
- public void testGetIdentifier_testGetTypeIdentifier() {
+ void testGetIdentifier_testGetTypeIdentifier() {
assertThatThrownBy(() -> {
new ToscaPolicy(null);
}).hasMessageMatching("copyObject is marked .*on.*ull but is null");
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
+ * 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.
package org.onap.policy.models.tosca.authorative.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.LinkedHashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* Test of the {@link ToscaPolicyType} class.
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class ToscaPolicyTypeTest {
+class ToscaPolicyTypeTest {
@Test
- public void testToscaPolicyType() {
+ void testToscaPolicyType() {
assertThatThrownBy(() -> {
new ToscaPolicyType(null);
}).hasMessageMatching("copyObject is marked .*on.*ull but is null");
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
+ * 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.
package org.onap.policy.models.tosca.authorative.concepts;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.ArrayList;
import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaProperty;
-public class ToscaPropertyTest {
+class ToscaPropertyTest {
@Test
- public void testToscaPropertyDefaultValue() {
+ void testToscaPropertyDefaultValue() {
ToscaProperty property = new ToscaProperty();
property.setName("test");
property.setType("testType");
* ONAP Policy Models
* ================================================================================
* Copyright (C) 2021 Nordix Foundation.
+ * 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.
package org.onap.policy.models.tosca.authorative.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.HashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ToscaServiceTemplateTest {
+class ToscaServiceTemplateTest {
@Test
- public void testToscServiceTemplate() {
+ void testToscServiceTemplate() {
assertThatThrownBy(() -> {
new ToscaServiceTemplate(null);
}).hasMessageMatching("copyObject is marked .*on.*ull but is null");
* ONAP Policy Models
* ================================================================================
* Copyright (C) 2021 Nordix Foundation.
+ * 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.
package org.onap.policy.models.tosca.authorative.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.ArrayList;
import java.util.HashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ToscaTopologyTemplateTest {
+class ToscaTopologyTemplateTest {
@Test
- public void testToscTopologyTemplate() {
+ void testToscTopologyTemplate() {
assertThatThrownBy(() -> {
new ToscaTopologyTemplate(null);
}).hasMessageMatching("copyObject is marked .*on.*ull but is null");
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import com.google.gson.GsonBuilder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class ToscaTypedEntityFilterTest {
+class ToscaTypedEntityFilterTest {
private static final String VERSION_100 = "1.0.0";
private static final String VERSION_000 = "0.0.0";
*
* @throws CoderException on JSON decoding errors
*/
- @BeforeClass
+ @BeforeAll
public static void setupTypeList() throws CoderException {
for (String policyResourceName : policyResourceNames) {
String policyString = ResourceUtils.getResourceAsString(policyResourceName);
}
@Test
- public void testNullList() {
+ void testNullList() {
ToscaTypedEntityFilter<ToscaPolicy> filter = ToscaTypedEntityFilter.<ToscaPolicy>builder().build();
assertThatThrownBy(() -> {
}
@Test
- public void testFilterNothing() {
+ void testFilterNothing() {
ToscaTypedEntityFilter<ToscaPolicy> filter = ToscaTypedEntityFilter.<ToscaPolicy>builder().build();
List<ToscaPolicy> filteredList = filter.filter(policyList);
}
@Test
- public void testFilterLatestVersion() {
+ void testFilterLatestVersion() {
ToscaTypedEntityFilter<ToscaPolicy> filter =
ToscaTypedEntityFilter.<ToscaPolicy>builder().version(ToscaTypedEntityFilter.LATEST_VERSION).build();
}
@Test
- public void testFilterNameVersion() {
+ void testFilterNameVersion() {
ToscaTypedEntityFilter<ToscaPolicy> filter =
ToscaTypedEntityFilter.<ToscaPolicy>builder().name("operational.modifyconfig").build();
List<ToscaPolicy> filteredList = filter.filter(policyList);
}
@Test
- public void testFilterVersionPrefix() {
+ void testFilterVersionPrefix() {
// null pattern
ToscaTypedEntityFilter<ToscaPolicy> filter =
ToscaTypedEntityFilter.<ToscaPolicy>builder().versionPrefix(null).build();
}
@Test
- public void testFilterTypeVersion() {
+ void testFilterTypeVersion() {
ToscaTypedEntityFilter<ToscaPolicy> filter =
ToscaTypedEntityFilter.<ToscaPolicy>builder().type("onap.policies.controlloop.Operational").build();
List<ToscaPolicy> filteredList = filter.filter(policyList);
* ONAP
* ================================================================================
* Copyright (C) 2021 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.
package org.onap.policy.models.tosca.authorative.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ToscaWithToscaPropertiesTest {
+class ToscaWithToscaPropertiesTest {
@Test
- public void test() {
+ void test() {
ToscaProperty prop1 = new ToscaProperty();
prop1.setDescription("description A");
* ONAP
* ================================================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 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.
package org.onap.policy.models.tosca.authorative.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ToscaWithTypeAndObjectPropertiesTest {
+class ToscaWithTypeAndObjectPropertiesTest {
@Test
- public void testCopyConstructor() {
+ void testCopyConstructor() {
ToscaWithTypeAndObjectProperties tosca = new ToscaWithTypeAndObjectProperties();
assertEquals(tosca, new ToscaWithTypeAndObjectProperties(tosca));
* ============LICENSE_START=======================================================
* Copyright (C) 2020-2021, 2023-2024 Nordix Foundation.
* Modifications Copyright (C) 2021 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.
package org.onap.policy.models.tosca.authorative.provider;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import com.google.gson.GsonBuilder;
import java.util.List;
import java.util.Properties;
import org.apache.commons.lang3.ObjectUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+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.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.base.PfConceptKey;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class AuthorativeToscaProviderGenericTest {
+class AuthorativeToscaProviderGenericTest {
private static final String POLICY_NO_VERSION_VERSION1 = "onap.policies.NoVersion:0.0.1";
private static final String POLICY_NO_VERSION = "onap.policies.NoVersion";
private static final String DAO_IS_NULL = "^dao is marked .*on.*ull but is null$";
*
* @throws Exception on errors
*/
- @BeforeClass
+ @BeforeAll
public static void readPolicyDefinition() {
String yamlString = ResourceUtils.getResourceAsString("src/test/resources/onap.policies.NoVersion.yaml");
*
* @throws Exception on database errors
*/
- @Before
- public void setupDao() throws Exception {
+ @BeforeEach
+ void setupDao() throws Exception {
final DaoParameters daoParameters = new DaoParameters();
daoParameters.setPluginClass(DefaultPfDao.class.getName());
/**
* Set up GSON.
*/
- @Before
- public void setupGson() {
+ @BeforeEach
+ void setupGson() {
standardCoder = new StandardCoder();
}
- @After
- public void teardown() {
+ @AfterEach
+ void teardown() {
pfDao.close();
}
@Test
- public void testCreateGetDelete() throws Exception {
+ void testCreateGetDelete() throws Exception {
assertThatThrownBy(() -> {
new AuthorativeToscaProvider().getServiceTemplateList(null, null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testNullParameters() throws Exception {
+ void testNullParameters() throws Exception {
assertThatThrownBy(() -> new AuthorativeToscaProvider().getServiceTemplateList(null, null, null))
.hasMessageMatching("^dao is marked .*on.*ull but is null$");
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.coder.YamlJsonTranslator;
/**
* Test of the {@link AuthorativeToscaProvider} class.
*/
-public class AuthorativeToscaProviderNodeTemplateTest {
+class AuthorativeToscaProviderNodeTemplateTest {
private static final String NODE_TEMPLATES_JSON = "nodetemplates/nodetemplates.metadatasets.input.tosca.json";
* Read policy metadataSet input json.
* @throws Exception Coder exception
*/
- @Before
- public void fetchToscaNodeTemplatesJson() throws Exception {
+ @BeforeEach
+ void fetchToscaNodeTemplatesJson() throws Exception {
standardCoder = new StandardCoder();
toscaServiceTemplate =
standardCoder.decode(ResourceUtils.getResourceAsString(NODE_TEMPLATES_JSON), ToscaServiceTemplate.class);
*
* @throws Exception on database errors
*/
- @Before
- public void setupDao() throws Exception {
+ @BeforeEach
+ void setupDao() throws Exception {
final DaoParameters daoParameters = new DaoParameters();
daoParameters.setPluginClass(DefaultPfDao.class.getName());
pfDao.init(daoParameters);
}
- @After
- public void teardown() {
+ @AfterEach
+ void teardown() {
pfDao.close();
}
@Test
- public void testPolicyMetadataSetsGet() throws Exception {
+ void testPolicyMetadataSetsGet() throws Exception {
assertThatThrownBy(() -> {
authorativeToscaProvider.getNodeTemplateMetadataSet(null, null, null);
}
@Test
- public void testToscaNodeTemplatesGet() throws Exception {
+ void testToscaNodeTemplatesGet() throws Exception {
assertThatThrownBy(() -> {
authorativeToscaProvider.getToscaNodeTemplate(null, null, null);
}
@Test
- public void testToscaNodeTemplatesCreate() throws Exception {
+ void testToscaNodeTemplatesCreate() throws Exception {
assertThatThrownBy(() -> {
authorativeToscaProvider.createToscaNodeTemplates(null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testToscaNodeTemplateUpdate() throws Exception {
+ void testToscaNodeTemplateUpdate() throws Exception {
assertThatThrownBy(() -> {
authorativeToscaProvider.updateToscaNodeTemplates(null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testToscaNodeTemplateDelete() throws Exception {
+ void testToscaNodeTemplateDelete() throws Exception {
assertThatThrownBy(() -> {
authorativeToscaProvider.deleteToscaNodeTemplate(null, null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testNodeTemplatesWithExistingPolicy() throws Exception {
+ void testNodeTemplatesWithExistingPolicy() throws Exception {
String policyString = ResourceUtils.getResourceAsString(POLICY_WITH_METADATA_SET_REF);
ToscaServiceTemplate policyServiceTemplate =
yamlJsonTranslator.fromYaml(policyString, ToscaServiceTemplate.class);
package org.onap.policy.models.tosca.authorative.provider;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class AuthorativeToscaProviderPolicyTest {
+class AuthorativeToscaProviderPolicyTest {
private static final String VERSION = "version";
private static final String VCPE_JSON = "policies/vCPE.policy.monitoring.input.tosca.json";
private static final String POLICY_AND_VERSION = "onap.restart.tca:1.0.0";
*
* @throws Exception on database errors
*/
- @Before
- public void setupDao() throws Exception {
+ @BeforeEach
+ void setupDao() throws Exception {
final DaoParameters daoParameters = new DaoParameters();
daoParameters.setPluginClass(DefaultPfDao.class.getName());
/**
* Set up GSON.
*/
- @Before
- public void setupGson() {
+ @BeforeEach
+ void setupGson() {
standardCoder = new StandardCoder();
}
- @After
- public void teardown() {
+ @AfterEach
+ void teardown() {
pfDao.close();
}
@Test
- public void testPoliciesGet() throws Exception {
+ void testPoliciesGet() throws Exception {
assertThatThrownBy(() -> {
new AuthorativeToscaProvider().getPolicies(null, null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testPoliciesGetFiltered() throws Exception {
+ void testPoliciesGetFiltered() throws Exception {
assertThatThrownBy(() -> {
new AuthorativeToscaProvider().getFilteredPolicies(null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testPolicyCreate() throws Exception {
+ void testPolicyCreate() throws Exception {
assertThatThrownBy(() -> {
new AuthorativeToscaProvider().createPolicies(null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testPolicyUpdate() throws Exception {
+ void testPolicyUpdate() throws Exception {
assertThatThrownBy(() -> {
new AuthorativeToscaProvider().createPolicies(null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testPoliciesDelete() throws Exception {
+ void testPoliciesDelete() throws Exception {
assertThatThrownBy(() -> {
new AuthorativeToscaProvider().deletePolicy(null, null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testAssertPoliciesExist() {
+ void testAssertPoliciesExist() {
ToscaServiceTemplate testServiceTemplate = new ToscaServiceTemplate();
assertThatThrownBy(() -> {
}
@Test
- public void testEntityMaps() throws CoderException, PfModelException {
+ void testEntityMaps() throws CoderException, PfModelException {
Object yamlObject =
new Yaml().load(ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml"));
String yamlAsJsonString = new StandardCoder().encode(yamlObject);
package org.onap.policy.models.tosca.authorative.provider;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import com.google.gson.GsonBuilder;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Properties;
import org.apache.commons.lang3.ObjectUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+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.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.base.PfConceptKey;
/**
* Test of the {@link AuthorativeToscaProvider} class.
*/
-public class AuthorativeToscaProviderPolicyTypeTest {
+class AuthorativeToscaProviderPolicyTypeTest {
private static final String VERSION = "version";
private static final String POLICY_NO_VERSION_VERSION1 = "onap.policies.NoVersion:0.0.1";
private static final String POLICY_NO_VERSION = "onap.policies.NoVersion";
*
* @throws Exception on errors
*/
- @BeforeClass
+ @BeforeAll
public static void readPolicyDefinition() {
String yamlString = ResourceUtils.getResourceAsString("src/test/resources/onap.policies.NoVersion.yaml");
*
* @throws Exception on database errors
*/
- @Before
- public void setupDao() throws Exception {
+ @BeforeEach
+ void setupDao() throws Exception {
final DaoParameters daoParameters = new DaoParameters();
daoParameters.setPluginClass(DefaultPfDao.class.getName());
/**
* Set up GSON.
*/
- @Before
- public void setupGson() {
+ @BeforeEach
+ void setupGson() {
standardCoder = new StandardCoder();
}
- @After
- public void teardown() {
+ @AfterEach
+ void teardown() {
pfDao.close();
}
@Test
- public void testPolicyTypesGet() throws Exception {
+ void testPolicyTypesGet() throws Exception {
assertThatThrownBy(() -> {
new AuthorativeToscaProvider().getPolicyTypes(null, null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testPolicyTypesGetFiltered() throws Exception {
+ void testPolicyTypesGetFiltered() throws Exception {
assertThatThrownBy(() -> {
new AuthorativeToscaProvider().getFilteredPolicyTypes(null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testPolicyTypesCreate() throws Exception {
+ void testPolicyTypesCreate() throws Exception {
assertThatThrownBy(() -> {
new AuthorativeToscaProvider().createPolicyTypes(null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testPolicyTypesUpdate() throws Exception {
+ void testPolicyTypesUpdate() throws Exception {
assertThatThrownBy(() -> {
new AuthorativeToscaProvider().createPolicyTypes(null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testPolicyTypesDelete() throws Exception {
+ void testPolicyTypesDelete() throws Exception {
assertThatThrownBy(() -> {
new AuthorativeToscaProvider().deletePolicyType(null, null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testAssertPoliciesExist() {
+ void testAssertPoliciesExist() {
ToscaServiceTemplate testServiceTemplate = new ToscaServiceTemplate();
assertThatThrownBy(() -> {
}
@Test
- public void testNullParameters() throws Exception {
+ void testNullParameters() throws Exception {
assertThatThrownBy(() -> new AuthorativeToscaProvider().getPolicyTypeList(null, null, null))
.hasMessageMatching("^dao is marked .*on.*ull but is null$");
}
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-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.
package org.onap.policy.models.tosca.authorative.provider;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.coder.YamlJsonTranslator;
import org.onap.policy.common.utils.resources.ResourceUtils;
*
* @author Chenfei Gao (cgao@research.att.com)
*/
-public class ToscaServiceTemplateMappingTest {
+class ToscaServiceTemplateMappingTest {
private StandardCoder standardCoder;
private YamlJsonTranslator yamlJsonTranslator = new YamlJsonTranslator();
- @Before
- public void setUp() {
+ @BeforeEach
+ void setUp() {
standardCoder = new StandardCoder();
}
@Test
- public void testPlainToscaPolicies() throws Exception {
+ void testPlainToscaPolicies() throws Exception {
String policyTypeInputJson =
ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml");
ToscaServiceTemplate plainPolicyTypes =
}
@Test
- public void testPlainToscaPolicyTypes() throws Exception {
+ void testPlainToscaPolicyTypes() throws Exception {
Yaml yaml = new Yaml();
String inputYaml =
ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml");
* ============LICENSE_START=======================================================
* Copyright (C) 2020-2021 Nordix Foundation.
* Modifications Copyright (C) 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.
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.Validated;
import org.onap.policy.models.tosca.authorative.concepts.ToscaCapabilityAssignment;
/**
* DAO test for JpaToscaCapabilityAssignment.
*/
-public class JpaToscaCapabilityAssignmentTest {
+class JpaToscaCapabilityAssignmentTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
@Test
- public void testPropertyPojo() {
+ void testPropertyPojo() {
ToscaCapabilityAssignment tca = new ToscaCapabilityAssignment();
tca.setName("world");
tca.setVersion("1.2.3");
}
@Test
- public void testCompareTo() {
+ void testCompareTo() {
assertEquals(-1, new JpaToscaCapabilityAssignment().compareTo(null));
assertEquals(0, new JpaToscaCapabilityAssignment().compareTo(new JpaToscaCapabilityAssignment()));
}
@Test
- public void testAuthorative() {
+ void testAuthorative() {
ToscaCapabilityAssignment tca = new ToscaCapabilityAssignment();
tca.setName("world");
tca.setVersion("1.2.3");
* ============LICENSE_START=======================================================
* Copyright (C) 2019, 2023 Nordix Foundation.
* 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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.ArrayList;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConstraint;
/**
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaConstraintLogicalTest {
+class JpaToscaConstraintLogicalTest {
private static final String HELLO = "Hello";
@Test
- public void testLogicalConstraint() {
+ void testLogicalConstraint() {
ToscaConstraint c0 = new ToscaConstraint();
c0.setEqual(HELLO);
JpaToscaConstraintLogical jc0 = new JpaToscaConstraintLogical(c0);
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021, 2023 Nordix Foundation.
* 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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.ArrayList;
import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConstraint;
/**
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaConstraintTest {
+class JpaToscaConstraintTest {
private static final String CONSTRAINT = "Constraint";
@Test
- public void testConstraintLogicalStringPojo() {
+ void testConstraintLogicalStringPojo() {
assertNotNull(new JpaToscaConstraintLogical(JpaToscaConstraintOperation.EQ, CONSTRAINT));
assertThatThrownBy(() -> new JpaToscaConstraintLogical((JpaToscaConstraintOperation) null, null))
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfKey;
import org.onap.policy.models.base.PfReferenceKey;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaDataTypeTest {
+class JpaToscaDataTypeTest {
private static final String VERSION_001 = "0.0.1";
@Test
- public void testDataTypePojo() {
+ void testDataTypePojo() {
assertNotNull(new JpaToscaDataType());
assertNotNull(new JpaToscaDataType(new PfConceptKey()));
assertNotNull(new JpaToscaDataType(new JpaToscaDataType()));
}
@Test
- public void testDataTypeProperties() {
+ void testDataTypeProperties() {
PfConceptKey dtKey = new PfConceptKey("tdt", VERSION_001);
JpaToscaDataType tdt = new JpaToscaDataType(dtKey);
}
@Test
- public void testDataTypeConstraints() {
+ void testDataTypeConstraints() {
ToscaDataType dat = new ToscaDataType();
dat.setName("name");
dat.setVersion("1.2.3");
}
@Test
- public void testGetReferencedDataTypes() {
+ void testGetReferencedDataTypes() {
JpaToscaDataType dt0 = new JpaToscaDataType(new PfConceptKey("dt0", "0.0.1"));
assertTrue(dt0.getReferencedDataTypes().isEmpty());
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.Validated;
import org.onap.policy.models.tosca.authorative.concepts.ToscaDataType;
-public class JpaToscaDataTypesTest {
+class JpaToscaDataTypesTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
@Test
- public void testDataTypes() {
+ void testDataTypes() {
assertNotNull(new JpaToscaDataTypes());
assertNotNull(new JpaToscaDataTypes(new PfConceptKey()));
assertNotNull(new JpaToscaDataTypes(new PfConceptKey(), new TreeMap<PfConceptKey, JpaToscaDataType>()));
}
@Test
- public void testDerivedDataTypes() {
+ void testDerivedDataTypes() {
List<Map<String, ToscaDataType>> dtMapList = new ArrayList<>();
dtMapList.add(new LinkedHashMap<>());
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfReferenceKey;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaEventFilterTest {
+class JpaToscaEventFilterTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
private static final String A_REQUREMENT = "A Requrement";
private static final String VERSION_001 = "0.0.1";
@Test
- public void testEventFilterPojo() {
+ void testEventFilterPojo() {
assertNotNull(new JpaToscaEventFilter());
assertNotNull(new JpaToscaEventFilter(new PfReferenceKey()));
assertNotNull(new JpaToscaEventFilter(new PfReferenceKey(), new PfConceptKey()));
}
@Test
- public void testEventFilter() {
+ void testEventFilter() {
PfConceptKey efParentKey = new PfConceptKey("tParentKey", VERSION_001);
PfReferenceKey efKey = new PfReferenceKey(efParentKey, "trigger0");
PfConceptKey nodeKey = new PfConceptKey("tParentKey", VERSION_001);
}
@Test
- public void testValidationEventFilter() {
+ void testValidationEventFilter() {
PfConceptKey efParentKey = new PfConceptKey("tParentKey", VERSION_001);
PfReferenceKey efKey = new PfReferenceKey(efParentKey, "trigger0");
PfConceptKey nodeKey = new PfConceptKey("tParentKey", VERSION_001);
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Map;
import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfModelService;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaModelTest {
+class JpaToscaModelTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
private static final String VERSION_001 = "0.0.1";
@Test
- public void testModelPojo() {
+ void testModelPojo() {
assertNotNull(new JpaToscaModel());
assertNotNull(new JpaToscaModel(new PfConceptKey()));
assertNotNull(new JpaToscaModel(new PfConceptKey(), new JpaToscaServiceTemplates()));
}
@Test
- public void testJpaToscaModel() {
+ void testJpaToscaModel() {
PfConceptKey tstsKey = new PfConceptKey("tsts", VERSION_001);
Map<PfConceptKey, JpaToscaServiceTemplate> tstMap = new TreeMap<>();
JpaToscaServiceTemplates tsts = new JpaToscaServiceTemplates(tstsKey, tstMap);
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.Validated;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
-public class JpaToscaPoliciesTest {
+class JpaToscaPoliciesTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
@Test
- public void testPoliciesErrors() {
+ void testPoliciesErrors() {
assertNotNull(new JpaToscaPolicies());
assertNotNull(new JpaToscaPolicies(new PfConceptKey()));
assertNotNull(new JpaToscaPolicies(new PfConceptKey(), new TreeMap<PfConceptKey, JpaToscaPolicy>()));
}
@Test
- public void testToscaPolicies() {
+ void testToscaPolicies() {
List<Map<String, ToscaPolicy>> polMapList = new ArrayList<>();
polMapList.add(new LinkedHashMap<>());
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfKey;
import org.onap.policy.models.base.PfUtils;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaPolicyTest {
+class JpaToscaPolicyTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
private static final String VERSION_001 = "0.0.1";
@Test
- public void testPolicyPojo() {
+ void testPolicyPojo() {
assertNotNull(new JpaToscaPolicy());
assertNotNull(new JpaToscaPolicy(new PfConceptKey()));
assertNotNull(new JpaToscaPolicy(new PfConceptKey(), new PfConceptKey()));
}
@Test
- public void testJpaToscaPolicy() {
+ void testJpaToscaPolicy() {
PfConceptKey tpKey = new PfConceptKey("tdt", VERSION_001);
PfConceptKey ptKey = new PfConceptKey("policyType", VERSION_001);
JpaToscaPolicy tp = new JpaToscaPolicy(tpKey, ptKey);
}
@Test
- public void testJpaToscaPolicyValidation() {
+ void testJpaToscaPolicyValidation() {
JpaToscaPolicy tp = setUpJpaToscaPolicy();
assertFalse(new JpaToscaPolicy().validate("").isValid());
assertTrue(tp.validate("").isValid());
}
@Test
- public void testJpaToscaPolicyAuthorative() {
+ void testJpaToscaPolicyAuthorative() {
JpaToscaPolicy tp = setUpJpaToscaPolicy();
PfConceptKey tpTypeKey = tp.getKey();
assertNotNull(tpTypeKey);
}
@Test
- public void testPolicyProperties() {
+ void testPolicyProperties() {
Map<String, Object> properties = new LinkedHashMap<>();
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfKey;
import org.onap.policy.models.base.PfReferenceKey;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaPolicyTypeTest {
+class JpaToscaPolicyTypeTest {
private static final String A_DESCRIPTION = "A Description";
private static final String VERSION_001 = "0.0.1";
@Test
- public void testPolicyTypeNull() {
+ void testPolicyTypeNull() {
assertNotNull(new JpaToscaPolicyType());
assertNotNull(new JpaToscaPolicyType(new PfConceptKey()));
assertNotNull(new JpaToscaPolicyType(new JpaToscaPolicyType()));
}
@Test
- public void testPolicyTypePojo() {
+ void testPolicyTypePojo() {
PfConceptKey ptKey = new PfConceptKey("tdt", VERSION_001);
JpaToscaPolicyType tpt = new JpaToscaPolicyType(ptKey);
}
@Test
- public void testPolicyTypeValidation() {
+ void testPolicyTypeValidation() {
JpaToscaPolicyType tpt = setUpJpaToscaPolicyType();
assertEquals(6, tpt.getKeys().size());
}
@Test
- public void testPolicyTypeValidation2() {
+ void testPolicyTypeValidation2() {
JpaToscaPolicyType tpt = setUpJpaToscaPolicyType();
tpt.getMetadata().put(null, null);
}
@Test
- public void testPolicyTypeEntity() {
+ void testPolicyTypeEntity() {
JpaToscaPolicyType tpt = setUpJpaToscaPolicyType();
assertThatThrownBy(() -> tpt.validate(null)).hasMessageMatching("fieldName is marked .*on.*ull but is null");
}
@Test
- public void testGetReferencedDataTypes() {
+ void testGetReferencedDataTypes() {
JpaToscaPolicyType pt0 = new JpaToscaPolicyType(new PfConceptKey("pt0", "0.0.1"));
assertTrue(pt0.getReferencedDataTypes().isEmpty());
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.Validated;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
-public class JpaToscaPolicyTypesTest {
+class JpaToscaPolicyTypesTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
@Test
- public void testPolicyTypesNull() {
+ void testPolicyTypesNull() {
assertNotNull(new JpaToscaPolicyTypes());
assertNotNull(new JpaToscaPolicyTypes(new PfConceptKey()));
assertNotNull(new JpaToscaPolicyTypes(new PfConceptKey(), new TreeMap<PfConceptKey, JpaToscaPolicyType>()));
}
@Test
- public void testPolicyTypes() {
+ void testPolicyTypes() {
List<Map<String, ToscaPolicyType>> ptMapList = new ArrayList<>();
ptMapList.add(new LinkedHashMap<>());
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfReferenceKey;
import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaPropertyTest {
+class JpaToscaPropertyTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
private static final String DEFAULT_KEY = "defaultKey";
private static final String VERSION_001 = "0.0.1";
@Test
- public void testPropertyNull() {
+ void testPropertyNull() {
assertNotNull(new JpaToscaProperty());
assertNotNull(new JpaToscaProperty(new PfReferenceKey()));
assertNotNull(new JpaToscaProperty(new PfReferenceKey(), new PfConceptKey()));
}
@Test
- public void testProperty() {
+ void testProperty() {
PfConceptKey pparentKey = new PfConceptKey("tParentKey", VERSION_001);
PfReferenceKey pkey = new PfReferenceKey(pparentKey, "trigger0");
PfConceptKey ptypeKey = new PfConceptKey("TTypeKey", VERSION_001);
}
@Test
- public void testPropertyCompareData() {
+ void testPropertyCompareData() {
JpaToscaProperty tp = setUpJpaToscaProperty();
PfReferenceKey otherDtKey = new PfReferenceKey("otherDt", VERSION_001, "OtherProperty");
}
@Test
- public void testPropertyCompareDescription() {
+ void testPropertyCompareDescription() {
JpaToscaProperty tp = setUpJpaToscaProperty();
JpaToscaProperty tdtClone0 = new JpaToscaProperty(tp);
}
@Test
- public void testPropertyCompareMetadata() {
+ void testPropertyCompareMetadata() {
JpaToscaProperty tp = setUpJpaToscaProperty();
PfConceptKey typeKey = new PfConceptKey("type", VERSION_001);
tp.setType(typeKey);
}
@Test
- public void testToAuthorative_testFromAuthorative() {
+ void testToAuthorative_testFromAuthorative() {
// check with empty structure
JpaToscaProperty tp = new JpaToscaProperty();
ToscaProperty auth = tp.toAuthorative();
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
/**
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaSchemaDefinitionTest {
+class JpaToscaSchemaDefinitionTest {
private static final String A_DESCRIPTION = "A Description";
@Test
- public void testEntrySchemaNull() {
+ void testEntrySchemaNull() {
assertNotNull(new JpaToscaSchemaDefinition(new PfConceptKey()));
assertNotNull(new JpaToscaSchemaDefinition(new JpaToscaSchemaDefinition(new PfConceptKey())));
}
@Test
- public void testEntrySchema() {
+ void testEntrySchema() {
PfConceptKey typeKey = new PfConceptKey("type", "0.0.1");
JpaToscaSchemaDefinition tes = new JpaToscaSchemaDefinition(typeKey);
}
@Test
- public void testEntrySchemaValidation() {
+ void testEntrySchemaValidation() {
PfConceptKey typeKey = new PfConceptKey("type", "0.0.1");
JpaToscaSchemaDefinition tes = setUpJpaToscaSchemaDefinition(typeKey);
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 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.
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfReferenceKey;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaServiceTemplateTest {
+class JpaToscaServiceTemplateTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
private static final String VERSION_001 = "0.0.1";
@Test
- public void testServiceTemplateNull() {
+ void testServiceTemplateNull() {
assertNotNull(new JpaToscaServiceTemplate());
assertNotNull(new JpaToscaServiceTemplate(new PfConceptKey()));
assertNotNull(new JpaToscaServiceTemplate(new PfConceptKey(), ""));
}
@Test
- public void testServiceTemplatePojo() {
+ void testServiceTemplatePojo() {
PfConceptKey tstKey = new PfConceptKey("tst", VERSION_001);
JpaToscaServiceTemplate tst = new JpaToscaServiceTemplate(tstKey, "Tosca Version");
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
* 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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
-public class JpaToscaServiceTemplatesTest {
+class JpaToscaServiceTemplatesTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
@Test
- public void testServiceTemplates() {
+ void testServiceTemplates() {
assertNotNull(new JpaToscaServiceTemplates());
assertNotNull(new JpaToscaServiceTemplates(new PfConceptKey()));
assertNotNull(
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.sql.Timestamp;
import java.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfReferenceKey;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaTimeIntervalTest {
+class JpaToscaTimeIntervalTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
@Test
- public void testTimeIntervalPojo() {
+ void testTimeIntervalPojo() {
assertNotNull(new JpaToscaTimeInterval());
assertNotNull(new JpaToscaTimeInterval(new PfReferenceKey()));
assertNotNull(new JpaToscaTimeInterval(new PfReferenceKey(), Instant.now(), Instant.now()));
}
@Test
- public void testTimeInterval() {
+ void testTimeInterval() {
PfConceptKey ttiParentKey = new PfConceptKey("tParentKey", "0.0.1");
PfReferenceKey ttiKey = new PfReferenceKey(ttiParentKey, "trigger0");
Instant startTime = Instant.ofEpochSecond(1000);
}
@Test
- public void testTimeIntervalValidation() {
+ void testTimeIntervalValidation() {
Instant startTime = Instant.ofEpochSecond(1000);
Instant endTime = Instant.ofEpochSecond(2000);
JpaToscaTimeInterval tti = setUpJpaToscaTimeInterval(startTime, endTime);
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Map;
import java.util.TreeMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfReferenceKey;
import org.onap.policy.models.tosca.authorative.concepts.ToscaTopologyTemplate;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaTopologyTemplateTest {
+class JpaToscaTopologyTemplateTest {
private static final String A_DESCRIPTION = "A Description";
private static final String VERSION_001 = "0.0.1";
@Test
- public void testTopologyTemplatePojo() {
+ void testTopologyTemplatePojo() {
assertNotNull(new JpaToscaTopologyTemplate());
assertNotNull(new JpaToscaTopologyTemplate(new PfReferenceKey()));
assertNotNull(new JpaToscaTopologyTemplate(new JpaToscaTopologyTemplate()));
}
@Test
- public void testTopologyTemplates() {
+ void testTopologyTemplates() {
PfReferenceKey tttKey = new PfReferenceKey("tst", VERSION_001, "ttt");
JpaToscaTopologyTemplate ttt = new JpaToscaTopologyTemplate(tttKey);
}
@Test
- public void testTopologyTemplateValidation() {
+ void testTopologyTemplateValidation() {
PfReferenceKey tttKey = new PfReferenceKey("tst", VERSION_001, "ttt");
JpaToscaTopologyTemplate ttt = new JpaToscaTopologyTemplate(tttKey);
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.time.Duration;
import java.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfReferenceKey;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class JpaToscaTriggerTest {
+class JpaToscaTriggerTest {
private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null";
private static final String EVENT_TYPE = "EventType";
private static final String VERSION_001 = "0.0.1";
@Test
- public void testTriggerPojo() {
+ void testTriggerPojo() {
assertNotNull(new JpaToscaTrigger());
assertNotNull(new JpaToscaTrigger(new PfReferenceKey()));
assertNotNull(new JpaToscaTrigger(new PfReferenceKey(), EVENT_TYPE, ACTION));
}
@Test
- public void testTriggerConstraints() {
+ void testTriggerConstraints() {
PfConceptKey tparentKey = new PfConceptKey("tParentKey", VERSION_001);
PfReferenceKey tkey = new PfReferenceKey(tparentKey, "trigger0");
JpaToscaTrigger tdt = new JpaToscaTrigger(tkey, EVENT_TYPE, ACTION);
}
@Test
- public void testCloneToscaTrigger() {
+ void testCloneToscaTrigger() {
PfConceptKey tparentKey = new PfConceptKey("tParentKey", VERSION_001);
PfReferenceKey tkey = new PfReferenceKey(tparentKey, "trigger0");
JpaToscaTrigger tdt = new JpaToscaTrigger(tkey, EVENT_TYPE, ACTION);
* ================================================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2021 Nordix Foundation.
+ * 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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.List;
import java.util.Map;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.tosca.authorative.concepts.ToscaWithTypeAndObjectProperties;
-public class JpaToscaWithStringPropertiesTest {
+class JpaToscaWithStringPropertiesTest {
private static final String SOME_DESCRIPTION = "some description";
private static final String KEY1 = "abc";
private static final String KEY2 = "def";
private MyJpa jpa;
- @Before
- public void setUp() {
+ @BeforeEach
+ void setUp() {
jpa = new MyJpa();
}
@Test
- public void testGetKeys() {
+ void testGetKeys() {
PfConceptKey key = new PfConceptKey("bye", "9.8.7");
PfConceptKey typeKey = new PfConceptKey("type", "6.5.4");
}
@Test
- public void testClean() {
+ void testClean() {
jpa.setDescription(" some description ");
jpa.setProperties(Map.of(KEY1, "10 ", KEY2, " 20"));
}
@Test
- public void testToAuthorative() {
+ void testToAuthorative() {
jpa.setDescription(SOME_DESCRIPTION);
jpa.setProperties(Map.of(KEY1, STRING1, KEY2, STRING2));
}
@Test
- public void testFromAuthorative() {
+ void testFromAuthorative() {
MyTosca tosca = new MyTosca();
tosca.setType("type");
tosca.setTypeVersion("1.2.3");
}
@Test
- public void testCompareTo() {
+ void testCompareTo() {
jpa.setDescription(SOME_DESCRIPTION);
jpa.setProperties(Map.of(KEY1, STRING1, KEY2, STRING2));
}
@Test
- public void testJpaToscaWithStringProperties() {
+ void testJpaToscaWithStringProperties() {
assertThat(jpa.getProperties()).isNull();
assertThat(jpa.getKey().isNullKey()).isTrue();
}
@Test
- public void testJpaToscaWithStringPropertiesPfConceptKey() {
+ void testJpaToscaWithStringPropertiesPfConceptKey() {
PfConceptKey key = new PfConceptKey("hello", "1.2.3");
jpa = new MyJpa(key);
}
@Test
- public void testJpaToscaWithStringPropertiesJpaToscaWithStringPropertiesOfT() {
+ void testJpaToscaWithStringPropertiesJpaToscaWithStringPropertiesOfT() {
jpa.setDescription(SOME_DESCRIPTION);
assertEquals(jpa, new MyJpa(jpa));
}
@Test
- public void testJpaToscaWithStringPropertiesT() {
+ void testJpaToscaWithStringPropertiesT() {
MyTosca tosca = new MyTosca();
tosca.setName("world");
tosca.setVersion("3.2.1");
}
@Test
- public void testValidateWithKey() {
+ void testValidateWithKey() {
// null key - should fail
jpa.setText("some text");
assertThat(jpa.validateWithKey("fieldA").isValid()).isFalse();
* ONAP
* ================================================================================
* Copyright (C) 2021 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.
package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.Collections;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfKey;
import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty;
import org.onap.policy.models.tosca.authorative.concepts.ToscaWithToscaProperties;
-public class JpaToscaWithToscaPropertiesTest {
+class JpaToscaWithToscaPropertiesTest {
private static final String SOME_DESCRIPTION = "some description";
private static final String KEY1 = "abc";
private static final String KEY2 = "def";
/**
* Initializes the properties.
*/
- @BeforeClass
+ @BeforeAll
public static void setUpBeforeClass() {
JPA_PROP1.setDescription(DESCRIPT1);
JPA_PROP2.setDescription(DESCRIPT2);
PROP2 = JPA_PROP2.toAuthorative();
}
- @Before
- public void setUp() {
+ @BeforeEach
+ void setUp() {
jpa = new MyJpa();
}
@Test
- public void testGetKeys() {
+ void testGetKeys() {
PfConceptKey key = new PfConceptKey("bye", "9.8.7");
jpa = new MyJpa(key);
}
@Test
- public void testClean() {
+ void testClean() {
jpa.clean();
jpa.setDescription(" some description ");
}
@Test
- public void testToAuthorative() {
+ void testToAuthorative() {
jpa.setDescription(SOME_DESCRIPTION);
jpa.setProperties(Map.of(KEY1, JPA_PROP1, KEY2, JPA_PROP2));
}
@Test
- public void testFromAuthorative() {
+ void testFromAuthorative() {
MyTosca tosca = new MyTosca();
tosca.setDescription(SOME_DESCRIPTION);
}
@Test
- public void testCompareTo() {
+ void testCompareTo() {
jpa.setDescription(SOME_DESCRIPTION);
jpa.setProperties(Map.of(KEY1, JPA_PROP1, KEY2, JPA_PROP2));
}
@Test
- public void testJpaToscaWithToscaProperties() {
+ void testJpaToscaWithToscaProperties() {
assertThat(jpa.getProperties()).isNull();
assertThat(jpa.getKey().isNullKey()).isTrue();
}
@Test
- public void testJpaToscaWithToscaPropertiesPfConceptKey() {
+ void testJpaToscaWithToscaPropertiesPfConceptKey() {
jpa = new MyJpa(CONCEPT_KEY1);
assertEquals(CONCEPT_KEY1, jpa.getKey());
}
@Test
- public void testJpaToscaWithToscaPropertiesJpaToscaWithToscaPropertiesOfT() {
+ void testJpaToscaWithToscaPropertiesJpaToscaWithToscaPropertiesOfT() {
jpa.setDescription(SOME_DESCRIPTION);
assertEquals(jpa, new MyJpa(jpa));
}
@Test
- public void testJpaToscaWithToscaPropertiesT() {
+ void testJpaToscaWithToscaPropertiesT() {
MyTosca tosca = new MyTosca();
tosca.setName("world");
tosca.setVersion("3.2.1");
}
@Test
- public void testValidateWithKey() {
+ void testValidateWithKey() {
// null key - should fail
jpa.setText("some text");
assertThat(jpa.validateWithKey("fieldA").isValid()).isFalse();
}
@Test
- public void testGetReferencedDataTypes() {
+ void testGetReferencedDataTypes() {
assertThat(jpa.getReferencedDataTypes()).isEmpty();
// one with a schema
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 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.
import com.openpojo.validation.rule.impl.GetterMustExistRule;
import com.openpojo.validation.test.impl.GetterTester;
import com.openpojo.validation.test.impl.SetterTester;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.test.ToStringTester;
/**
* @author Chenfei Gao (cgao@research.att.com)
*
*/
-public class TestPojos {
+class TestPojos {
private static final String POJO_PACKAGE = "org.onap.policy.models.tosca.simple.concepts";
@Test
- public void testPojos() {
+ void testPojos() {
// @formatter:off
final Validator validator = ValidatorBuilder
.create()
package org.onap.policy.models.tosca.simple.provider;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Properties;
import java.util.TreeMap;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class SimpleToscaProviderTest {
+class SimpleToscaProviderTest {
private static final String TEMPLATE_IS_NULL = "^serviceTemplate is marked .*on.*ull but is null$";
private static final String INCOMING_TEMPLATE_IS_NULL = "^incomingServiceTemplate is marked .*on.*ull but is null$";
private static final String VCPE_INPUT_JSON = "policies/vCPE.policy.monitoring.input.tosca.json";
*
* @throws Exception on database errors
*/
- @Before
- public void setupDao() throws Exception {
+ @BeforeEach
+ void setupDao() throws Exception {
final DaoParameters daoParameters = new DaoParameters();
daoParameters.setPluginClass(DefaultPfDao.class.getName());
/**
* Set up GSON.
*/
- @Before
- public void setupGson() {
+ @BeforeEach
+ void setupGson() {
standardCoder = new StandardCoder();
}
- @After
- public void teardown() {
+ @AfterEach
+ void teardown() {
pfDao.close();
}
@Test
- public void testCreateUpdateGetDeleteDataType() throws PfModelException {
+ void testCreateUpdateGetDeleteDataType() throws PfModelException {
PfConceptKey dataType0Key = new PfConceptKey("DataType0", "0.0.1");
JpaToscaDataType dataType0 = new JpaToscaDataType();
dataType0.setKey(dataType0Key);
}
@Test
- public void testCreateUpdateGetDeletePolicyType() throws PfModelException {
+ void testCreateUpdateGetDeletePolicyType() throws PfModelException {
JpaToscaServiceTemplate serviceTemplate = new JpaToscaServiceTemplate();
PfConceptKey dataType0Key = new PfConceptKey("DataType0", "0.0.1");
}
@Test
- public void testCreateUpdateGetDeletePolicyTypeWithDataType() throws PfModelException {
+ void testCreateUpdateGetDeletePolicyTypeWithDataType() throws PfModelException {
PfConceptKey policyType0Key = new PfConceptKey("PolicyType0", "0.0.1");
JpaToscaPolicyType policyType0 = new JpaToscaPolicyType();
policyType0.setKey(policyType0Key);
}
@Test
- public void testPoliciesGet() throws Exception {
+ void testPoliciesGet() throws Exception {
ToscaServiceTemplate toscaServiceTemplate =
standardCoder.decode(ResourceUtils.getResourceAsString(VCPE_INPUT_JSON), ToscaServiceTemplate.class);
}
@Test
- public void testPolicyCreate() throws Exception {
+ void testPolicyCreate() throws Exception {
ToscaServiceTemplate toscaServiceTemplate =
standardCoder.decode(ResourceUtils.getResourceAsString(VCPE_INPUT_JSON), ToscaServiceTemplate.class);
}
@Test
- public void testPolicyCreateTypeAndVersion() throws Exception {
+ void testPolicyCreateTypeAndVersion() throws Exception {
ToscaServiceTemplate toscaServiceTemplate =
standardCoder.decode(ResourceUtils.getResourceAsString(VCPE_INPUT_JSON), ToscaServiceTemplate.class);
}
@Test
- public void testPolicyUpdate() throws Exception {
+ void testPolicyUpdate() throws Exception {
ToscaServiceTemplate toscaServiceTemplate =
standardCoder.decode(ResourceUtils.getResourceAsString(VCPE_INPUT_JSON), ToscaServiceTemplate.class);
}
@Test
- public void testPoliciesDelete() throws Exception {
+ void testPoliciesDelete() throws Exception {
ToscaServiceTemplate toscaServiceTemplate =
standardCoder.decode(ResourceUtils.getResourceAsString(VCPE_INPUT_JSON), ToscaServiceTemplate.class);
}
@Test
- public void testAssertPoliciesExist() {
+ void testAssertPoliciesExist() {
JpaToscaServiceTemplate testServiceTemplate = new JpaToscaServiceTemplate();
assertThatThrownBy(() -> new SimpleToscaProvider().createPolicies(pfDao, testServiceTemplate))
}
@Test
- public void testGetServiceTemplate() throws PfModelException {
+ void testGetServiceTemplate() throws PfModelException {
assertThatThrownBy(() -> new SimpleToscaProvider().getServiceTemplate(pfDao))
.hasMessage("service template not found in database");
}
@Test
- public void testAppendToServiceTemplate() throws PfModelException {
+ void testAppendToServiceTemplate() throws PfModelException {
JpaToscaServiceTemplate serviceTemplateFragment = new JpaToscaServiceTemplate();
serviceTemplateFragment.setPolicyTypes(new JpaToscaPolicyTypes());
JpaToscaPolicyType badPt = new JpaToscaPolicyType();
}
@Test
- public void testGetDataTypesCornerCases() throws PfModelException {
+ void testGetDataTypesCornerCases() throws PfModelException {
assertThatThrownBy(() -> {
new SimpleToscaProvider().getDataTypes(pfDao, "hello", "0.0.1");
}).hasMessageMatching("service template not found in database");
}
@Test
- public void testGetPolicyTypesCornerCases() throws PfModelException {
+ void testGetPolicyTypesCornerCases() throws PfModelException {
assertThatThrownBy(() -> {
new SimpleToscaProvider().getPolicyTypes(pfDao, "hello", "0.0.1");
}).hasMessageMatching("service template not found in database");
}
@Test
- public void testGetPoliciesCornerCases() throws PfModelException {
+ void testGetPoliciesCornerCases() throws PfModelException {
assertThatThrownBy(() -> {
new SimpleToscaProvider().getPolicies(pfDao, "hello", "0.0.1");
}).hasMessageMatching("service template not found in database");
}
@Test
- public void testNonNullsDataType() {
+ void testNonNullsDataType() {
assertThatThrownBy(() -> {
new SimpleToscaProvider().getServiceTemplate(null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testNotNullsPolicyTypes() {
+ void testNotNullsPolicyTypes() {
assertThatThrownBy(() -> {
new SimpleToscaProvider().getPolicyTypes(null, null, null);
}).hasMessageMatching(DAO_IS_NULL);
}
@Test
- public void testDeleteServiceTemplate() throws PfModelException {
+ void testDeleteServiceTemplate() throws PfModelException {
assertThatThrownBy(() -> {
new SimpleToscaProvider().deleteServiceTemplate(null);
}).hasMessageMatching("^dao is marked .*on.*ull but is null$");
}
@Test
- public void testNullParameters() {
+ void testNullParameters() {
assertThatThrownBy(() -> {
new SimpleToscaProvider().getCascadedDataTypes(null, null, null);
}).hasMessageMatching("^dbServiceTemplate is marked .*on.*ull but is null$");
package org.onap.policy.models.tosca.simple.provider;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Properties;
import java.util.TreeMap;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.dao.DaoParameters;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class SimpleToscaServiceTemplateProviderTest {
+class SimpleToscaServiceTemplateProviderTest {
private static final String TEMPLATE_IS_NULL = "^serviceTemplate is marked .*on.*ull but is null$";
private static final String DAO_IS_NULL = "^dao is marked .*on.*ull but is null$";
*
* @throws Exception on database errors
*/
- @Before
- public void setupDao() throws Exception {
+ @BeforeEach
+ void setupDao() throws Exception {
final DaoParameters daoParameters = new DaoParameters();
daoParameters.setPluginClass(DefaultPfDao.class.getName());
pfDao.init(daoParameters);
}
- @After
- public void teardown() {
+ @AfterEach
+ void teardown() {
pfDao.close();
}
@Test
- public void testCreateUpdateGetDeleteDataType() throws PfModelException {
+ void testCreateUpdateGetDeleteDataType() throws PfModelException {
JpaToscaServiceTemplate serviceTemplate = new JpaToscaServiceTemplate();
serviceTemplate.setMetadata(new TreeMap<String, String>());
}
@Test
- public void testNonNulls() {
+ void testNonNulls() {
assertThatThrownBy(() -> {
new SimpleToscaServiceTemplateProvider().write(null, null);
}).hasMessageMatching(DAO_IS_NULL);
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
* Copyright (C) 2019-2020,2022 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.
package org.onap.policy.models.tosca.simple.serialization;
import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.coder.YamlJsonTranslator;
* @author Liam Fallon (liam.fallon@est.tech)
* @author Chenfei Gao (cgao@research.att.com)
*/
-public class MonitoringPolicySerializationTest {
+class MonitoringPolicySerializationTest {
private static final String VERSION = "version";
private final YamlJsonTranslator yamlJsonTranslator = new YamlJsonTranslator();
@Test
- public void testDeserialization() throws Exception {
+ void testDeserialization() throws Exception {
String policyTypeInputJson =
ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml");
ToscaServiceTemplate plainPolicyTypes =
}
@Test
- public void testSerialization() {
+ void testSerialization() {
assertThatCode(() -> {
// vCPE
JpaToscaServiceTemplate serviceTemplate = deserializeMonitoringInputJson(VCPE_MON_INPUT_JSON);
package org.onap.policy.models.tosca.simple.serialization;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
*
* @author Chenfei Gao (cgao@research.att.com)
*/
-public class MonitoringPolicyTypeSerializationTest {
+class MonitoringPolicyTypeSerializationTest {
private static final String DATATYPE_ROOT = "tosca.datatypes.Root";
private StandardCoder coder;
- @Before
- public void setUp() {
+ @BeforeEach
+ void setUp() {
coder = new StandardCoder();
}
@Test
- public void testDeserialization() throws Exception {
+ void testDeserialization() throws Exception {
// TCA v1
JpaToscaServiceTemplate serviceTemplateFromYaml = deserializeMonitoringInputYaml(MONITORING_TCA_YAML);
verifyTcaInputDeserialization(serviceTemplateFromYaml, VERSION_100, TCA_V1);
}
@Test
- public void testSerialization() throws Exception {
+ void testSerialization() throws Exception {
// TCA v1
JpaToscaServiceTemplate tcaServiceTemplateFromYaml = deserializeMonitoringInputYaml(MONITORING_TCA_YAML);
String serializedServiceTemplateTca = serializeMonitoringServiceTemplate(tcaServiceTemplateFromYaml);
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020, 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.
package org.onap.policy.models.tosca.simple.serialization;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections4.MapUtils;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate;
import org.yaml.snakeyaml.Yaml;
-public class OptimizationPolicyTypeSerializationTest {
+class OptimizationPolicyTypeSerializationTest {
private static final String TYPE_ROOT = "tosca.policies.Root";
private static final String VERSION = "1.0.0";
private StandardCoder coder;
- @Before
- public void setUp() {
+ @BeforeEach
+ void setUp() {
coder = new StandardCoder();
}
@Test
- public void testOptimization() throws CoderException {
+ void testOptimization() throws CoderException {
JpaToscaServiceTemplate svctmpl = loadYaml(INPUT_OPTIMIZATION_YAML);
validate("initial object", svctmpl, TYPE_ROOT, "onap.policies.Optimization", false, false);
}
@Test
- public void testOptimizationResource() throws CoderException {
+ void testOptimizationResource() throws CoderException {
JpaToscaServiceTemplate svctmpl = loadYaml(INPUT_OPTIMIZATION_RESOURCE_YAML);
validate("initial object", svctmpl, "onap.policies.Optimization", "onap.policies.optimization.Resource", true,
true);
}
@Test
- public void testOptimizationService() throws CoderException {
+ void testOptimizationService() throws CoderException {
JpaToscaServiceTemplate svctmpl = loadYaml(INPUT_OPTIMIZATION_SERVICE_YAML);
validate("initial object", svctmpl, "onap.policies.Optimization", "onap.policies.optimization.Service", false,
true);
boolean checkResource, boolean checkService) {
JpaToscaPolicyTypes policyTypes = svctmpl.getPolicyTypes();
- assertEquals(testnm + " type count", 1, policyTypes.getConceptMap().size());
+ assertEquals(1, policyTypes.getConceptMap().size(), testnm + " type count");
JpaToscaPolicyType policyType = policyTypes.getConceptMap().values().iterator().next();
- assertEquals(testnm + " name", typeName, policyType.getName());
- assertEquals(testnm + " version", VERSION, policyType.getVersion());
+ assertEquals(typeName, policyType.getName(), testnm + " name");
+ assertEquals(VERSION, policyType.getVersion(), testnm + " version");
- assertNotNull(testnm + " derived from", policyType.getDerivedFrom());
- assertEquals(testnm + " derived from name", derivedFrom, policyType.getDerivedFrom().getName());
+ assertNotNull(String.valueOf(policyType.getDerivedFrom()), testnm + " derived from");
+ assertEquals(derivedFrom, policyType.getDerivedFrom().getName(), testnm + " derived from name");
Map<String, JpaToscaProperty> props = policyType.getProperties();
- assertNotNull(testnm + " properties", props);
+ assertNotNull(props.toString(), testnm + " properties");
if (checkResource && checkService) {
validateResources(testnm, props.get("resources"));
private void validateScope(String testName, JpaToscaProperty prop) {
String testnm = testName + " scope";
- assertNotNull(testnm, prop);
+ assertNotNull(prop, testnm);
validateMatchable(testnm, prop.getMetadata());
}
private void validateServices(String testName, JpaToscaProperty prop) {
String testnm = testName + " services";
- assertNotNull(testnm, prop);
+ assertNotNull(prop, testnm);
validateMatchable(testnm, prop.getMetadata());
}
private void validateResources(String testName, JpaToscaProperty prop) {
String testnm = testName + " resources";
- assertNotNull(testnm, prop);
+ assertNotNull(prop, testnm);
validateMatchable(testnm, prop.getMetadata());
}
private void validateGeography(String testName, JpaToscaProperty prop) {
String testnm = testName + " geography";
- assertNotNull(testnm, prop);
+ assertNotNull(prop, testnm);
// this line results in a stack overflow
// assertEquals(testnm + " name", "geography", prop.getName());
- assertEquals(testnm + " description", "One or more geographic regions", prop.getDescription());
- assertEquals(testnm + " type", "list", prop.getType().getName());
+ assertEquals("One or more geographic regions", prop.getDescription(), testnm + " description");
+ assertEquals("list", prop.getType().getName(), testnm + " description");
validateMatchable(testnm, prop.getMetadata());
- assertTrue(testnm + " required", prop.isRequired());
- assertEquals(testnm + " entry_schema", "string", prop.getEntrySchema().getType().getName());
+ assertTrue(prop.isRequired(), testnm + " required");
+ assertEquals("string", prop.getEntrySchema().getType().getName(), testnm + " description");
List<JpaToscaConstraint> constraints = prop.getEntrySchema().getConstraints();
- assertNotNull(testnm + " constraints", constraints);
+ assertNotNull(constraints, testnm + " constraints");
- assertEquals(testnm + " constraint size", 1, constraints.size());
- assertTrue(testnm + " constraint type", constraints.get(0) instanceof JpaToscaConstraintValidValues);
+ assertEquals(1, constraints.size(), testnm + " constraint size");
+ assertInstanceOf(JpaToscaConstraintValidValues.class, constraints.get(0), testnm + " constraint type");
JpaToscaConstraintValidValues constraint = (JpaToscaConstraintValidValues) constraints.get(0);
- assertEquals(testnm + " valid values", "[US, International]", constraint.getValidValues().toString());
+ assertEquals("[US, International]", constraint.getValidValues().toString(), testnm + " valid values");
}
private void validateIdentity(String testName, JpaToscaProperty prop) {
String testnm = testName + " identity";
- assertNotNull(testnm, prop);
- assertEquals(testnm + " metadata", true, MapUtils.isEmpty(prop.getMetadata()));
+ assertNotNull(prop, testnm);
+ assertTrue(MapUtils.isEmpty(prop.getMetadata()), testnm + " metadata");
}
private void validateMatchable(String testName, Map<String, String> metadata) {
String testnm = testName + " matchable";
- assertNotNull(testnm + " metadata", metadata);
- assertEquals(testnm + " value", "true", metadata.get("matchable"));
+ assertNotNull(metadata, testnm + " metadata");
+ assertEquals("true", metadata.get("matchable"), testnm + " value");
}
}
* ============LICENSE_START=======================================================
* Copyright (C) 2020-2021 Nordix Foundation.
* Modifications Copyright (C) 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.
package org.onap.policy.models.tosca.utils;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Iterator;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.Validated;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaDataType;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class ToscaServiceTemplateUtilsTest {
+class ToscaServiceTemplateUtilsTest {
@Test
- public void testAddFragmentNulls() {
+ void testAddFragmentNulls() {
assertThatThrownBy(() -> {
ToscaServiceTemplateUtils.addFragment(null, null);
}).hasMessageMatching("originalTemplate is marked .*on.*ull but is null");
}
@Test
- public void testAddFragment() {
+ void testAddFragment() {
JpaToscaServiceTemplate originalTemplate = new JpaToscaServiceTemplate();
JpaToscaServiceTemplate fragmentTemplate00 = new JpaToscaServiceTemplate();
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 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.
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfKey;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
-public class ToscaUtilsTest {
+class ToscaUtilsTest {
@Test
- public void testAssertDataTypes() {
+ void testAssertDataTypes() {
JpaToscaServiceTemplate jpaToscaServiceTemplate = new JpaToscaServiceTemplate();
assertFalse(ToscaUtils.doDataTypesExist(jpaToscaServiceTemplate));
}
@Test
- public void testAssertPolicyTypes() {
+ void testAssertPolicyTypes() {
JpaToscaServiceTemplate jpaToscaServiceTemplate = new JpaToscaServiceTemplate();
assertFalse(ToscaUtils.doPolicyTypesExist(jpaToscaServiceTemplate));
}
@Test
- public void testAssertPolicies() {
+ void testAssertPolicies() {
JpaToscaServiceTemplate jpaToscaServiceTemplate = new JpaToscaServiceTemplate();
assertFalse(ToscaUtils.doPoliciesExist(jpaToscaServiceTemplate));
}
@Test
- public void testGetentityTypeAncestors() {
+ void testGetentityTypeAncestors() {
assertThatThrownBy(() -> {
ToscaUtils.getEntityTypeAncestors(null, null, null);
}).hasMessageMatching("entityTypes is marked .*on.*ull but is null");
}
@Test
- public void testGetentityTypeAncestorsDataType() {
+ void testGetentityTypeAncestorsDataType() {
JpaToscaDataTypes dataTypes = new JpaToscaDataTypes();
JpaToscaDataType dt0 = new JpaToscaDataType();
}
@Test
- public void testGetPredefinedDataTypes() {
+ void testGetPredefinedDataTypes() {
assertTrue(ToscaUtils.getPredefinedDataTypes().contains(new PfConceptKey("string", PfKey.NULL_KEY_VERSION)));
}
@Test
- public void testgetEntityTree() {
+ void testgetEntityTree() {
assertThatThrownBy(() -> {
ToscaUtils.getEntityTree(null, null, null);
}).hasMessageMatching("entityTypes is marked .*on.*ull but is null");