From 409d9eaae8fbbd2543fb82ef38d589ea3a83ef6c Mon Sep 17 00:00:00 2001 From: Felix Sangalang Date: Mon, 9 Apr 2018 16:58:05 -0700 Subject: Add junit coverage for CompareModelsResult java junit coverage for CompareModelsResult Issue-ID: SO-569 Change-Id: I4bde75c36b19427580bf1b2483e7d16f88a69d2d Signed-off-by: Felix Sangalang --- .../bpmn/core/domain/CompareModelsResultTest.java | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/domain/CompareModelsResultTest.java (limited to 'bpmn/MSOCoreBPMN/src') diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/domain/CompareModelsResultTest.java b/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/domain/CompareModelsResultTest.java new file mode 100644 index 0000000000..90cb7362cf --- /dev/null +++ b/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/domain/CompareModelsResultTest.java @@ -0,0 +1,83 @@ +/* +* ============LICENSE_START======================================================= +* ONAP : SO +* ================================================================================ +* Copyright (C) 2018 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.openecomp.mso.bpmn.core.domain; + +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Before; +import org.junit.Test; + +public class CompareModelsResultTest { + + private CompareModelsResult modelsResult; + private List addedResourceList; + private List deletedResourceList; + private ResourceModelInfo resourceModelInfo1; + private ResourceModelInfo resourceModelInfo2; + private List requestInputs; + + @Before + public void before() { + resourceModelInfo1 = new ResourceModelInfo(); + resourceModelInfo1.setResourceCustomizationUuid("f1d563e8-e714-4393-8f99-cc480144a05e"); + resourceModelInfo1.setResourceInvariantUuid("e1d563e8-e714-4393-8f99-cc480144a05f"); + resourceModelInfo1.setResourceName("resourceName1"); + resourceModelInfo1.setResourceUuid("f1d563e8-e714-4393-8f99-cc480144a05g"); + resourceModelInfo2 = new ResourceModelInfo(); + resourceModelInfo2.setResourceCustomizationUuid("a1d563e8-e714-4393-8f99-cc480144a05d"); + resourceModelInfo2.setResourceInvariantUuid("b1d563e8-e714-4393-8f99-cc480144a05e"); + resourceModelInfo2.setResourceName("resourceName2"); + resourceModelInfo2.setResourceUuid("c1d563e8-e714-4393-8f99-cc480144a05f"); + } + + @Test + public void testSetAddedResourceList() { + addedResourceList = new ArrayList(); + addedResourceList.add(resourceModelInfo1); + addedResourceList.add(resourceModelInfo2); + modelsResult = new CompareModelsResult(); + modelsResult.setAddedResourceList(addedResourceList); + assertEquals(addedResourceList, modelsResult.getAddedResourceList()); + } + + @Test + public void testSetDeletedResourceList() { + deletedResourceList = new ArrayList(); + deletedResourceList.add(resourceModelInfo1); + deletedResourceList.add(resourceModelInfo2); + modelsResult = new CompareModelsResult(); + modelsResult.setDeletedResourceList(deletedResourceList); + assertEquals(deletedResourceList, modelsResult.getDeletedResourceList()); + } + + @Test + public void testSetRequestInputs() { + requestInputs = new ArrayList(); + requestInputs.add("requestInput1"); + requestInputs.add("requestInput2"); + modelsResult = new CompareModelsResult(); + modelsResult.setRequestInputs(requestInputs); + assertEquals(requestInputs, modelsResult.getRequestInputs()); + } + +} -- cgit 1.2.3-korg