*
* ================================================================================
* 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.aai;
-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.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 java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.aai.domain.yang.CloudRegion;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aai.domain.yang.ModelVer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class AaiCqResponseTest {
+class AaiCqResponseTest {
private static final String ETE_VFMODULE = "Vfmodule_Ete_vFWCLvFWSNK_7ba1fbde_0";
private static final String ETE_VNF = "Ete_vFWCLvFWSNK_7ba1fbde_0";
private static final Logger LOGGER = LoggerFactory.getLogger(AaiCqResponseTest.class);
"src/test/resources/org/onap/policy/aai/AaiCqResponseFull.json";
@Test
- public void testConstructor() throws Exception {
+ void testConstructor() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testMultiThreaded() throws Exception {
+ void testMultiThreaded() throws Exception {
final AtomicInteger success = new AtomicInteger(0);
final String json = getAaiCqResponse();
}
@Test
- public void testAaiMalformedCqResponse() throws Exception {
+ void testAaiMalformedCqResponse() throws Exception {
String responseString = Files.readString(
new File("src/test/resources/org/onap/policy/aai/AaiMalformedCqResponse.json").toPath(),
StandardCharsets.UTF_8);
}
@Test
- public void testGetItemByList() throws Exception {
+ void testGetItemByList() throws Exception {
/*
* Read JSON String and add all AaiObjects
*/
}
@Test
- public void testGetServiceInstance() throws Exception {
+ void testGetServiceInstance() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetDefaultCloudRegion() throws Exception {
+ void testGetDefaultCloudRegion() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetDefaultTenant() throws Exception {
+ void testGetDefaultTenant() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetGenericVnfs() throws Exception {
+ void testGetGenericVnfs() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetDefaultGenericVnf() throws Exception {
+ void testGetDefaultGenericVnf() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetGenericVnfByName() throws Exception {
+ void testGetGenericVnfByName() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetGenericVnfByModelInvariantId() throws Exception {
+ void testGetGenericVnfByModelInvariantId() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetGenericVnfByVfModuleModelInvariantId() throws Exception {
+ void testGetGenericVnfByVfModuleModelInvariantId() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetAllVfModules() throws Exception {
+ void testGetAllVfModules() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetVfModuleByVfModuleName() throws Exception {
+ void testGetVfModuleByVfModuleName() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetVfModuleByVfModelInvariantId() throws Exception {
+ void testGetVfModuleByVfModelInvariantId() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetDefaultVfModule() throws Exception {
+ void testGetDefaultVfModule() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetVserver() throws Exception {
+ void testGetVserver() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetAllModelVer() throws Exception {
+ void testGetAllModelVer() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetModelVerByVersionId() throws Exception {
+ void testGetModelVerByVersionId() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse;
}
@Test
- public void testGetVfModuleCount() throws Exception {
+ void testGetVfModuleCount() throws Exception {
String responseString = getAaiCqResponse();
AaiCqResponse aaiCqResponse = new AaiCqResponse(responseString);
int count = aaiCqResponse.getVfModuleCount("47958575-138f-452a-8c8d-d89b595f8164",
* aai
* ================================================================================
* Copyright (C) 2017-2021 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.aai;
-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 static org.mockito.ArgumentMatchers.anyMap;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.contains;
import java.util.Map;
import java.util.UUID;
import org.apache.commons.lang3.tuple.Pair;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.onap.policy.rest.RestManager;
-public class AaiManagerTest {
+class AaiManagerTest {
private static final String CQ_QUERY_URL = "http://testing.cq.query";
private static final String DOROTHY = "Dorothy";
private static final String SOME_URL = "http://somewhere.over.the.rainbow";
*
* @throws Exception if error occurs
*/
- @Before
- public void beforeTestAaiManager() throws Exception {
+ @BeforeEach
+ void beforeTestAaiManager() throws Exception {
restManagerMock = mock(RestManager.class);
String aaiCqResponse = new AaiCqResponseTest().getAaiCqResponse();
@Test
- public void testAaiCqResponse() {
+ void testAaiCqResponse() {
AaiManager aaiManager = new AaiManager(restManagerMock);
assertNotNull(aaiManager);
@Test
- public void testAaiManagerGetPnf() {
+ void testAaiManagerGetPnf() {
AaiManager aaiManager = new AaiManager(restManagerMock);
assertNotNull(aaiManager);
String pnfName = "test-pnf";
* appc
* ================================================================================
* Copyright (C) 2017-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.
package org.onap.policy.appc;
import static org.assertj.core.api.Assertions.assertThat;
-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.time.Instant;
import java.util.ArrayList;
import java.util.Map;
import java.util.UUID;
import java.util.function.BiConsumer;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class CommonHeaderTest {
+class CommonHeaderTest {
private static final String KANSAS = "Kansas";
private static final String DOROTHY = "Dorothy";
private static final String CAN_I_GO_HOME = "Can I go home?";
@Test
- public void testCommonHeader() {
+ void testCommonHeader() {
CommonHeader commonHeader = new CommonHeader();
assertNotNull(commonHeader);
assertNotNull(new CommonHeader(commonHeader));
* appc
* ================================================================================
* Copyright (C) 2017-2019 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.
package org.onap.policy.appc;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class EnumsTest {
+class EnumsTest {
@Test
- public void testResponseCode() {
+ void testResponseCode() {
assertEquals(5, ResponseCode.values().length);
assertNull(ResponseCode.toResponseCode(0));
}
@Test
- public void testResponseValue() {
+ void testResponseValue() {
assertEquals(5, ResponseValue.values().length);
assertNull(ResponseValue.toResponseValue("Dorothy"));
* appc
* ================================================================================
* Copyright (C) 2017-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.
package org.onap.policy.appc;
import static org.assertj.core.api.Assertions.assertThat;
-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.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class RequestTest {
+class RequestTest {
private static final String WIZARD = "Wizard";
private static final String GO_TO_OZ = "Go to Oz";
@Test
- public void testRequest() {
+ void testRequest() {
Request request = new Request();
assertNotNull(request);
assertNotEquals(0, request.hashCode());
* appc
* ================================================================================
* Copyright (C) 2017-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.
package org.onap.policy.appc;
import static org.assertj.core.api.Assertions.assertThat;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ResponseStatusTest {
+class ResponseStatusTest {
private static final String THERE_S_NO_PLACE_LIKE_HOME = "There's no place like home";
private static final String THE_WONDERFUL_LAND_OF_OZ = "The wonderful land of Oz";
@Test
- public void testResonseStatus() {
+ void testResponseStatus() {
ResponseStatus status = new ResponseStatus();
assertNotNull(status);
assertNotEquals(0, status.hashCode());
* appc
* ================================================================================
* Copyright (C) 2017-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.
package org.onap.policy.appc;
import static org.assertj.core.api.Assertions.assertThat;
-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.HashMap;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ResponseTest {
+class ResponseTest {
@Test
- public void testResonse() {
+ void testResonse() {
Response response = new Response();
assertNotNull(response);
assertNotNull(new Response(new Request()));
* appc
* ================================================================================
* Copyright (C) 2017-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.
package org.onap.policy.appc.util;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.JsonParseException;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SerializationTest {
+class SerializationTest {
@Test
- public void test() {
+ void test() {
String nameString = "Dorothy";
String jsonName = Serialization.gsonPretty.toJson(nameString, String.class);
assertEquals("\"Dorothy\"", jsonName);
* appclcm
* ================================================================================
* Copyright (C) 2017-2019 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.
package org.onap.policy.appclcm;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class AppcLcmCommonHeaderTest {
+class AppcLcmCommonHeaderTest {
@Test
- public void testAppcLcmCommonHeaderConstructor() {
+ void testAppcLcmCommonHeaderConstructor() {
AppcLcmCommonHeader commonHeader = new AppcLcmCommonHeader("Policy", UUID.randomUUID(), "1");
AppcLcmCommonHeader commonHeaderCopy = new AppcLcmCommonHeader(commonHeader);
assertEquals(commonHeader, commonHeaderCopy);
* appclcm
* ================================================================================
* 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.
import com.openpojo.validation.ValidatorBuilder;
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;
-public class AppcLcmModelsTest {
+class AppcLcmModelsTest {
private static final String POJO_PACKAGE = "org.onap.policy.appclcm";
@Test
- public void testAppcLcmModels() {
+ void testAppcLcmModels() {
final Validator validator = ValidatorBuilder.create().with(new ToStringTester()).with(new SetterTester())
.with(new GetterTester()).build();
* appclcm
* ================================================================================
* Copyright (C) 2017-2019 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.
package org.onap.policy.appclcm;
-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 java.util.Map;
import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class AppcLcmOutputTest {
+class AppcLcmOutputTest {
@Test
- public void testAppcLcmOutput() {
+ void testAppcLcmOutput() {
AppcLcmCommonHeader commonHeader = new AppcLcmCommonHeader("Policy", UUID.randomUUID(), "1");
Map<String, String> actionIdentifiers = new HashMap<>();
AppcLcmInput input = new AppcLcmInput(commonHeader, "testAction", actionIdentifiers, "testPayload");
* appclcm
* ================================================================================
* Copyright (C) 2017-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.appclcm;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class AppcLcmResponseCodeTest {
+class AppcLcmResponseCodeTest {
@Test
- public void testAppcLcmResponseCode() {
+ void testAppcLcmResponseCode() {
assertNull(AppcLcmResponseCode.toResponseValue(0));
assertEquals(AppcLcmResponseCode.ACCEPTED, AppcLcmResponseCode.toResponseValue(100));
* appclcm
* ================================================================================
* Copyright (C) 2017-2019 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.
package org.onap.policy.appclcm.util;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SerializationTest {
+class SerializationTest {
@Test
- public void test() {
+ void test() {
String nameString = "Dorothy";
String jsonName = Serialization.gsonPretty.toJson(nameString, String.class);
assertEquals("\"Dorothy\"", jsonName);
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Bell Canada.
* 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.cds.client;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.AdditionalAnswers.delegatesTo;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.ArgumentMatchers;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
import org.onap.policy.cds.properties.CdsServerProperties;
-public class BasicAuthClientHeaderInterceptorTest {
+class BasicAuthClientHeaderInterceptorTest {
// Generate a unique in-process server name.
private static final String SERVER_NAME = InProcessServerBuilder.generateName();
private static final String CREDS = "test";
// Manages automatic graceful shutdown for the registered server and client channels at the end of test.
- @Rule
- public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule();
+ private final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule();
private final ServerInterceptor mockCdsGrpcServerInterceptor = mock(ServerInterceptor.class,
delegatesTo(new TestServerInterceptor()));
*
* @throws IOException on failure to register the test grpc server for graceful shutdown
*/
- @Before
- public void setUp() throws IOException {
+ @BeforeEach
+ void setUp() throws IOException {
// Setup the CDS properties
props.setHost(SERVER_NAME);
props.setPort(2000);
}
@Test
- public void testIfBasicAuthHeaderIsDeliveredToCdsServer() {
+ void testIfBasicAuthHeaderIsDeliveredToCdsServer() {
BluePrintProcessingServiceStub bpProcessingSvcStub = BluePrintProcessingServiceGrpc
.newStub(ClientInterceptors.intercept(channel, new BasicAuthClientHeaderInterceptor(props)));
ArgumentCaptor<Metadata> metadataCaptor = ArgumentCaptor.forClass(Metadata.class);
@Override
public <Q, P> Listener<Q> interceptCall(final ServerCall<Q, P> serverCall,
- final Metadata metadata, final ServerCallHandler<Q, P> serverCallHandler) {
+ final Metadata metadata, final ServerCallHandler<Q, P>
+ serverCallHandler) {
return serverCallHandler.startCall(serverCall, metadata);
}
}
}
-
-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Bell Canada.
* 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.cds.client;
import static org.assertj.core.api.Assertions.assertThatCode;
-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.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import io.grpc.inprocess.InProcessChannelBuilder;
import io.grpc.inprocess.InProcessServerBuilder;
import io.grpc.stub.StreamObserver;
-import io.grpc.testing.GrpcCleanupRule;
import io.grpc.util.MutableHandlerRegistry;
import java.io.IOException;
import java.util.ArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-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.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
import org.onap.policy.cds.api.TestCdsProcessorListenerImpl;
import org.onap.policy.cds.properties.CdsServerProperties;
-public class CdsProcessorGrpcClientTest {
+class CdsProcessorGrpcClientTest {
- // Generate a unique in-process server name.
- private static final String SERVER_NAME = InProcessServerBuilder.generateName();
-
- // Manages automatic graceful shutdown for the registered server and client channels at the end of test.
- @Rule
- public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule();
-
- private final CdsProcessorListener listener = spy(new TestCdsProcessorListenerImpl());
- private final CdsServerProperties props = new CdsServerProperties();
- private final MutableHandlerRegistry serviceRegistry = new MutableHandlerRegistry();
- private final AtomicReference<StreamObserver<ExecutionServiceOutput>> responseObserverRef = new AtomicReference<>();
- private final List<String> messagesDelivered = new ArrayList<>();
- private final CountDownLatch allRequestsDelivered = new CountDownLatch(1);
+ private CdsProcessorListener listener;
+ private CdsServerProperties props;
+ private MutableHandlerRegistry serviceRegistry;
+ private AtomicReference<StreamObserver<ExecutionServiceOutput>> responseObserverRef;
+ private List<String> messagesDelivered;
+ private CountDownLatch allRequestsDelivered;
+ private ManagedChannel channel;
private CdsProcessorGrpcClient client;
/**
*
* @throws IOException on failure to register the test grpc server for graceful shutdown
*/
- @Before
- public void setUp() throws IOException {
+ @BeforeEach
+ void setUp() throws IOException {
+
+ listener = spy(new TestCdsProcessorListenerImpl());
+ props = new CdsServerProperties();
+ serviceRegistry = new MutableHandlerRegistry();
+ responseObserverRef = new AtomicReference<>();
+ messagesDelivered = new ArrayList<>();
+ allRequestsDelivered = new CountDownLatch(1);
+
// Setup the CDS properties
- props.setHost(SERVER_NAME);
+ // Generate a unique in-process server name.
+ String serverName = InProcessServerBuilder.generateName();
+ props.setHost(serverName);
props.setPort(2000);
props.setUsername("testUser");
props.setPassword("testPassword");
props.setTimeout(60);
// Create a server, add service, start, and register for automatic graceful shutdown.
- grpcCleanup.register(InProcessServerBuilder.forName(SERVER_NAME)
- .fallbackHandlerRegistry(serviceRegistry).directExecutor().build().start());
+ InProcessServerBuilder.forName(serverName)
+ .fallbackHandlerRegistry(serviceRegistry).directExecutor().build().start();
- // Create a client channel and register for automatic graceful shutdown
- ManagedChannel channel = grpcCleanup
- .register(InProcessChannelBuilder.forName(SERVER_NAME).directExecutor().build());
+ // Create a client channel
+ channel = InProcessChannelBuilder.forName(serverName).directExecutor().build();
// Create an instance of the gRPC client
client = new CdsProcessorGrpcClient(channel, new CdsProcessorHandler(listener, "gRPC://localhost:1234/"));
serviceRegistry.addService(testCdsBlueprintServerImpl);
}
- @After
- public void tearDown() {
- client.close();
+ /**
+ * Cleans up resources after each test execution.
+ * This method ensures that the gRPC client and channel are properly closed and released after each test.
+ * It is annotated with {@code @AfterEach} to automatically run after each test method in the class.
+ * If the {@code client} is not {@code null}, it calls the {@code close} method to release resources
+ * used by the client.
+ * If the {@code channel} is not {@code null}, it calls the {@code shutdownNow} method
+ * to forcefully close the channel.
+ */
+ @AfterEach
+ void tearDown() {
+ if (client != null) {
+ client.close();
+ }
+ if (channel != null) {
+ channel.shutdownNow();
+ }
}
@Test
- public void testCdsProcessorGrpcClientConstructor() {
+ void testCdsProcessorGrpcClientConstructor() {
assertThatCode(() -> new CdsProcessorGrpcClient(listener, props).close()).doesNotThrowAnyException();
}
- @Test(expected = IllegalStateException.class)
- public void testCdsProcessorGrpcClientConstructorFailure() {
+ @Test
+ void testCdsProcessorGrpcClientConstructorFailure() {
props.setHost(null);
- new CdsProcessorGrpcClient(listener, props).close();
+ assertThrows(IllegalStateException.class, () -> {
+ new CdsProcessorGrpcClient(listener, props).close();
+ });
}
@Test
- public void testSendRequestFail() throws InterruptedException {
+ void testSendRequestFail() throws InterruptedException {
// Setup
ExecutionServiceInput testReq = ExecutionServiceInput.newBuilder()
.setActionIdentifiers(ActionIdentifiers.newBuilder().setActionName("policy-to-cds").build())
}
@Test
- public void testSendRequestSuccess() throws InterruptedException {
+ void testSendRequestSuccess() throws InterruptedException {
// Setup request
ExecutionServiceInput testReq1 = ExecutionServiceInput.newBuilder()
.setActionIdentifiers(ActionIdentifiers.newBuilder().setActionName("policy-to-cds-req1").build()).build();
* ONAP
* ================================================================================
* 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.controlloop;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
-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.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class AbatedTest {
+class AbatedTest {
@Test
- public void testConstructors() {
+ void testConstructors() {
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.setClosedLoopEventStatus(ControlLoopEventStatus.ABATED);
event.setClosedLoopAlarmStart(Instant.now());
}
@Test
- public void testSetClosedLoopEventStatus() {
+ void testSetClosedLoopEventStatus() {
assertThatIllegalArgumentException()
.isThrownBy(() -> new Abated().setClosedLoopEventStatus(ControlLoopEventStatus.ONSET));
}
* ONAP
* ================================================================================
* 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.controlloop;
-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.time.Instant;
import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class CanonicalAbatedTest {
+class CanonicalAbatedTest {
@Test
- public void testConstructors() {
+ void testConstructors() {
CanonicalAbated abated1 = new CanonicalAbated(new VirtualControlLoopEvent());
abated1.setRequestId(UUID.randomUUID());
abated1.setClosedLoopAlarmStart(Instant.now());
* ONAP
* ================================================================================
* 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.controlloop;
-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.time.Instant;
import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class CanonicalOnsetTest {
+class CanonicalOnsetTest {
@Test
- public void testConstructors() {
+ void testConstructors() {
CanonicalOnset onset1 = new CanonicalOnset(new VirtualControlLoopEvent());
onset1.setRequestId(UUID.randomUUID());
onset1.setClosedLoopAlarmStart(Instant.now());
* controlloop
* ================================================================================
* Copyright (C) 2018-2019 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.
package org.onap.policy.controlloop;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ControlLoopEventStatusTest {
+class ControlLoopEventStatusTest {
@Test
- public void test() {
+ void test() {
ControlLoopEventStatus status = ControlLoopEventStatus.ABATED;
assertEquals(ControlLoopEventStatus.ABATED, ControlLoopEventStatus.toStatus(status.toString()));
assertNotEquals(ControlLoopEventStatus.ONSET, ControlLoopEventStatus.toStatus(status.toString()));
* controlloop
* ================================================================================
* Copyright (C) 2018-2019 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.
package org.onap.policy.controlloop;
-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.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ControlLoopEventTest {
+class ControlLoopEventTest {
private class TestControlLoopEvent extends ControlLoopEvent {
private static final long serialVersionUID = 1L;
}
@Test
- public void test() {
+ void test() {
ControlLoopEvent event = new TestControlLoopEvent();
assertEquals("1.0.2", event.getVersion());
* controlloop
* ================================================================================
* Copyright (C) 2018-2019 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.
package org.onap.policy.controlloop;
-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 java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.Collections;
import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.controlloop.util.Serialization;
-public class ControlLoopNotificationTest {
+class ControlLoopNotificationTest {
private class TestControlLoopNotification extends ControlLoopNotification {
private static final long serialVersionUID = 1L;
}
@Test
- public void test() {
+ void test() {
ControlLoopNotification notification = new TestControlLoopNotification();
assertEquals("1.0.2", notification.getVersion());
* controlloop
* ================================================================================
* Copyright (C) 2018-2019 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.
package org.onap.policy.controlloop;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class ControlLoopNotificationTypeTest {
+class ControlLoopNotificationTypeTest {
@Test
- public void test() {
+ void test() {
assertEquals(ControlLoopNotificationType.ACTIVE, ControlLoopNotificationType.toType("ACTIVE"));
assertEquals(ControlLoopNotificationType.REJECTED, ControlLoopNotificationType.toType("REJECTED"));
* controlloop
* ================================================================================
* Copyright (C) 2018-2020 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.
package org.onap.policy.controlloop;
-import static org.junit.Assert.assertEquals;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ControlLoopOperationTest {
+class ControlLoopOperationTest {
@Test
- public void test() {
+ void test() {
ControlLoopOperation operation = new ControlLoopOperation();
assertEquals(operation, (Object) operation);
* controlloop
* ================================================================================
* Copyright (C) 2018-2019 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.
package org.onap.policy.controlloop;
-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.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ControlLoopOperationWrapperTest {
+class ControlLoopOperationWrapperTest {
@Test
- public void test() {
+ void test() {
ControlLoopOperationWrapper wrapper = new ControlLoopOperationWrapper();
assertNotNull(wrapper);
* ================================================================================
* Copyright (C) 2019 Wipro Limited Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.controlloop;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class ControlLoopResponseTest {
+class ControlLoopResponseTest {
@Test
- public void test() {
+ void test() {
ControlLoopResponse rsp = new ControlLoopResponse();
assertEquals("1.0.0", rsp.getVersion());
* ONAP
* ================================================================================
* 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.controlloop;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
-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.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class OnsetTest {
+class OnsetTest {
@Test
- public void testConstructors() {
+ void testConstructors() {
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
event.setClosedLoopAlarmStart(Instant.now());
}
@Test
- public void testSetClosedLoopEventStatus() {
+ void testSetClosedLoopEventStatus() {
assertThatIllegalArgumentException()
.isThrownBy(() -> new Onset().setClosedLoopEventStatus(ControlLoopEventStatus.ABATED));
}
* controlloop
* ================================================================================
* Copyright (C) 2018-2019 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.
package org.onap.policy.controlloop;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PhysicalControlLoopEventTest {
+class PhysicalControlLoopEventTest {
@Test
- public void test() {
+ void test() {
PhysicalControlLoopEvent event = new PhysicalControlLoopEvent();
assertNotNull(event);
* controlloop
* ================================================================================
* Copyright (C) 2018-2019 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.
package org.onap.policy.controlloop;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PhysicalControlLoopNotificationTest {
+class PhysicalControlLoopNotificationTest {
@Test
- public void test() {
+ void test() {
PhysicalControlLoopNotification notification = new PhysicalControlLoopNotification();
assertNotNull(notification);
* controlloop
* ================================================================================
* Copyright (C) 2018-2019 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.
package org.onap.policy.controlloop;
-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.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class VirtualControlLoopEventTest {
+class VirtualControlLoopEventTest {
@Test
- public void test() {
+ void test() {
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
assertNotNull(event);
* controlloop
* ================================================================================
* Copyright (C) 2018-2019 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.
package org.onap.policy.controlloop;
-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.time.Instant;
import java.util.Collections;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class VirtualControlLoopNotificationTest {
+class VirtualControlLoopNotificationTest {
@Test
- public void test() {
+ void test() {
VirtualControlLoopNotification notification = new VirtualControlLoopNotification();
assertNotNull(notification);
/*-
* ============LICENSE_START=======================================================
* 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.guard;
-import static org.junit.Assert.assertEquals;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Date;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class OperationsHistoryTest {
+class OperationsHistoryTest {
@Test
- public void test() {
+ void test() {
OperationsHistory dao = new OperationsHistory();
dao.setActor("my-actor");
* rest
* ================================================================================
* Copyright (C) 2018 Amdocs. 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.
package org.onap.policy.rest;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class HttpDeleteWithBodyTest {
+class HttpDeleteWithBodyTest {
private static final String NO_URI = "BlahBlah";
@Test
- public void testGetMethod() {
+ void testGetMethod() {
HttpDeleteWithBody deleteWithBody = new HttpDeleteWithBody(NO_URI);
assertEquals("DELETE", deleteWithBody.getMethod());
- assertEquals(NO_URI, deleteWithBody.getURI().toString());
+ assertEquals(deleteWithBody.getURI().toString(), NO_URI);
}
}
\ No newline at end of file
* rest
* ================================================================================
* Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.rest;
-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.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.DELETE;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.apache.commons.lang3.tuple.Pair;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
import org.onap.policy.common.utils.network.NetworkUtil;
/**
* Sets server endpoint for the tests.
*/
- @BeforeClass
+ @BeforeAll
public static void setUp() throws Exception {
port = NetworkUtil.allocPort();
*
* @throws Exception if there is a problem
*/
- @AfterClass
+ @AfterAll
public static void tearDown() throws Exception {
HttpServletServerFactoryInstance.getServerFactory().destroy();
}
- @Test(expected = NullPointerException.class)
+ @Test
public void testGetUrlNull() {
RestManager mgr = new RestManager();
- mgr.get(null, "user", null, null);
+ assertThrows(NullPointerException.class, () -> {
+ mgr.get(null, "user", null, null);
+ });
}
- @Test(expected = NullPointerException.class)
+ @Test
public void testPutUrlNull() {
RestManager mgr = new RestManager();
- mgr.put(null, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
+ assertThrows(NullPointerException.class, () -> {
+ mgr.put(null, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
+ });
}
- @Test(expected = NullPointerException.class)
+ @Test
public void testPostUrlNull() {
RestManager mgr = new RestManager();
- mgr.post(null, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
+ assertThrows(NullPointerException.class, () -> {
+ mgr.post(null, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
+ });
}
- @Test(expected = NullPointerException.class)
+ @Test
public void testDeleteUrlNull() {
RestManager mgr = new RestManager();
- mgr.delete(null, "user", null, null, null, null);
+ assertThrows(NullPointerException.class, () -> {
+ mgr.delete(null, "user", null, null, null, null);
+ });
}
- @Test(expected = NullPointerException.class)
+ @Test
public void testPatchUrlNull() {
RestManager mgr = new RestManager();
- mgr.patch(null, "user", null, null, PAYLOAD);
+ assertThrows(NullPointerException.class, () -> {
+ mgr.patch(null, "user", null, null, PAYLOAD);
+ });
}
@Test
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Huawei. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications 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.sdnc;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.sdnc.util.Serialization;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class DemoTest {
+class DemoTest {
private static final Logger logger = LoggerFactory.getLogger(DemoTest.class);
@Test
- public void test() {
+ void test() {
SdncRequest request = new SdncRequest();
request.setNsInstanceId("100");
* vfc
* ================================================================================
* Copyright (C) 2018 Huawei. 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.
package org.onap.policy.sdnc;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SdncHealAdditionalParamsTest {
+class SdncHealAdditionalParamsTest {
@Test
- public void testSdncHealAdditionalParameters() {
+ void testSdncHealAdditionalParameters() {
SdncHealRequestHeaderInfo additionalParams = new SdncHealRequestHeaderInfo();
assertNotNull(additionalParams);
assertNotEquals(0, additionalParams.hashCode());
* vfc
* ================================================================================
* Copyright (C) 2018 Huawei. 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.
package org.onap.policy.sdnc;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SdncHealRequestTest {
+class SdncHealRequestTest {
@Test
- public void testSdncHealRequest() {
+ void testSdncHealRequest() {
SdncHealRequest request = new SdncHealRequest();
assertNotNull(request);
assertNotEquals(0, request.hashCode());
* sdnc
* ================================================================================
* Copyright (C) 2018 Huawei. 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.
package org.onap.policy.sdnc;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SdncHealServiceInfoTest {
+class SdncHealServiceInfoTest {
@Test
- public void testSdncHealServiceInfo() {
+ void testSdncHealServiceInfo() {
SdncHealServiceInfo serviceInfo = new SdncHealServiceInfo();
assertNotNull(serviceInfo);
assertNotEquals(0, serviceInfo.hashCode());
* sdnc
* ================================================================================
* Copyright (C) 2018 Huawei. 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.
package org.onap.policy.sdnc;
-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.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SdncRequestTest {
+class SdncRequestTest {
@Test
- public void testSdncRequest() {
+ void testSdncRequest() {
SdncRequest request = new SdncRequest();
assertNotNull(request);
assertNotEquals(0, request.hashCode());
* sdnc
* ================================================================================
* Copyright (C) 2018 Huawei. 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.
package org.onap.policy.sdnc;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SdncResponseDescriptorTest {
+class SdncResponseDescriptorTest {
@Test
- public void testSdncResponseDescriptor() {
+ void testSdncResponseDescriptor() {
SdncResponseOutput output = new SdncResponseOutput();
assertNotNull(output);
assertNotEquals(0, output.hashCode());
* sdnc
* ================================================================================
* Copyright (C) 2018 Huawei. 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.
package org.onap.policy.sdnc;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SdncResponseTest {
+class SdncResponseTest {
@Test
- public void testSdncResponse() {
+ void testSdncResponse() {
SdncResponse response = new SdncResponse();
assertNotNull(response);
assertNotEquals(0, response.hashCode());
* vfc
* ================================================================================
* Copyright (C) 2018 Huawei. 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.
package org.onap.policy.sdnc.util;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SerializationTest {
+class SerializationTest {
@Test
- public void test() {
+ void test() {
assertNotNull(Serialization.gsonPretty);
}
}
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.sdnr;
-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.time.Instant;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.function.BiConsumer;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciCommonHeaderTest {
+class PciCommonHeaderTest {
private static final String KANSAS = "Kansas";
private static final String CAN_I_GO_HOME = "Can I go home?";
@Test
- public void testPciCommonHeader() {
+ void testPciCommonHeader() {
PciCommonHeader commonHeader = new PciCommonHeader();
assertNotNull(commonHeader);
assertNotNull(new PciCommonHeader(commonHeader));
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.sdnr;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciRequestTest {
+class PciRequestTest {
private static final String MODIFY = "Modify";
@Test
- public void testPciRequest() {
+ void testPciRequest() {
PciRequest request = new PciRequest();
assertNotNull(request);
assertNotEquals(0, request.hashCode());
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.sdnr;
import static org.assertj.core.api.Assertions.assertThat;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciRequestWrapperTest {
+class PciRequestWrapperTest {
@Test
- public void testPciRequestWrapperWrapper() {
+ void testPciRequestWrapperWrapper() {
assertNotNull(new PciRequestWrapper(new PciRequest()));
PciRequestWrapper requestWrapper = new PciRequestWrapper();
assertNotNull(requestWrapper);
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited 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.
package org.onap.policy.sdnr;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class PciResponseCodeTest {
+class PciResponseCodeTest {
@Test
- public void testPciResponseCode() {
+ void testPciResponseCode() {
assertNull(PciResponseCode.toResponseValue(0));
assertEquals(PciResponseCode.ACCEPTED, PciResponseCode.toResponseValue(100));
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications 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.sdnr;
-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.assertNull;
+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.assertNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciResponseTest {
+class PciResponseTest {
Status status = new Status(0, "");
@Test
- public void testHashCode() {
+ void testHashCode() {
PciResponse response = new PciResponse();
assertNotEquals(0, response.hashCode());
response.setCommonHeader(new PciCommonHeader());
}
@Test
- public void testPciResponse() {
+ void testPciResponse() {
PciResponse response = new PciResponse();
assertNull(response.getCommonHeader());
assertNull(response.getPayload());
}
@Test
- public void testToString() {
+ void testToString() {
PciResponse response = new PciResponse();
assertFalse(response.toString().isEmpty());
}
@Test
- public void testEqualsObject() {
+ void testEqualsObject() {
PciResponse response = new PciResponse();
assertEquals(response, response);
assertNotEquals(response, null);
}
@Test
- public void testResponseRequest() {
+ void testResponseRequest() {
PciRequest request = new PciRequest();
request.setCommonHeader(new PciCommonHeader());
request.setPayload(requestPayload);
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.sdnr;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciResponseWrapperTest {
+class PciResponseWrapperTest {
@Test
- public void testPciResponseWrapperWrapper() {
+ void testPciResponseWrapperWrapper() {
PciResponseWrapper responseWrapper = new PciResponseWrapper();
assertNotNull(responseWrapper);
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.sdnr;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciStatusTest {
+class PciStatusTest {
private static final String THE_WONDERFUL_LAND_OF_OZ = "The wonderful land of Oz";
@Test
- public void testResponseStatus() {
+ void testResponseStatus() {
Status status = new Status();
assertNotNull(status);
assertNotEquals(0, status.hashCode());
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.sdnr;
-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.function.BiConsumer;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciWrapperTest {
+class PciWrapperTest {
private static final String YELLOW_BRICK_ROAD = "YellowBrickRoad";
private static final String TORNADO = "Tornado";
private static final String VERSION_19 = "19.3.9";
@Test
- public void testPciWrapper() {
+ void testPciWrapper() {
PciWrapper wrapper = new PciWrapper();
assertNotNull(wrapper);
assertNotEquals(0, wrapper.hashCode());
package org.onap.policy.sdnr;
-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.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.sdnr.util.Serialization;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class SdnrTest {
+class SdnrTest {
private static final String CORRELATION_ID = "664be3d2-6c12-4f4b-a3e7-c349acced200";
}
@Test
- public void testRequestSerialization() {
+ void testRequestSerialization() {
/*
* Use the gson serializer to obtain json
}
@Test
- public void testRequestDeserialization() {
+ void testRequestDeserialization() {
/*
* Convert the PCI request object into json so we have a string of json to use for testing
}
@Test
- public void testResponseSerialization() {
+ void testResponseSerialization() {
/*
* Use the serializer to convert the object into json
}
@Test
- public void testResponseDeserialization() {
+ void testResponseDeserialization() {
/*
* Convert the PCI response object into json so we have a string of json to use for testing
*/
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited 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.
package org.onap.policy.sdnr.util;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SerializationTest {
+class SerializationTest {
@Test
- public void test() {
+ void test() {
String nameString = "Dorothy";
String jsonName = Serialization.gsonPretty.toJson(nameString, String.class);
assertEquals("\"Dorothy\"", jsonName);
* ONAP
* ================================================================================
* Copyright (C) 2017-2020 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.
package org.onap.policy.so;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.HashMap;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.so.util.Serialization;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class DemoTest {
+class DemoTest {
private static final Logger logger = LoggerFactory.getLogger(DemoTest.class);
@Test
- public void test() {
+ void test() {
SoRequest request = new SoRequest();
request.setRequestDetails(new SoRequestDetails());
}
@Test
- public void testHack() {
+ void testHack() {
logger.debug("** HACK **");
* ================================================================================
*
* Modifications Copyright (C) 2019-2020 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.
package org.onap.policy.so;
-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.time.LocalDateTime;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SoAsyncRequestStatusTest {
+class SoAsyncRequestStatusTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoAsyncRequestStatus obj = new SoAsyncRequestStatus();
assertNull(obj.getCorrelator());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoAsyncRequestStatus obj = new SoAsyncRequestStatus();
obj.setCorrelator("correlator");
* ================================================================================
*
* Modifications Copyright (C) 2019-2020 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.
package org.onap.policy.so;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class SoCloudConfigurationTest {
+class SoCloudConfigurationTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoCloudConfiguration obj = new SoCloudConfiguration();
assertNull(obj.getLcpCloudRegionId());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoCloudConfiguration obj = new SoCloudConfiguration();
obj.setLcpCloudRegionId("lcpCloudRegionId");
import java.util.concurrent.ConcurrentHashMap;
@Path("/SO")
-public class SoDummyServer {
+class SoDummyServer {
private static final String ONGOING = "ONGOING";
private static int postMessagesReceived = 0;
* so
* ================================================================================
* Copyright (C) 2017-2020 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.
package org.onap.policy.so;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class SoInstanceReferencesTest {
+class SoInstanceReferencesTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoInstanceReferences obj = new SoInstanceReferences();
assertNull(obj.getInstanceId());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoInstanceReferences obj = new SoInstanceReferences();
obj.setInstanceId("instanceId");
* ================================================================================
*
* Modifications Copyright (C) 2019-2020 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.
package org.onap.policy.so;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class SoModelInfoTest {
+class SoModelInfoTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoModelInfo obj = new SoModelInfo();
assertNull(obj.getModelCustomizationId());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoModelInfo obj = new SoModelInfo();
obj.setModelCustomizationId("modelCustomizationId");
* so
* ================================================================================
* Copyright (C) 2017-2020 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.
package org.onap.policy.so;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class SoPolicyExceptionHolderTest {
+class SoPolicyExceptionHolderTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoPolicyExceptionHolder obj = new SoPolicyExceptionHolder();
assertNull(obj.getMessageId());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoPolicyExceptionHolder obj = new SoPolicyExceptionHolder();
obj.setMessageId("messageId");
* ================================================================================
*
* Modifications Copyright (C) 2019-2020 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.
package org.onap.policy.so;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class SoRelatedInstanceListElementTest {
+class SoRelatedInstanceListElementTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoRelatedInstanceListElement obj = new SoRelatedInstanceListElement();
assertNull(obj.getRelatedInstance());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoRelatedInstanceListElement obj = new SoRelatedInstanceListElement();
SoRelatedInstance relatedInstance = new SoRelatedInstance();
* so
* ================================================================================
* Copyright (C) 2017-2020 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.
package org.onap.policy.so;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class SoRelatedInstanceTest {
+class SoRelatedInstanceTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoRelatedInstance obj = new SoRelatedInstance();
assertNull(obj.getInstanceId());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoRelatedInstance obj = new SoRelatedInstance();
obj.setInstanceId("instanceId");
* ONAP
* ================================================================================
* Copyright (C) 2020 Wipro Limited.
+ * 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 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;
-public class SoRequest3gppTest {
+class SoRequest3gppTest {
@Test
- public void testSetGet() {
+ void testSetGet() {
PojoClass pojoClass = PojoClassFactory.getPojoClass(SoRequest3gpp.class);
Validator validator = ValidatorBuilder
.create()
* ONAP
* ================================================================================
* Copyright (C) 2022 CTC 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 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;
-public class SoRequestCllTest {
+class SoRequestCllTest {
@Test
- public void testSetGet() {
+ void testSetGet() {
PojoClass pojoClass = PojoClassFactory.getPojoClass(SoRequestCll.class);
Validator validator = ValidatorBuilder
.create()
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* Modifications 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.
package org.onap.policy.so;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-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.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BiConsumer;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SoRequestDetailsTest {
+class SoRequestDetailsTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoRequestDetails obj = new SoRequestDetails();
assertNull(obj.getCloudConfiguration());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoRequestDetails obj = new SoRequestDetails();
SoCloudConfiguration cloudConfiguration = new SoCloudConfiguration();
}
@Test
- public void testSoMRequestDetailsMethods() {
+ void testSoMRequestDetailsMethods() {
SoRequestDetails details = new SoRequestDetails();
assertNotNull(details);
assertNotEquals(0, details.hashCode());
* ================================================================================
* Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 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.
package org.onap.policy.so;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class SoRequestErrorTest {
+class SoRequestErrorTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoRequestError obj = new SoRequestError();
assertNull(obj.getPolicyException());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoRequestError obj = new SoRequestError();
SoPolicyExceptionHolder policyException = new SoPolicyExceptionHolder();
* so
* ================================================================================
* Copyright (C) 2017-2019 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.
package org.onap.policy.so;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SoRequestInfoTest {
+class SoRequestInfoTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoRequestInfo obj = new SoRequestInfo();
assertNull(obj.getBillingAccountNumber());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoRequestInfo obj = new SoRequestInfo();
obj.setBillingAccountNumber("billingAccountNumber");
* so
* ================================================================================
* Copyright (C) 2017-2020 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.
package org.onap.policy.so;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SoRequestParametersTest {
+class SoRequestParametersTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoRequestParameters obj = new SoRequestParameters();
assertNull(obj.getSubscriptionServiceType());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoRequestParameters obj = new SoRequestParameters();
obj.setSubscriptionServiceType("subscriptionServiceType");
* so
* ================================================================================
* Copyright (C) 2017-2020 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.
package org.onap.policy.so;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class SoRequestReferencesTest {
+class SoRequestReferencesTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoRequestReferences obj = new SoRequestReferences();
assertNull(obj.getInstanceId());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoRequestReferences obj = new SoRequestReferences();
obj.setInstanceId("instanceId");
* so
* ================================================================================
* Copyright (C) 2017-2020 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.
package org.onap.policy.so;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-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.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SoRequestStatusTest {
+class SoRequestStatusTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoRequestStatus obj = new SoRequestStatus();
assertEquals(0, obj.getPercentProgress());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoRequestStatus obj = new SoRequestStatus();
obj.setPercentProgress(2008);
* so
* ================================================================================
* Copyright (C) 2017-2020 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.
package org.onap.policy.so;
-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.time.LocalDateTime;
import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SoRequestTest {
+class SoRequestTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoRequest obj = new SoRequest();
assertNull(obj.getFinishTime());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoRequest obj = new SoRequest();
LocalDateTime finishTime = LocalDateTime.now();
* so
* ================================================================================
* Copyright (C) 2017-2020 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.
package org.onap.policy.so;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class SoResponseTest {
+class SoResponseTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoResponse obj = new SoResponse();
assertEquals(0, obj.getHttpResponseCode());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoResponse obj = new SoResponse();
obj.setHttpResponseCode(2008);
* so
* ================================================================================
* Copyright (C) 2018-2020 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.
package org.onap.policy.so;
-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.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SoResponseWrapperTest {
+class SoResponseWrapperTest {
private static final String REQ_ID = "reqID";
@Test
- public void testConstructor() {
+ void testConstructor() {
SoResponse response = new SoResponse();
SoResponseWrapper obj = new SoResponseWrapper(response, REQ_ID);
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoResponse response = new SoResponse();
SoResponseWrapper obj = new SoResponseWrapper(response, REQ_ID);
}
@Test
- public void testSoResponseWrapperMethods() {
+ void testSoResponseWrapperMethods() {
String requestId = UUID.randomUUID().toString();
SoResponse response = new SoResponse();
* so
* ================================================================================
* Copyright (C) 2017-2020 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.
package org.onap.policy.so;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SoServiceExceptionHolderTest {
+class SoServiceExceptionHolderTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoServiceExceptionHolder obj = new SoServiceExceptionHolder();
assertNull(obj.getMessageId());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoServiceExceptionHolder obj = new SoServiceExceptionHolder();
obj.setMessageId("messageId");
* so
* ================================================================================
* Copyright (C) 2017-2020 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.
package org.onap.policy.so;
-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.Test;
+import org.junit.jupiter.api.Test;
-public class SoSubscriberInfoTest {
+class SoSubscriberInfoTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
SoSubscriberInfo obj = new SoSubscriberInfo();
assertNull(obj.getGlobalSubscriberId());
}
@Test
- public void testSetGet() {
+ void testSetGet() {
SoSubscriberInfo obj = new SoSubscriberInfo();
obj.setGlobalSubscriberId("globalSubscriberId");
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2017-2019 Intel Corp. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2018-2020 AT&T Corporation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.vfc;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.LinkedList;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.vfc.util.Serialization;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class DemoTest {
+class DemoTest {
private static final Logger logger = LoggerFactory.getLogger(DemoTest.class);
@Test
- public void test() {
+ void test() {
VfcRequest request = new VfcRequest();
request.setNsInstanceId("100");
* vfc
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.vfc;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class VfcHealActionVmInfoTest {
+class VfcHealActionVmInfoTest {
@Test
- public void testVfcHealActionVmInfo() {
+ void testVfcHealActionVmInfo() {
VfcHealActionVmInfo actionInfo = new VfcHealActionVmInfo();
assertNotNull(actionInfo);
assertNotEquals(0, actionInfo.hashCode());
* vfc
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.vfc;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class VfcHealAdditionalParamsTest {
+class VfcHealAdditionalParamsTest {
@Test
- public void testVfcHealAdditionalParameters() {
+ void testVfcHealAdditionalParameters() {
VfcHealAdditionalParams additionalParams = new VfcHealAdditionalParams();
assertNotNull(additionalParams);
assertNotEquals(0, additionalParams.hashCode());
* vfc
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.vfc;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class VfcHealRequestTest {
+class VfcHealRequestTest {
@Test
- public void testVfcHealRequest() {
+ void testVfcHealRequest() {
VfcHealRequest request = new VfcHealRequest();
assertNotNull(request);
assertNotEquals(0, request.hashCode());
* vfc
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.vfc;
-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.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class VfcRequestTest {
+class VfcRequestTest {
@Test
- public void testVfcRequest() {
+ void testVfcRequest() {
VfcRequest request = new VfcRequest();
assertNotNull(request);
assertNotEquals(0, request.hashCode());
* vfc
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.vfc;
-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;
-public class VfcResponseDescriptorTest {
+class VfcResponseDescriptorTest {
@Test
- public void testVfcResponseDescriptor() {
+ void testVfcResponseDescriptor() {
VfcResponseDescriptor descriptor = new VfcResponseDescriptor();
assertNotNull(descriptor);
assertNotEquals(0, descriptor.hashCode());
* vfc
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.vfc;
-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 org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class VfcResponseTest {
+class VfcResponseTest {
@Test
- public void testVfcResponse() {
+ void testVfcResponse() {
VfcResponse response = new VfcResponse();
assertNotNull(response);
assertNotEquals(0, response.hashCode());
* vfc
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2018 AT&T Corporation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.vfc.util;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SerializationTest {
+class SerializationTest {
@Test
- public void test() {
+ void test() {
assertNotNull(Serialization.gsonPretty);
}
}