use of org.onap.so.db.catalog.beans.ProcessingFlags in project so by onap.
the class CatalogDbAdapterRest method getAllProcessingFlagsImpl.
public Response getAllProcessingFlagsImpl() {
List<ProcessingFlags> processingFlags = null;
int respStatus = HttpStatus.SC_OK;
try {
processingFlags = processingFlagsRepo.findAll();
if (processingFlags == null) {
logger.debug("ProcessingFlags not found");
respStatus = HttpStatus.SC_NOT_FOUND;
} else {
logger.debug("ProcessingFlags processingFlags = {}", processingFlags.toString());
}
return Response.status(respStatus).entity(processingFlags).header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).build();
} catch (Exception e) {
logger.error("Exception - queryProcesssingFlags", e);
CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR).entity(new GenericEntity<CatalogQueryException>(excResp) {
}).build();
}
}
use of org.onap.so.db.catalog.beans.ProcessingFlags in project so by onap.
the class CatalogDbClientTest method testGetProcessingFlagsFromFlag.
@Test
public void testGetProcessingFlagsFromFlag() {
ProcessingFlags processingFlags = client.findProcessingFlagsByFlag("TESTFLAG");
assertNotNull(processingFlags);
assertEquals(processingFlags.getEndpoint(), "TESTENDPOINT");
}
use of org.onap.so.db.catalog.beans.ProcessingFlags in project so by onap.
the class ProcessingFlagsRepositoryTest method findByFlagTest.
@Test
public void findByFlagTest() throws Exception {
ProcessingFlags processingFlags = processingFlagsRepository.findByFlag("TESTFLAG");
Assert.assertNotNull(processingFlags);
Assert.assertEquals("TESTENDPOINT", processingFlags.getEndpoint());
}
Aggregations