Search in sources :

Example 6 with ProcessingFlags

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();
    }
}
Also used : ProcessingFlags(org.onap.so.db.catalog.beans.ProcessingFlags) CatalogQueryException(org.onap.so.adapters.catalogdb.catalogrest.CatalogQueryException) CatalogQueryException(org.onap.so.adapters.catalogdb.catalogrest.CatalogQueryException)

Example 7 with ProcessingFlags

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");
}
Also used : ProcessingFlags(org.onap.so.db.catalog.beans.ProcessingFlags) Test(org.junit.Test) CatalogDbAdapterBaseTest(org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest)

Example 8 with ProcessingFlags

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());
}
Also used : ProcessingFlags(org.onap.so.db.catalog.beans.ProcessingFlags) BaseTest(org.onap.so.db.catalog.BaseTest) Test(org.junit.Test)

Aggregations

ProcessingFlags (org.onap.so.db.catalog.beans.ProcessingFlags)8 Test (org.junit.Test)5 CatalogDbAdapterBaseTest (org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest)4 CatalogQueryException (org.onap.so.adapters.catalogdb.catalogrest.CatalogQueryException)3 HttpEntity (org.springframework.http.HttpEntity)3 UriComponentsBuilder (org.springframework.web.util.UriComponentsBuilder)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 List (java.util.List)1 BaseTest (org.onap.so.db.catalog.BaseTest)1