Ejemplo n.º 1
0
 @Test
 public void find_NotVisibleCatalogItem_ShouldThrowForbiddenException() {
   try {
     instance.filterVisible(new Catalog(), null);
     fail("should have thrown ex");
   } catch (WebApplicationException e) {
     assertEquals(Response.Status.FORBIDDEN, e.getResponse().getStatusInfo());
   }
 }
Ejemplo n.º 2
0
 @Test
 public void find_NullCatalogItem_ShouldThrowNotFoundException() {
   try {
     instance.filterVisible(null, null);
     fail("should have thrown ex");
   } catch (WebApplicationException e) {
     assertEquals(Response.Status.NOT_FOUND, e.getResponse().getStatusInfo());
   }
 }
Ejemplo n.º 3
0
 @Test
 public void find_VisibleCatalogItem_ShouldReturnExpectedProduct() {
   assertThat(instance.filterVisible(visibleCatalogItem, null)).isEqualTo(visibleCatalogItem);
 }