Search in sources :

Example 11 with Notifier

use of com.hortonworks.streamline.streams.catalog.Notifier in project streamline by hortonworks.

the class StreamCatalogService method removeNotifierInfo.

public Notifier removeNotifierInfo(Long notifierId) {
    Notifier notifier = new Notifier();
    notifier.setId(notifierId);
    return dao.remove(new StorableKey(NOTIFIER_INFO_NAMESPACE, notifier.getPrimaryKey()));
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) Notifier(com.hortonworks.streamline.streams.catalog.Notifier)

Example 12 with Notifier

use of com.hortonworks.streamline.streams.catalog.Notifier in project streamline by hortonworks.

the class NotifierInfoCatalogResourceTest method testGetNotifierById.

@Test
public void testGetNotifierById() throws Exception {
    final Notifier notifier = new Notifier();
    new Expectations() {

        {
            mockCatalogService.getNotifierInfo(anyLong);
            times = 1;
            result = notifier;
        }
    };
    Notifier result = (Notifier) resource.getNotifierById(1L, securityContext).getEntity();
    assertEquals(notifier, result);
}
Also used : Expectations(mockit.Expectations) Notifier(com.hortonworks.streamline.streams.catalog.Notifier) Test(org.junit.Test)

Aggregations

Notifier (com.hortonworks.streamline.streams.catalog.Notifier)12 Timed (com.codahale.metrics.annotation.Timed)5 Path (javax.ws.rs.Path)5 Expectations (mockit.Expectations)3 Test (org.junit.Test)3 QueryParam (com.hortonworks.registries.common.QueryParam)2 StorableKey (com.hortonworks.registries.storage.StorableKey)2 UnsupportedMediaTypeException (com.hortonworks.streamline.common.exception.service.exception.request.UnsupportedMediaTypeException)2 Consumes (javax.ws.rs.Consumes)2 GET (javax.ws.rs.GET)2 MediaType (javax.ws.rs.core.MediaType)2 CollectionResponse (com.hortonworks.streamline.common.CollectionResponse)1 Permission (com.hortonworks.streamline.streams.security.Permission)1 DELETE (com.hortonworks.streamline.streams.security.Permission.DELETE)1 DELETE (javax.ws.rs.DELETE)1 POST (javax.ws.rs.POST)1 PUT (javax.ws.rs.PUT)1 Produces (javax.ws.rs.Produces)1 StreamingOutput (javax.ws.rs.core.StreamingOutput)1