@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()); } }
@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()); } }
@Test public void find_VisibleCatalogItem_ShouldReturnExpectedProduct() { assertThat(instance.filterVisible(visibleCatalogItem, null)).isEqualTo(visibleCatalogItem); }