summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorMichael Hwang <mhwang@research.att.com>2017-09-19 17:28:07 -0400
committerMichael Hwang <mhwang@research.att.com>2017-09-19 17:28:44 -0400
commitb862255dd62b47f75ead38ae0ac52a17a08e51fb (patch)
treea4757e12e6582075be6e10911035973bab1f9091 /src/test
parentcbc48bab6d6b732d69e5fea35d70493f9fa6a0d4 (diff)
Get unit tests working
Including fixing of broken test Change-Id: Ie5fa6a2c4bd59b7552480899616590c7944e5aa4 Issue-Id: DCAEGEN2-60 Signed-off-by: Michael Hwang <mhwang@research.att.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/DcaeServiceTypesApiServiceImplTests.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/java/DcaeServiceTypesApiServiceImplTests.java b/src/test/java/DcaeServiceTypesApiServiceImplTests.java
index ce0011b..c4ada1f 100644
--- a/src/test/java/DcaeServiceTypesApiServiceImplTests.java
+++ b/src/test/java/DcaeServiceTypesApiServiceImplTests.java
@@ -47,6 +47,7 @@ import org.slf4j.LoggerFactory;
import java.util.Arrays;
import java.util.Objects;
+import java.util.UUID;
/**
@@ -204,10 +205,12 @@ public class DcaeServiceTypesApiServiceImplTests {
minimalFixture.setOwner("tester");
minimalFixture.setBlueprintTemplate("{ blueprint template goes here }");
- String expectedTypeId = String.format("%s:%s", minimalFixture.getTypeName(), minimalFixture.getTypeVersion());
+ UUID expectedTypeIdUUID = UUID.randomUUID();
- when(mockTypesDAO.getByTypeId(expectedTypeId)).thenReturn(new DCAEServiceTypeObject());
- when(mockServicesDAO.countByType(DCAEServiceObject.DCAEServiceStatus.RUNNING, expectedTypeId)).thenReturn(10);
+ DCAEServiceTypeObject fakeExistingType = new DCAEServiceTypeObject();
+ fakeExistingType.setTypeId(expectedTypeIdUUID.toString());
+ when(mockTypesDAO.getByRequestFromNotASDC(minimalFixture)).thenReturn(fakeExistingType);
+ when(mockServicesDAO.countByType(DCAEServiceObject.DCAEServiceStatus.RUNNING, fakeExistingType.getTypeId())).thenReturn(10);
try {
Response response = api.dcaeServiceTypesTypeIdPost(minimalFixture, uriInfo, null);