diff options
Diffstat (limited to 'controlloop/common/model-impl/so/src/test')
18 files changed, 1184 insertions, 1184 deletions
diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoAsyncRequestStatus.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoAsyncRequestStatus.java index 119c29121..7c50ea097 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoAsyncRequestStatus.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoAsyncRequestStatus.java @@ -1,78 +1,78 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.time.LocalDateTime;
-
-import org.junit.Test;
-
-public class TestSoAsyncRequestStatus {
-
- @Test
- public void testConstructor() {
- SOAsyncRequestStatus obj = new SOAsyncRequestStatus();
-
- assertTrue(obj.getCorrelator() == null);
- assertTrue(obj.getFinishTime() == null);
- assertTrue(obj.getInstanceReferences() == null);
- assertTrue(obj.getRequestId() == null);
- assertTrue(obj.getRequestScope() == null);
- assertTrue(obj.getRequestStatus() == null);
- assertTrue(obj.getStartTime() == null);
- }
-
- @Test
- public void testSetGet() {
- SOAsyncRequestStatus obj = new SOAsyncRequestStatus();
-
- obj.setCorrelator("correlator");
- assertEquals("correlator", obj.getCorrelator());
-
- LocalDateTime finishTime = LocalDateTime.now();
- obj.setFinishTime(finishTime);
- assertEquals(finishTime, obj.getFinishTime());
-
- SOInstanceReferences instanceReferences = new SOInstanceReferences();
- obj.setInstanceReferences(instanceReferences);
- assertEquals(instanceReferences, obj.getInstanceReferences());
-
- obj.setRequestId("requestId");
- assertEquals("requestId", obj.getRequestId());
-
- obj.setRequestScope("requestScope");
- assertEquals("requestScope", obj.getRequestScope());
-
- SORequestStatus requestStatus = new SORequestStatus();
- obj.setRequestStatus(requestStatus);
- assertEquals(requestStatus, obj.getRequestStatus());
-
- obj.setRequestType("requestType");
- assertEquals("requestType", obj.getRequestType());
-
- LocalDateTime startTime = LocalDateTime.now();
- obj.setStartTime(startTime);
- assertEquals(startTime, obj.getStartTime());
-
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.time.LocalDateTime; + +import org.junit.Test; + +public class TestSoAsyncRequestStatus { + + @Test + public void testConstructor() { + SOAsyncRequestStatus obj = new SOAsyncRequestStatus(); + + assertTrue(obj.getCorrelator() == null); + assertTrue(obj.getFinishTime() == null); + assertTrue(obj.getInstanceReferences() == null); + assertTrue(obj.getRequestId() == null); + assertTrue(obj.getRequestScope() == null); + assertTrue(obj.getRequestStatus() == null); + assertTrue(obj.getStartTime() == null); + } + + @Test + public void testSetGet() { + SOAsyncRequestStatus obj = new SOAsyncRequestStatus(); + + obj.setCorrelator("correlator"); + assertEquals("correlator", obj.getCorrelator()); + + LocalDateTime finishTime = LocalDateTime.now(); + obj.setFinishTime(finishTime); + assertEquals(finishTime, obj.getFinishTime()); + + SOInstanceReferences instanceReferences = new SOInstanceReferences(); + obj.setInstanceReferences(instanceReferences); + assertEquals(instanceReferences, obj.getInstanceReferences()); + + obj.setRequestId("requestId"); + assertEquals("requestId", obj.getRequestId()); + + obj.setRequestScope("requestScope"); + assertEquals("requestScope", obj.getRequestScope()); + + SORequestStatus requestStatus = new SORequestStatus(); + obj.setRequestStatus(requestStatus); + assertEquals(requestStatus, obj.getRequestStatus()); + + obj.setRequestType("requestType"); + assertEquals("requestType", obj.getRequestType()); + + LocalDateTime startTime = LocalDateTime.now(); + obj.setStartTime(startTime); + assertEquals(startTime, obj.getStartTime()); + + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoCloudConfiguration.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoCloudConfiguration.java index f05912985..bab8970bb 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoCloudConfiguration.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoCloudConfiguration.java @@ -1,48 +1,48 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoCloudConfiguration {
-
- @Test
- public void testConstructor() {
- SOCloudConfiguration obj = new SOCloudConfiguration();
-
- assertTrue(obj.getLcpCloudRegionId() == null);
- assertTrue(obj.getTenantId() == null);
- }
-
- @Test
- public void testSetGet() {
- SOCloudConfiguration obj = new SOCloudConfiguration();
-
- obj.setLcpCloudRegionId("lcpCloudRegionId");
- assertEquals("lcpCloudRegionId", obj.getLcpCloudRegionId());
-
- obj.setTenantId("tenantId");
- assertEquals("tenantId", obj.getTenantId());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoCloudConfiguration { + + @Test + public void testConstructor() { + SOCloudConfiguration obj = new SOCloudConfiguration(); + + assertTrue(obj.getLcpCloudRegionId() == null); + assertTrue(obj.getTenantId() == null); + } + + @Test + public void testSetGet() { + SOCloudConfiguration obj = new SOCloudConfiguration(); + + obj.setLcpCloudRegionId("lcpCloudRegionId"); + assertEquals("lcpCloudRegionId", obj.getLcpCloudRegionId()); + + obj.setTenantId("tenantId"); + assertEquals("tenantId", obj.getTenantId()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoInstanceReferences.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoInstanceReferences.java index 8c63e9c65..ee083ae08 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoInstanceReferences.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoInstanceReferences.java @@ -1,48 +1,48 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoInstanceReferences {
-
- @Test
- public void testConstructor() {
- SOInstanceReferences obj = new SOInstanceReferences();
-
- assertTrue(obj.getInstanceId() == null);
- assertTrue(obj.getRequestId() == null);
- }
-
- @Test
- public void testSetGet() {
- SOInstanceReferences obj = new SOInstanceReferences();
-
- obj.setInstanceId("instanceId");
- assertEquals("instanceId", obj.getInstanceId());
-
- obj.setRequestId("requestId");
- assertEquals("requestId", obj.getRequestId());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoInstanceReferences { + + @Test + public void testConstructor() { + SOInstanceReferences obj = new SOInstanceReferences(); + + assertTrue(obj.getInstanceId() == null); + assertTrue(obj.getRequestId() == null); + } + + @Test + public void testSetGet() { + SOInstanceReferences obj = new SOInstanceReferences(); + + obj.setInstanceId("instanceId"); + assertEquals("instanceId", obj.getInstanceId()); + + obj.setRequestId("requestId"); + assertEquals("requestId", obj.getRequestId()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoModelInfo.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoModelInfo.java index 99f829fc7..037e82e4c 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoModelInfo.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoModelInfo.java @@ -1,69 +1,69 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoModelInfo {
-
- @Test
- public void testConstructor() {
- SOModelInfo obj = new SOModelInfo();
-
- assertTrue(obj.getModelCustomizationId() == null);
- assertTrue(obj.getModelCustomizationName() == null);
- assertTrue(obj.getModelInvariantId() == null);
- assertTrue(obj.getModelName() == null);
- assertTrue(obj.getModelType() == null);
- assertTrue(obj.getModelVersion() == null);
- assertTrue(obj.getModelVersionId() == null);
- }
-
- @Test
- public void testSetGet() {
- SOModelInfo obj = new SOModelInfo();
-
- obj.setModelCustomizationId("modelCustomizationId");
- assertEquals("modelCustomizationId", obj.getModelCustomizationId());
-
- obj.setModelCustomizationName("modelCustomizationName");
- assertEquals("modelCustomizationName", obj.getModelCustomizationName());
-
- obj.setModelInvariantId("modelInvariantId");
- assertEquals("modelInvariantId", obj.getModelInvariantId());
-
- obj.setModelName("modelName");
- assertEquals("modelName", obj.getModelName());
-
- obj.setModelType("modelType");
- assertEquals("modelType", obj.getModelType());
-
- obj.setModelVersion("modelVersion");
- assertEquals("modelVersion", obj.getModelVersion());
-
- obj.setModelVersionId("modelVersionId");
- assertEquals("modelVersionId", obj.getModelVersionId());
-
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoModelInfo { + + @Test + public void testConstructor() { + SOModelInfo obj = new SOModelInfo(); + + assertTrue(obj.getModelCustomizationId() == null); + assertTrue(obj.getModelCustomizationName() == null); + assertTrue(obj.getModelInvariantId() == null); + assertTrue(obj.getModelName() == null); + assertTrue(obj.getModelType() == null); + assertTrue(obj.getModelVersion() == null); + assertTrue(obj.getModelVersionId() == null); + } + + @Test + public void testSetGet() { + SOModelInfo obj = new SOModelInfo(); + + obj.setModelCustomizationId("modelCustomizationId"); + assertEquals("modelCustomizationId", obj.getModelCustomizationId()); + + obj.setModelCustomizationName("modelCustomizationName"); + assertEquals("modelCustomizationName", obj.getModelCustomizationName()); + + obj.setModelInvariantId("modelInvariantId"); + assertEquals("modelInvariantId", obj.getModelInvariantId()); + + obj.setModelName("modelName"); + assertEquals("modelName", obj.getModelName()); + + obj.setModelType("modelType"); + assertEquals("modelType", obj.getModelType()); + + obj.setModelVersion("modelVersion"); + assertEquals("modelVersion", obj.getModelVersion()); + + obj.setModelVersionId("modelVersionId"); + assertEquals("modelVersionId", obj.getModelVersionId()); + + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoPolicyExceptionHolder.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoPolicyExceptionHolder.java index 978ec8a59..1c619a8c6 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoPolicyExceptionHolder.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoPolicyExceptionHolder.java @@ -1,48 +1,48 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoPolicyExceptionHolder {
-
- @Test
- public void testConstructor() {
- SOPolicyExceptionHolder obj = new SOPolicyExceptionHolder();
-
- assertTrue(obj.getMessageId() == null);
- assertTrue(obj.getText() == null);
- }
-
- @Test
- public void testSetGet() {
- SOPolicyExceptionHolder obj = new SOPolicyExceptionHolder();
-
- obj.setMessageId("messageId");
- assertEquals("messageId", obj.getMessageId());
-
- obj.setText("text");
- assertEquals("text", obj.getText());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoPolicyExceptionHolder { + + @Test + public void testConstructor() { + SOPolicyExceptionHolder obj = new SOPolicyExceptionHolder(); + + assertTrue(obj.getMessageId() == null); + assertTrue(obj.getText() == null); + } + + @Test + public void testSetGet() { + SOPolicyExceptionHolder obj = new SOPolicyExceptionHolder(); + + obj.setMessageId("messageId"); + assertEquals("messageId", obj.getMessageId()); + + obj.setText("text"); + assertEquals("text", obj.getText()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRelatedInstance.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRelatedInstance.java index a8e94b8e2..048288377 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRelatedInstance.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRelatedInstance.java @@ -1,53 +1,53 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoRelatedInstance {
-
- @Test
- public void testConstructor() {
- SORelatedInstance obj = new SORelatedInstance();
-
- assertTrue(obj.getInstanceId() == null);
- assertTrue(obj.getInstanceName() == null);
- assertTrue(obj.getModelInfo() == null);
- }
-
- @Test
- public void testSetGet() {
- SORelatedInstance obj = new SORelatedInstance();
-
- obj.setInstanceId("instanceId");
- assertEquals("instanceId", obj.getInstanceId());
-
- obj.setInstanceName("instanceName");
- assertEquals("instanceName", obj.getInstanceName());
-
- SOModelInfo modelInfo = new SOModelInfo();
- obj.setModelInfo(modelInfo);
- assertEquals(modelInfo, obj.getModelInfo());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoRelatedInstance { + + @Test + public void testConstructor() { + SORelatedInstance obj = new SORelatedInstance(); + + assertTrue(obj.getInstanceId() == null); + assertTrue(obj.getInstanceName() == null); + assertTrue(obj.getModelInfo() == null); + } + + @Test + public void testSetGet() { + SORelatedInstance obj = new SORelatedInstance(); + + obj.setInstanceId("instanceId"); + assertEquals("instanceId", obj.getInstanceId()); + + obj.setInstanceName("instanceName"); + assertEquals("instanceName", obj.getInstanceName()); + + SOModelInfo modelInfo = new SOModelInfo(); + obj.setModelInfo(modelInfo); + assertEquals(modelInfo, obj.getModelInfo()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRelatedInstanceListElement.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRelatedInstanceListElement.java index 17abd06e3..83f1d5849 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRelatedInstanceListElement.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRelatedInstanceListElement.java @@ -1,45 +1,45 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoRelatedInstanceListElement {
-
- @Test
- public void testConstructor() {
- SORelatedInstanceListElement obj = new SORelatedInstanceListElement();
-
- assertTrue(obj.getRelatedInstance() == null);
- }
-
- @Test
- public void testSetGet() {
- SORelatedInstanceListElement obj = new SORelatedInstanceListElement();
-
- SORelatedInstance relatedInstance = new SORelatedInstance();
- obj.setRelatedInstance(relatedInstance);
- assertEquals(relatedInstance, obj.getRelatedInstance());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoRelatedInstanceListElement { + + @Test + public void testConstructor() { + SORelatedInstanceListElement obj = new SORelatedInstanceListElement(); + + assertTrue(obj.getRelatedInstance() == null); + } + + @Test + public void testSetGet() { + SORelatedInstanceListElement obj = new SORelatedInstanceListElement(); + + SORelatedInstance relatedInstance = new SORelatedInstance(); + obj.setRelatedInstance(relatedInstance); + assertEquals(relatedInstance, obj.getRelatedInstance()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequest.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequest.java index 229765a72..f58254184 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequest.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequest.java @@ -1,72 +1,72 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.time.LocalDateTime;
-import java.util.UUID;
-
-import org.junit.Test;
-
-public class TestSoRequest {
-
- @Test
- public void testConstructor() {
- SORequest obj = new SORequest();
-
- assertTrue(obj.getFinishTime() == null);
- assertTrue(obj.getRequestDetails() == null);
- assertTrue(obj.getRequestId() == null);
- assertTrue(obj.getRequestScope() == null);
- assertTrue(obj.getRequestStatus() == null);
- assertTrue(obj.getRequestType() == null);
- assertTrue(obj.getStartTime() == null);
- }
-
- @Test
- public void testSetGet() {
- SORequest obj = new SORequest();
-
- LocalDateTime finishTime = LocalDateTime.now();
- obj.setFinishTime(finishTime);
- assertEquals(finishTime, obj.getFinishTime());
-
- UUID uuid = UUID.randomUUID();
- obj.setRequestId(uuid);
- assertEquals(uuid, obj.getRequestId());
-
- obj.setRequestScope("requestScope");
- assertEquals("requestScope", obj.getRequestScope());
-
- SORequestStatus requestStatus = new SORequestStatus();
- obj.setRequestStatus(requestStatus);
- assertEquals(requestStatus, obj.getRequestStatus());
-
- obj.setRequestType("requestType");
- assertEquals("requestType", obj.getRequestType());
-
- LocalDateTime startTime = LocalDateTime.now();
- obj.setStartTime(startTime.toString());
- assertEquals(startTime.toString(), obj.getStartTime());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.junit.Test; + +public class TestSoRequest { + + @Test + public void testConstructor() { + SORequest obj = new SORequest(); + + assertTrue(obj.getFinishTime() == null); + assertTrue(obj.getRequestDetails() == null); + assertTrue(obj.getRequestId() == null); + assertTrue(obj.getRequestScope() == null); + assertTrue(obj.getRequestStatus() == null); + assertTrue(obj.getRequestType() == null); + assertTrue(obj.getStartTime() == null); + } + + @Test + public void testSetGet() { + SORequest obj = new SORequest(); + + LocalDateTime finishTime = LocalDateTime.now(); + obj.setFinishTime(finishTime); + assertEquals(finishTime, obj.getFinishTime()); + + UUID uuid = UUID.randomUUID(); + obj.setRequestId(uuid); + assertEquals(uuid, obj.getRequestId()); + + obj.setRequestScope("requestScope"); + assertEquals("requestScope", obj.getRequestScope()); + + SORequestStatus requestStatus = new SORequestStatus(); + obj.setRequestStatus(requestStatus); + assertEquals(requestStatus, obj.getRequestStatus()); + + obj.setRequestType("requestType"); + assertEquals("requestType", obj.getRequestType()); + + LocalDateTime startTime = LocalDateTime.now(); + obj.setStartTime(startTime.toString()); + assertEquals(startTime.toString(), obj.getStartTime()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestDetails.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestDetails.java index 42dfe0805..6e9a2bade 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestDetails.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestDetails.java @@ -1,174 +1,174 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-
-public class TestSoRequestDetails {
-
- @Test
- public void testConstructor() {
- SORequestDetails obj = new SORequestDetails();
-
- assertTrue(obj.getCloudConfiguration() == null);
- assertTrue(obj.getModelInfo() == null);
- assertTrue(obj.getRequestInfo() == null);
- assertTrue(obj.getRequestParameters() == null);
- assertTrue(obj.getSubscriberInfo() == null);
-
- assertTrue(obj.getRelatedInstanceList() != null);
- assertEquals(0, obj.getRelatedInstanceList().size());
- }
-
- @Test
- public void testSetGet() {
- SORequestDetails obj = new SORequestDetails();
-
- SOCloudConfiguration cloudConfiguration = new SOCloudConfiguration();
- obj.setCloudConfiguration(cloudConfiguration);
- assertEquals(cloudConfiguration, obj.getCloudConfiguration());
-
- SOModelInfo modelInfo = new SOModelInfo();
- obj.setModelInfo(modelInfo);
- assertEquals(modelInfo, obj.getModelInfo());
-
- SORequestInfo requestInfo = new SORequestInfo();
- obj.setRequestInfo(requestInfo);
- assertEquals(requestInfo, obj.getRequestInfo());
-
- SORequestParameters requestParameters = new SORequestParameters();
- obj.setRequestParameters(requestParameters);
- assertEquals(requestParameters, obj.getRequestParameters());
-
- SOSubscriberInfo subscriberInfo = new SOSubscriberInfo();
- obj.setSubscriberInfo(subscriberInfo);
- assertEquals(subscriberInfo, obj.getSubscriberInfo());
- }
-
- @Test
- public void testSOMRequestDetailsMethods() {
- SORequestDetails details = new SORequestDetails();
- assertNotNull(details);
- assertNotEquals(0, details.hashCode());
-
- SOCloudConfiguration cloudConfiguration = new SOCloudConfiguration();
- details.setCloudConfiguration(cloudConfiguration);
- assertEquals(cloudConfiguration, details.getCloudConfiguration());
- assertNotEquals(0, details.hashCode());
-
- SOModelInfo modelInfo = new SOModelInfo();
- details.setModelInfo(modelInfo);
- assertEquals(modelInfo, details.getModelInfo());
- assertNotEquals(0, details.hashCode());
-
- List<SORelatedInstanceListElement> relatedInstanceList = new ArrayList<>();
- details.setRelatedInstanceList(relatedInstanceList);
- assertEquals(relatedInstanceList, details.getRelatedInstanceList());
- assertNotEquals(0, details.hashCode());
-
- SORequestInfo requestInfo = new SORequestInfo();
- details.setRequestInfo(requestInfo);
- assertEquals(requestInfo, details.getRequestInfo());
- assertNotEquals(0, details.hashCode());
-
- SORequestParameters requestParameters = new SORequestParameters();
- details.setRequestParameters(requestParameters);
- assertEquals(requestParameters, details.getRequestParameters());
- assertNotEquals(0, details.hashCode());
-
- SOSubscriberInfo subscriberInfo = new SOSubscriberInfo();
- details.setSubscriberInfo(subscriberInfo);
- assertEquals(subscriberInfo, details.getSubscriberInfo());
- assertNotEquals(0, details.hashCode());
-
- assertEquals("SORequestDetails [modelInfo=org.onap.policy.so", details.toString().substring(0, 46));
-
- SORequestDetails copiedDetails = new SORequestDetails(details);
-
- assertTrue(details.equals(details));
- assertTrue(details.equals(copiedDetails));
- assertFalse(details.equals(null));
- assertFalse(details.equals("Hello"));
-
- details.setCloudConfiguration(null);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setCloudConfiguration(null);
- assertTrue(details.equals(copiedDetails));
- details.setCloudConfiguration(cloudConfiguration);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setCloudConfiguration(cloudConfiguration);
- assertTrue(details.equals(copiedDetails));
-
- details.setModelInfo(null);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setModelInfo(null);
- assertTrue(details.equals(copiedDetails));
- details.setModelInfo(modelInfo);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setModelInfo(modelInfo);
- assertTrue(details.equals(copiedDetails));
-
- details.setRequestInfo(null);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setRequestInfo(null);
- assertTrue(details.equals(copiedDetails));
- details.setRequestInfo(requestInfo);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setRequestInfo(requestInfo);
- assertTrue(details.equals(copiedDetails));
-
- details.setRequestParameters(null);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setRequestParameters(null);
- assertTrue(details.equals(copiedDetails));
- details.setRequestParameters(requestParameters);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setRequestParameters(requestParameters);
- assertTrue(details.equals(copiedDetails));
-
- details.setSubscriberInfo(null);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setSubscriberInfo(null);
- assertTrue(details.equals(copiedDetails));
- details.setSubscriberInfo(subscriberInfo);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setSubscriberInfo(subscriberInfo);
- assertTrue(details.equals(copiedDetails));
-
- details.setRelatedInstanceList(null);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setRelatedInstanceList(null);
- assertTrue(details.equals(copiedDetails));
- details.setRelatedInstanceList(relatedInstanceList);
- assertFalse(details.equals(copiedDetails));
- copiedDetails.setRelatedInstanceList(relatedInstanceList);
- assertTrue(details.equals(copiedDetails));
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; + +public class TestSoRequestDetails { + + @Test + public void testConstructor() { + SORequestDetails obj = new SORequestDetails(); + + assertTrue(obj.getCloudConfiguration() == null); + assertTrue(obj.getModelInfo() == null); + assertTrue(obj.getRequestInfo() == null); + assertTrue(obj.getRequestParameters() == null); + assertTrue(obj.getSubscriberInfo() == null); + + assertTrue(obj.getRelatedInstanceList() != null); + assertEquals(0, obj.getRelatedInstanceList().size()); + } + + @Test + public void testSetGet() { + SORequestDetails obj = new SORequestDetails(); + + SOCloudConfiguration cloudConfiguration = new SOCloudConfiguration(); + obj.setCloudConfiguration(cloudConfiguration); + assertEquals(cloudConfiguration, obj.getCloudConfiguration()); + + SOModelInfo modelInfo = new SOModelInfo(); + obj.setModelInfo(modelInfo); + assertEquals(modelInfo, obj.getModelInfo()); + + SORequestInfo requestInfo = new SORequestInfo(); + obj.setRequestInfo(requestInfo); + assertEquals(requestInfo, obj.getRequestInfo()); + + SORequestParameters requestParameters = new SORequestParameters(); + obj.setRequestParameters(requestParameters); + assertEquals(requestParameters, obj.getRequestParameters()); + + SOSubscriberInfo subscriberInfo = new SOSubscriberInfo(); + obj.setSubscriberInfo(subscriberInfo); + assertEquals(subscriberInfo, obj.getSubscriberInfo()); + } + + @Test + public void testSOMRequestDetailsMethods() { + SORequestDetails details = new SORequestDetails(); + assertNotNull(details); + assertNotEquals(0, details.hashCode()); + + SOCloudConfiguration cloudConfiguration = new SOCloudConfiguration(); + details.setCloudConfiguration(cloudConfiguration); + assertEquals(cloudConfiguration, details.getCloudConfiguration()); + assertNotEquals(0, details.hashCode()); + + SOModelInfo modelInfo = new SOModelInfo(); + details.setModelInfo(modelInfo); + assertEquals(modelInfo, details.getModelInfo()); + assertNotEquals(0, details.hashCode()); + + List<SORelatedInstanceListElement> relatedInstanceList = new ArrayList<>(); + details.setRelatedInstanceList(relatedInstanceList); + assertEquals(relatedInstanceList, details.getRelatedInstanceList()); + assertNotEquals(0, details.hashCode()); + + SORequestInfo requestInfo = new SORequestInfo(); + details.setRequestInfo(requestInfo); + assertEquals(requestInfo, details.getRequestInfo()); + assertNotEquals(0, details.hashCode()); + + SORequestParameters requestParameters = new SORequestParameters(); + details.setRequestParameters(requestParameters); + assertEquals(requestParameters, details.getRequestParameters()); + assertNotEquals(0, details.hashCode()); + + SOSubscriberInfo subscriberInfo = new SOSubscriberInfo(); + details.setSubscriberInfo(subscriberInfo); + assertEquals(subscriberInfo, details.getSubscriberInfo()); + assertNotEquals(0, details.hashCode()); + + assertEquals("SORequestDetails [modelInfo=org.onap.policy.so", details.toString().substring(0, 46)); + + SORequestDetails copiedDetails = new SORequestDetails(details); + + assertTrue(details.equals(details)); + assertTrue(details.equals(copiedDetails)); + assertFalse(details.equals(null)); + assertFalse(details.equals("Hello")); + + details.setCloudConfiguration(null); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setCloudConfiguration(null); + assertTrue(details.equals(copiedDetails)); + details.setCloudConfiguration(cloudConfiguration); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setCloudConfiguration(cloudConfiguration); + assertTrue(details.equals(copiedDetails)); + + details.setModelInfo(null); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setModelInfo(null); + assertTrue(details.equals(copiedDetails)); + details.setModelInfo(modelInfo); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setModelInfo(modelInfo); + assertTrue(details.equals(copiedDetails)); + + details.setRequestInfo(null); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setRequestInfo(null); + assertTrue(details.equals(copiedDetails)); + details.setRequestInfo(requestInfo); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setRequestInfo(requestInfo); + assertTrue(details.equals(copiedDetails)); + + details.setRequestParameters(null); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setRequestParameters(null); + assertTrue(details.equals(copiedDetails)); + details.setRequestParameters(requestParameters); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setRequestParameters(requestParameters); + assertTrue(details.equals(copiedDetails)); + + details.setSubscriberInfo(null); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setSubscriberInfo(null); + assertTrue(details.equals(copiedDetails)); + details.setSubscriberInfo(subscriberInfo); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setSubscriberInfo(subscriberInfo); + assertTrue(details.equals(copiedDetails)); + + details.setRelatedInstanceList(null); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setRelatedInstanceList(null); + assertTrue(details.equals(copiedDetails)); + details.setRelatedInstanceList(relatedInstanceList); + assertFalse(details.equals(copiedDetails)); + copiedDetails.setRelatedInstanceList(relatedInstanceList); + assertTrue(details.equals(copiedDetails)); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestError.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestError.java index 1108daf3d..a3c19cf41 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestError.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestError.java @@ -1,50 +1,50 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoRequestError {
-
- @Test
- public void testConstructor() {
- SORequestError obj = new SORequestError();
-
- assertTrue(obj.getPolicyException() == null);
- assertTrue(obj.getServiceException() == null);
- }
-
- @Test
- public void testSetGet() {
- SORequestError obj = new SORequestError();
-
- SOPolicyExceptionHolder policyException = new SOPolicyExceptionHolder();
- obj.setPolicyException(policyException);
- assertEquals(policyException, obj.getPolicyException());
-
- SOServiceExceptionHolder serviceException = new SOServiceExceptionHolder();
- obj.setServiceException(serviceException);
- assertEquals(serviceException, obj.getServiceException());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoRequestError { + + @Test + public void testConstructor() { + SORequestError obj = new SORequestError(); + + assertTrue(obj.getPolicyException() == null); + assertTrue(obj.getServiceException() == null); + } + + @Test + public void testSetGet() { + SORequestError obj = new SORequestError(); + + SOPolicyExceptionHolder policyException = new SOPolicyExceptionHolder(); + obj.setPolicyException(policyException); + assertEquals(policyException, obj.getPolicyException()); + + SOServiceExceptionHolder serviceException = new SOServiceExceptionHolder(); + obj.setServiceException(serviceException); + assertEquals(serviceException, obj.getServiceException()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestInfo.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestInfo.java index d1b7f247c..a77fe8bf4 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestInfo.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestInfo.java @@ -1,81 +1,81 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoRequestInfo {
-
- @Test
- public void testConstructor() {
- SORequestInfo obj = new SORequestInfo();
-
- assertTrue(obj.getBillingAccountNumber() == null);
- assertTrue(obj.getCallbackUrl() == null);
- assertTrue(obj.getCorrelator() == null);
- assertTrue(obj.getInstanceName() == null);
- assertTrue(obj.getOrderNumber() == null);
- assertTrue(obj.getOrderVersion() == null);
- assertTrue(obj.getProductFamilyId() == null);
- assertTrue(obj.getRequestorId() == null);
- assertTrue(obj.getSource() == null);
- assertTrue(obj.isSuppressRollback() == false);
- }
-
- @Test
- public void testSetGet() {
- SORequestInfo obj = new SORequestInfo();
-
- obj.setBillingAccountNumber("billingAccountNumber");
- assertEquals("billingAccountNumber", obj.getBillingAccountNumber());
-
- obj.setCallbackUrl("callbackUrl");
- assertEquals("callbackUrl", obj.getCallbackUrl());
-
- obj.setCorrelator("correlator");
- assertEquals("correlator", obj.getCorrelator());
-
- obj.setInstanceName("instanceName");
- assertEquals("instanceName", obj.getInstanceName());
-
- obj.setOrderNumber("orderNumber");
- assertEquals("orderNumber", obj.getOrderNumber());
-
- int orderVersion = 2008;
- obj.setOrderVersion(orderVersion);
- assertEquals((Integer) orderVersion, obj.getOrderVersion());
-
- obj.setProductFamilyId("productFamilyId");
- assertEquals("productFamilyId", obj.getProductFamilyId());
-
- obj.setRequestorId("requestorId");
- assertEquals("requestorId", obj.getRequestorId());
-
- obj.setSource("source");
- assertEquals("source", obj.getSource());
-
- obj.setSuppressRollback(true);
- assertEquals(true, obj.isSuppressRollback());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoRequestInfo { + + @Test + public void testConstructor() { + SORequestInfo obj = new SORequestInfo(); + + assertTrue(obj.getBillingAccountNumber() == null); + assertTrue(obj.getCallbackUrl() == null); + assertTrue(obj.getCorrelator() == null); + assertTrue(obj.getInstanceName() == null); + assertTrue(obj.getOrderNumber() == null); + assertTrue(obj.getOrderVersion() == null); + assertTrue(obj.getProductFamilyId() == null); + assertTrue(obj.getRequestorId() == null); + assertTrue(obj.getSource() == null); + assertTrue(obj.isSuppressRollback() == false); + } + + @Test + public void testSetGet() { + SORequestInfo obj = new SORequestInfo(); + + obj.setBillingAccountNumber("billingAccountNumber"); + assertEquals("billingAccountNumber", obj.getBillingAccountNumber()); + + obj.setCallbackUrl("callbackUrl"); + assertEquals("callbackUrl", obj.getCallbackUrl()); + + obj.setCorrelator("correlator"); + assertEquals("correlator", obj.getCorrelator()); + + obj.setInstanceName("instanceName"); + assertEquals("instanceName", obj.getInstanceName()); + + obj.setOrderNumber("orderNumber"); + assertEquals("orderNumber", obj.getOrderNumber()); + + int orderVersion = 2008; + obj.setOrderVersion(orderVersion); + assertEquals((Integer) orderVersion, obj.getOrderVersion()); + + obj.setProductFamilyId("productFamilyId"); + assertEquals("productFamilyId", obj.getProductFamilyId()); + + obj.setRequestorId("requestorId"); + assertEquals("requestorId", obj.getRequestorId()); + + obj.setSource("source"); + assertEquals("source", obj.getSource()); + + obj.setSuppressRollback(true); + assertEquals(true, obj.isSuppressRollback()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestParameters.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestParameters.java index cb32be531..1ebf5d76f 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestParameters.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestParameters.java @@ -1,46 +1,46 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoRequestParameters {
-
- @Test
- public void testConstructor() {
- SORequestParameters obj = new SORequestParameters();
-
- assertTrue(obj.getSubscriptionServiceType() == null);
- assertTrue(obj.getUserParams() != null);
- assertEquals(0, obj.getUserParams().size());
- }
-
- @Test
- public void testSetGet() {
- SORequestParameters obj = new SORequestParameters();
-
- obj.setSubscriptionServiceType("subscriptionServiceType");
- assertEquals("subscriptionServiceType", obj.getSubscriptionServiceType());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoRequestParameters { + + @Test + public void testConstructor() { + SORequestParameters obj = new SORequestParameters(); + + assertTrue(obj.getSubscriptionServiceType() == null); + assertTrue(obj.getUserParams() != null); + assertEquals(0, obj.getUserParams().size()); + } + + @Test + public void testSetGet() { + SORequestParameters obj = new SORequestParameters(); + + obj.setSubscriptionServiceType("subscriptionServiceType"); + assertEquals("subscriptionServiceType", obj.getSubscriptionServiceType()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestReferences.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestReferences.java index e212ba1c3..498a2e00b 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestReferences.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestReferences.java @@ -1,48 +1,48 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoRequestReferences {
-
- @Test
- public void testConstructor() {
- SORequestReferences obj = new SORequestReferences();
-
- assertTrue(obj.getInstanceId() == null);
- assertTrue(obj.getRequestId() == null);
- }
-
- @Test
- public void testSetGet() {
- SORequestReferences obj = new SORequestReferences();
-
- obj.setInstanceId("instanceId");
- assertEquals("instanceId", obj.getInstanceId());
-
- obj.setRequestId("requestId");
- assertEquals("requestId", obj.getRequestId());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoRequestReferences { + + @Test + public void testConstructor() { + SORequestReferences obj = new SORequestReferences(); + + assertTrue(obj.getInstanceId() == null); + assertTrue(obj.getRequestId() == null); + } + + @Test + public void testSetGet() { + SORequestReferences obj = new SORequestReferences(); + + obj.setInstanceId("instanceId"); + assertEquals("instanceId", obj.getInstanceId()); + + obj.setRequestId("requestId"); + assertEquals("requestId", obj.getRequestId()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestStatus.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestStatus.java index 9fa0b9741..1b8d745fd 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestStatus.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestStatus.java @@ -1,57 +1,57 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoRequestStatus {
-
- @Test
- public void testConstructor() {
- SORequestStatus obj = new SORequestStatus();
-
- assertEquals(0, obj.getPercentProgress());
- assertTrue(obj.getRequestState() == null);
- assertTrue(obj.getTimestamp() == null);
- assertFalse(obj.isWasRolledBack());
- }
-
- @Test
- public void testSetGet() {
- SORequestStatus obj = new SORequestStatus();
-
- obj.setPercentProgress(2008);
- assertEquals(2008, obj.getPercentProgress());
-
- obj.setRequestState("requestState");
- assertEquals("requestState", obj.getRequestState());
-
- obj.setTimestamp("timestamp");
- assertEquals("timestamp", obj.getTimestamp());
-
- obj.setWasRolledBack(true);
- assertTrue(obj.isWasRolledBack());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoRequestStatus { + + @Test + public void testConstructor() { + SORequestStatus obj = new SORequestStatus(); + + assertEquals(0, obj.getPercentProgress()); + assertTrue(obj.getRequestState() == null); + assertTrue(obj.getTimestamp() == null); + assertFalse(obj.isWasRolledBack()); + } + + @Test + public void testSetGet() { + SORequestStatus obj = new SORequestStatus(); + + obj.setPercentProgress(2008); + assertEquals(2008, obj.getPercentProgress()); + + obj.setRequestState("requestState"); + assertEquals("requestState", obj.getRequestState()); + + obj.setTimestamp("timestamp"); + assertEquals("timestamp", obj.getTimestamp()); + + obj.setWasRolledBack(true); + assertTrue(obj.isWasRolledBack()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponse.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponse.java index edac2fa0d..cf9a85e83 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponse.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponse.java @@ -1,59 +1,59 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoResponse {
-
- @Test
- public void testConstructor() {
- SOResponse obj = new SOResponse();
-
- assertEquals(0, obj.getHttpResponseCode());
- assertTrue(obj.getRequest() == null);
- assertTrue(obj.getRequestError() == null);
- assertTrue(obj.getRequestReferences() == null);
- }
-
- @Test
- public void testSetGet() {
- SOResponse obj = new SOResponse();
-
- obj.setHttpResponseCode(2008);
- assertEquals(2008, obj.getHttpResponseCode());
-
- SORequest request = new SORequest();
- obj.setRequest(request);
- assertEquals(request, obj.getRequest());
-
- SORequestError requestError = new SORequestError();
- obj.setRequestError(requestError);
- assertEquals(requestError, obj.getRequestError());
-
- SORequestReferences requestReferences = new SORequestReferences();
- obj.setRequestReferences(requestReferences);
- assertEquals(requestReferences, obj.getRequestReferences());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoResponse { + + @Test + public void testConstructor() { + SOResponse obj = new SOResponse(); + + assertEquals(0, obj.getHttpResponseCode()); + assertTrue(obj.getRequest() == null); + assertTrue(obj.getRequestError() == null); + assertTrue(obj.getRequestReferences() == null); + } + + @Test + public void testSetGet() { + SOResponse obj = new SOResponse(); + + obj.setHttpResponseCode(2008); + assertEquals(2008, obj.getHttpResponseCode()); + + SORequest request = new SORequest(); + obj.setRequest(request); + assertEquals(request, obj.getRequest()); + + SORequestError requestError = new SORequestError(); + obj.setRequestError(requestError); + assertEquals(requestError, obj.getRequestError()); + + SORequestReferences requestReferences = new SORequestReferences(); + obj.setRequestReferences(requestReferences); + assertEquals(requestReferences, obj.getRequestReferences()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponseWrapper.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponseWrapper.java index 7b4830125..860761a39 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponseWrapper.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponseWrapper.java @@ -1,106 +1,106 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-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 java.util.UUID;
-
-import org.junit.Test;
-
-public class TestSoResponseWrapper {
-
- @Test
- public void testConstructor() {
- SOResponse response = new SOResponse();
- SOResponseWrapper obj = new SOResponseWrapper(response, "reqID");
-
- assertEquals(response, obj.getSoResponse());
- assertEquals("reqID", obj.getRequestID());
- }
-
- @Test
- public void testSetGet() {
- SOResponse response = new SOResponse();
- SOResponseWrapper obj = new SOResponseWrapper(response, "reqID");
-
- SOResponse response2 = new SOResponse();
- response2.setHttpResponseCode(2008);
- obj.setSoResponse(response2);
- assertEquals(response2, obj.getSoResponse());
-
- obj.setRequestID("id2");
- assertEquals("id2", obj.getRequestID());
- }
-
- @SuppressWarnings("unlikely-arg-type")
- @Test
- public void testSOResponseWrapperMethods() {
- String requestID = UUID.randomUUID().toString();
- SOResponse response = new SOResponse();
-
- SOResponseWrapper responseWrapper = new SOResponseWrapper(response, requestID);
- assertNotNull(responseWrapper);
- assertNotEquals(0, responseWrapper.hashCode());
-
- assertEquals(response, responseWrapper.getSoResponse());
-
- assertNotEquals(0, responseWrapper.hashCode());
-
- assertEquals("SOResponseWrapper [SOResponse=org.onap.policy.", responseWrapper.toString().substring(0, 46));
-
- SOResponseWrapper identicalResponseWrapper = new SOResponseWrapper(response, requestID);
-
- assertEquals(responseWrapper, responseWrapper);
- assertEquals(responseWrapper, identicalResponseWrapper);
- assertNotEquals(null, responseWrapper);
- assertNotEquals("Hello", responseWrapper);
- assertFalse(responseWrapper.equals(null));
- assertFalse(responseWrapper.equals("AString"));
-
- assertEquals(new SOResponseWrapper(null, null), new SOResponseWrapper(null, null));
- assertNotEquals(new SOResponseWrapper(null, null), identicalResponseWrapper);
-
- assertNotEquals(0, new SOResponseWrapper(null, null).hashCode());
-
- identicalResponseWrapper.setSoResponse(new SOResponse());
- assertNotEquals(responseWrapper, identicalResponseWrapper);
- identicalResponseWrapper.setSoResponse(response);
- assertEquals(responseWrapper, identicalResponseWrapper);
-
- identicalResponseWrapper.setRequestID(UUID.randomUUID().toString());
- assertNotEquals(responseWrapper, identicalResponseWrapper);
- identicalResponseWrapper.setRequestID(requestID);
- assertEquals(responseWrapper, identicalResponseWrapper);
-
- responseWrapper.setRequestID(null);
- assertNotEquals(responseWrapper, identicalResponseWrapper);
- identicalResponseWrapper.setRequestID(null);
- assertEquals(responseWrapper, identicalResponseWrapper);
- responseWrapper.setRequestID(requestID);
- assertNotEquals(responseWrapper, identicalResponseWrapper);
- identicalResponseWrapper.setRequestID(requestID);
- assertEquals(responseWrapper, identicalResponseWrapper);
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +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 java.util.UUID; + +import org.junit.Test; + +public class TestSoResponseWrapper { + + @Test + public void testConstructor() { + SOResponse response = new SOResponse(); + SOResponseWrapper obj = new SOResponseWrapper(response, "reqID"); + + assertEquals(response, obj.getSoResponse()); + assertEquals("reqID", obj.getRequestID()); + } + + @Test + public void testSetGet() { + SOResponse response = new SOResponse(); + SOResponseWrapper obj = new SOResponseWrapper(response, "reqID"); + + SOResponse response2 = new SOResponse(); + response2.setHttpResponseCode(2008); + obj.setSoResponse(response2); + assertEquals(response2, obj.getSoResponse()); + + obj.setRequestID("id2"); + assertEquals("id2", obj.getRequestID()); + } + + @SuppressWarnings("unlikely-arg-type") + @Test + public void testSOResponseWrapperMethods() { + String requestID = UUID.randomUUID().toString(); + SOResponse response = new SOResponse(); + + SOResponseWrapper responseWrapper = new SOResponseWrapper(response, requestID); + assertNotNull(responseWrapper); + assertNotEquals(0, responseWrapper.hashCode()); + + assertEquals(response, responseWrapper.getSoResponse()); + + assertNotEquals(0, responseWrapper.hashCode()); + + assertEquals("SOResponseWrapper [SOResponse=org.onap.policy.", responseWrapper.toString().substring(0, 46)); + + SOResponseWrapper identicalResponseWrapper = new SOResponseWrapper(response, requestID); + + assertEquals(responseWrapper, responseWrapper); + assertEquals(responseWrapper, identicalResponseWrapper); + assertNotEquals(null, responseWrapper); + assertNotEquals("Hello", responseWrapper); + assertFalse(responseWrapper.equals(null)); + assertFalse(responseWrapper.equals("AString")); + + assertEquals(new SOResponseWrapper(null, null), new SOResponseWrapper(null, null)); + assertNotEquals(new SOResponseWrapper(null, null), identicalResponseWrapper); + + assertNotEquals(0, new SOResponseWrapper(null, null).hashCode()); + + identicalResponseWrapper.setSoResponse(new SOResponse()); + assertNotEquals(responseWrapper, identicalResponseWrapper); + identicalResponseWrapper.setSoResponse(response); + assertEquals(responseWrapper, identicalResponseWrapper); + + identicalResponseWrapper.setRequestID(UUID.randomUUID().toString()); + assertNotEquals(responseWrapper, identicalResponseWrapper); + identicalResponseWrapper.setRequestID(requestID); + assertEquals(responseWrapper, identicalResponseWrapper); + + responseWrapper.setRequestID(null); + assertNotEquals(responseWrapper, identicalResponseWrapper); + identicalResponseWrapper.setRequestID(null); + assertEquals(responseWrapper, identicalResponseWrapper); + responseWrapper.setRequestID(requestID); + assertNotEquals(responseWrapper, identicalResponseWrapper); + identicalResponseWrapper.setRequestID(requestID); + assertEquals(responseWrapper, identicalResponseWrapper); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoServiceExceptionHolder.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoServiceExceptionHolder.java index 877ea7146..7c802efaf 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoServiceExceptionHolder.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoServiceExceptionHolder.java @@ -1,50 +1,50 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoServiceExceptionHolder {
-
- @Test
- public void testConstructor() {
- SOServiceExceptionHolder obj = new SOServiceExceptionHolder();
-
- assertTrue(obj.getMessageId() == null);
- assertTrue(obj.getText() == null);
- assertTrue(obj.getVariables() != null);
- assertEquals(0, obj.getVariables().size());
- }
-
- @Test
- public void testSetGet() {
- SOServiceExceptionHolder obj = new SOServiceExceptionHolder();
-
- obj.setMessageId("messageId");
- assertEquals("messageId", obj.getMessageId());
-
- obj.setText("text");
- assertEquals("text", obj.getText());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoServiceExceptionHolder { + + @Test + public void testConstructor() { + SOServiceExceptionHolder obj = new SOServiceExceptionHolder(); + + assertTrue(obj.getMessageId() == null); + assertTrue(obj.getText() == null); + assertTrue(obj.getVariables() != null); + assertEquals(0, obj.getVariables().size()); + } + + @Test + public void testSetGet() { + SOServiceExceptionHolder obj = new SOServiceExceptionHolder(); + + obj.setMessageId("messageId"); + assertEquals("messageId", obj.getMessageId()); + + obj.setText("text"); + assertEquals("text", obj.getText()); + } +} diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoSubscriberInfo.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoSubscriberInfo.java index 0bff38c5c..b0662fa30 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoSubscriberInfo.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoSubscriberInfo.java @@ -1,52 +1,52 @@ -/*-
- * ============LICENSE_START=======================================================
- * so
- * ================================================================================
- *
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.so;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class TestSoSubscriberInfo {
-
- @Test
- public void testConstructor() {
- SOSubscriberInfo obj = new SOSubscriberInfo();
-
- assertTrue(obj.getGlobalSubscriberId() == null);
- assertTrue(obj.getSubscriberCommonSiteId() == null);
- assertTrue(obj.getSubscriberName() == null);
- }
-
- @Test
- public void testSetGet() {
- SOSubscriberInfo obj = new SOSubscriberInfo();
-
- obj.setGlobalSubscriberId("globalSubscriberId");
- assertEquals("globalSubscriberId", obj.getGlobalSubscriberId());
-
- obj.setSubscriberCommonSiteId("subscriberCommonSiteId");
- assertEquals("subscriberCommonSiteId", obj.getSubscriberCommonSiteId());
-
- obj.setSubscriberName("subscriberName");
- assertEquals("subscriberName", obj.getSubscriberName());
- }
-}
+/*- + * ============LICENSE_START======================================================= + * so + * ================================================================================ + * + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.so; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestSoSubscriberInfo { + + @Test + public void testConstructor() { + SOSubscriberInfo obj = new SOSubscriberInfo(); + + assertTrue(obj.getGlobalSubscriberId() == null); + assertTrue(obj.getSubscriberCommonSiteId() == null); + assertTrue(obj.getSubscriberName() == null); + } + + @Test + public void testSetGet() { + SOSubscriberInfo obj = new SOSubscriberInfo(); + + obj.setGlobalSubscriberId("globalSubscriberId"); + assertEquals("globalSubscriberId", obj.getGlobalSubscriberId()); + + obj.setSubscriberCommonSiteId("subscriberCommonSiteId"); + assertEquals("subscriberCommonSiteId", obj.getSubscriberCommonSiteId()); + + obj.setSubscriberName("subscriberName"); + assertEquals("subscriberName", obj.getSubscriberName()); + } +} |