diff options
author | Steve Smokowski <ss835w@att.com> | 2020-03-10 14:54:05 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-03-10 14:54:05 +0000 |
commit | 4dc7f5c75956c68223003ad10670ef47bdad6e26 (patch) | |
tree | 81bee1d8b7a0672bc9f8eed63941fffde9ccaaf2 /mso-api-handlers/mso-requests-db-repositories/src/test/java/org | |
parent | b6e82755d6b3454951d3627dd3f51a0e2a50f49b (diff) | |
parent | f098f1a57f024df9396ec994129f0a01b7a94248 (diff) |
Merge "Enable date span filtering for getOrchestrationFiltersFromInfraActive"
Diffstat (limited to 'mso-api-handlers/mso-requests-db-repositories/src/test/java/org')
-rw-r--r-- | mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java b/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java index 3df30c0f49..070457d9f1 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java @@ -19,26 +19,6 @@ */ package org.onap.so.db.request.data.repository; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.not; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.mock; -import static org.onap.so.db.request.data.repository.InfraActiveRequestsRepositoryImpl.REQUEST_ID; -import static org.onap.so.db.request.data.repository.InfraActiveRequestsRepositoryImpl.SERVICE_INSTANCE_ID; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.Predicate; -import javax.persistence.criteria.Root; import org.junit.Test; import org.junit.runner.RunWith; import org.onap.so.TestApplication; @@ -47,6 +27,22 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.onap.so.db.request.data.repository.InfraActiveRequestsRepositoryImpl.REQUEST_ID; +import static org.onap.so.db.request.data.repository.InfraActiveRequestsRepositoryImpl.SERVICE_INSTANCE_ID; @RunWith(SpringRunner.class) @SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @@ -171,4 +167,13 @@ public class InfraActiveRequestsRepositoryImplTest { actualRequests.stream().map(item -> item.getServiceInstanceName()).collect(Collectors.joining(","))); } + @Test + public void test_getOrchestrationFiltersFromInfraActive_between_dates() { + Map<String, List<String>> orchestrationMap = new HashMap<>(); + orchestrationMap.put("startTime", Arrays.asList("BETWEEN_DATES", "12-01-2018", "12-31-2018")); + List<InfraActiveRequests> result = objUnderTest.getOrchestrationFiltersFromInfraActive(orchestrationMap); + + assertEquals(1, result.size()); + } + } |