use of com.hortonworks.streamline.common.CollectionResponse in project streamline by hortonworks.
the class NotifierInfoCatalogResourceTest method testListNotifiers.
@Test
public void testListNotifiers() {
final Notifier notifier = new Notifier();
final QueryParam expectedQp = new QueryParam("notifierName", "email_notifier_1");
multiValuedMap.putSingle("notifierName", "email_notifier_1");
new Expectations() {
{
mockUriInfo.getQueryParameters();
times = 1;
result = multiValuedMap;
mockCatalogService.listNotifierInfos(Arrays.asList(expectedQp));
times = 1;
result = Arrays.asList(notifier);
}
};
CollectionResponse collectionResponse = (CollectionResponse) resource.listNotifiers(mockUriInfo, securityContext).getEntity();
assertEquals(1, collectionResponse.getEntities().size());
assertEquals(notifier, collectionResponse.getEntities().iterator().next());
}
Aggregations