use of org.onap.so.db.request.beans.InfraActiveRequests in project so by onap.
the class RequestsDbClientTest method getInfraActiveRequestbyRequestIdTest.
@Test
public void getInfraActiveRequestbyRequestIdTest() {
InfraActiveRequests infraActiveRequestsResponse = requestsDbClient.getInfraActiveRequestbyRequestId(infraActiveRequests.getRequestId());
verifyInfraActiveRequests(infraActiveRequestsResponse);
infraActiveRequestsResponse = requestsDbClient.getInfraActiveRequestbyRequestId(infraActiveRequests.getRequestId());
assertNull(requestsDbClient.getInfraActiveRequestbyRequestId(UUID.randomUUID().toString()));
}
use of org.onap.so.db.request.beans.InfraActiveRequests in project so by onap.
the class RequestsDbClientTest method checkVnfIdStatusTest.
@Test
public void checkVnfIdStatusTest() {
InfraActiveRequests infraActiveRequestsResponse = requestsDbClient.checkVnfIdStatus(infraActiveRequests.getOperationalEnvId());
verifyInfraActiveRequests(infraActiveRequestsResponse);
assertNull(requestsDbClient.checkVnfIdStatus(UUID.randomUUID().toString()));
}
use of org.onap.so.db.request.beans.InfraActiveRequests in project so by onap.
the class ArchiveInfraRequestsSchedulerTest method testArchiveInfraRequests.
@Test
@Transactional
public void testArchiveInfraRequests() throws Exception {
String requestId1 = "requestId1";
String requestId2 = "requestId2";
InfraActiveRequests iar1 = new InfraActiveRequests();
iar1.setRequestId(requestId1);
InfraActiveRequests iar2 = new InfraActiveRequests();
iar2.setRequestId(requestId2);
List<InfraActiveRequests> requests = new ArrayList<>();
requests.add(iar1);
requests.add(iar2);
iarRepo.saveAll(requests);
scheduler.archiveInfraRequests(requests);
assertEquals(2, archivedRepo.count());
assertEquals(requestId1, archivedRepo.findById(requestId1).orElseThrow(() -> new Exception("Request Not Found")).getRequestId());
assertEquals(requestId2, archivedRepo.findById(requestId2).orElseThrow(() -> new Exception("Request Not Found")).getRequestId());
}
use of org.onap.so.db.request.beans.InfraActiveRequests in project so by onap.
the class RequestsDbClientTest method getCloudOrchestrationFiltersFromInfraActiveTest.
@Test
public void getCloudOrchestrationFiltersFromInfraActiveTest() {
Map<String, String> requestMap = new HashMap<>();
requestMap.put("operationalEnvironmentId", infraActiveRequests.getOperationalEnvId());
requestMap.put("operationalEnvironmentName", infraActiveRequests.getOperationalEnvName());
requestMap.put("resourceType", "operationalEnvironment");
List<InfraActiveRequests> iarr = requestsDbClient.getCloudOrchestrationFiltersFromInfraActive(requestMap);
assertEquals(1, iarr.size());
InfraActiveRequests infraActiveRequestsResponse = iarr.get(0);
verifyInfraActiveRequests(infraActiveRequestsResponse);
}
use of org.onap.so.db.request.beans.InfraActiveRequests in project so by onap.
the class RequestsDbClientTest method getOrchestrationFiltersFromInfraActiveTest.
@Test
public void getOrchestrationFiltersFromInfraActiveTest() {
Map<String, List<String>> requestMap = new HashMap<>();
List<String> values = new ArrayList<>();
values.add("EQUALS");
values.add(infraActiveRequests.getServiceInstanceId());
requestMap.put("serviceInstanceId", values);
values = new ArrayList<>();
values.add("EQUALS");
values.add(infraActiveRequests.getServiceInstanceName());
requestMap.put("serviceInstanceName", values);
List<InfraActiveRequests> iaar = requestsDbClient.getOrchestrationFiltersFromInfraActive(requestMap);
assertEquals(1, iaar.size());
InfraActiveRequests infraActiveRequestsResponse = iaar.get(0);
verifyInfraActiveRequests(infraActiveRequestsResponse);
values = new ArrayList<>();
values.add("EQUALS");
values.add(UUID.randomUUID().toString());
requestMap.put("serviceInstanceName", values);
requestsDbClient.getOrchestrationFiltersFromInfraActive(requestMap);
}
Aggregations