From 41216decc9e167ee85aff6391f67dcf4b94f489c Mon Sep 17 00:00:00 2001 From: grabinsk Date: Fri, 5 Apr 2019 10:13:48 +0200 Subject: replace generated model classes with immutables Change-Id: I5a1330e356522d2e315f7e243a2e65b90e4f6ddd Issue-ID: DCAEGEN2-1391 Signed-off-by: grabinsk --- .../services/prh/tasks/AaiQueryTaskImplTest.java | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'prh-app-server/src/test') diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java index 4b6d7a61..26a6060f 100644 --- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java +++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java @@ -38,6 +38,7 @@ import java.util.List; import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) public class AaiQueryTaskImplTest { @@ -59,9 +60,14 @@ public class AaiQueryTaskImplTest { @Mock private AaiServiceInstanceResultModel serviceModel; - private final RelationshipData customer = new RelationshipData(); - private final RelationshipData serviceType = new RelationshipData(); - private final RelationshipData serviceInstanceId = new RelationshipData(); + @Mock + private RelationshipData customer; + + @Mock + private RelationshipData serviceType; + + @Mock + private RelationshipData serviceInstanceId; private List allRelationData; @@ -71,14 +77,14 @@ public class AaiQueryTaskImplTest { @BeforeEach void setUp() { - customer.setRelationshipKey(AaiQueryTaskImpl.CUSTOMER); - customer.setRelationshipValue("Foo"); + when(customer.getRelationshipKey()).thenReturn(AaiQueryTaskImpl.CUSTOMER); + when(customer.getRelationshipValue()).thenReturn("Foo"); - serviceType.setRelationshipKey(AaiQueryTaskImpl.SERVICE_TYPE); - serviceType.setRelationshipValue("Bar"); + when(serviceType.getRelationshipKey()).thenReturn(AaiQueryTaskImpl.SERVICE_TYPE); + when(serviceType.getRelationshipValue()).thenReturn("Bar"); - serviceInstanceId.setRelationshipKey(AaiQueryTaskImpl.SERVICE_INSTANCE_ID); - serviceInstanceId.setRelationshipValue("Baz"); + when(serviceInstanceId.getRelationshipKey()).thenReturn(AaiQueryTaskImpl.SERVICE_INSTANCE_ID); + when(serviceInstanceId.getRelationshipValue()).thenReturn("Baz"); allRelationData = Lists.list(customer, serviceType, serviceInstanceId); -- cgit 1.2.3-korg