use of org.onap.so.db.request.beans.InfraActiveRequests in project so by onap.
the class RequestsDbClientTest method checkInstanceNameDuplicateTest.
@Test
public void checkInstanceNameDuplicateTest() {
InfraActiveRequests infraActiveRequestsResponse = requestsDbClient.checkInstanceNameDuplicate(null, infraActiveRequests.getOperationalEnvName(), infraActiveRequests.getRequestScope());
verifyInfraActiveRequests(infraActiveRequestsResponse);
}
use of org.onap.so.db.request.beans.InfraActiveRequests in project so by onap.
the class RequestsDbClientTest method checkInstanceNameDuplicateViaTest.
@Test
public void checkInstanceNameDuplicateViaTest() {
Map<String, String> requestMap = new HashMap<>();
requestMap.put("operationalEnvironmentId", infraActiveRequests.getOperationalEnvId());
InfraActiveRequests infraActiveRequestsResponse = requestsDbClient.checkInstanceNameDuplicate((HashMap<String, String>) requestMap, null, infraActiveRequests.getRequestScope());
verifyInfraActiveRequests(infraActiveRequestsResponse);
}
use of org.onap.so.db.request.beans.InfraActiveRequests in project so by onap.
the class RequestsDbClientTest method getInProgressVolumeGroupsAndVfModulesTest.
@Test
public void getInProgressVolumeGroupsAndVfModulesTest() {
InfraActiveRequests request = new InfraActiveRequests();
request.setRequestId(UUID.randomUUID().toString());
request.setVfModuleId(UUID.randomUUID().toString());
request.setRequestStatus("IN_PROGRESS");
request.setRequestScope(ModelType.vfModule.toString());
Instant startInstant = Instant.now().minus(3, ChronoUnit.MINUTES);
request.setStartTime(Timestamp.from(startInstant));
request.setRequestAction("create");
requestsDbClient.save(request);
List<InfraActiveRequests> infraActiveRequests = requestsDbClient.getInProgressVolumeGroupsAndVfModules();
assertThat(request, sameBeanAs(infraActiveRequests.get(0)).ignoring("modifyTime"));
}
use of org.onap.so.db.request.beans.InfraActiveRequests in project so by onap.
the class RequestsDbClientTest method getInfraActiveRequestbyRequestIdWhereRequestUrlNullTest.
@Test
public void getInfraActiveRequestbyRequestIdWhereRequestUrlNullTest() {
// requestUrl setup to null and save
infraActiveRequests.setRequestUrl(null);
requestsDbClient.updateInfraActiveRequests(infraActiveRequests);
InfraActiveRequests infraActiveRequestsResponse = requestsDbClient.getInfraActiveRequestbyRequestId(infraActiveRequests.getRequestId());
verifyInfraActiveRequests(infraActiveRequestsResponse);
assertNull(infraActiveRequestsResponse.getRequestUrl());
}
use of org.onap.so.db.request.beans.InfraActiveRequests in project so by onap.
the class BBInputSetupUtils method getRequestDetails.
protected RequestDetails getRequestDetails(String requestId) throws IOException {
if (requestId != null && !requestId.isEmpty()) {
InfraActiveRequests activeRequest = this.getInfraActiveRequest(requestId);
String requestBody = activeRequest.getRequestBody().replaceAll("\\\\", "");
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
objectMapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
return objectMapper.readValue(requestBody, RequestDetails.class);
} else {
return null;
}
}
Aggregations