private void abstractTestListOptionsProblem(final Class<?> exceptionType) throws Exception { FSMenuService service = createMockedService(exceptionType); try { service.listOptions(); fail("listOptions shouldn't succeed"); } catch (MenuServiceException e) { assertNotNull("e shouldn't be null", e); Throwable cause = e.getCause(); assertNotNull("cause shouldn't be null", cause); assertTrue("cause should be a " + exceptionType.getName(), cause.getClass().equals(exceptionType)); } }
@Test public void testListOptionsOK() throws Exception { FSMenuService service = new FSMenuService(); List<MenuOptionDescription> options = service.listOptions(); assertNotNull("options shouldn't be null", options); assertFalse("options shouldn't be empty", options.isEmpty()); } @Test
@Test public void testListOptionsOK() throws Exception { FSMenuService service = new FSMenuService(); List<MenuOptionDescription> options = service.listOptions(); assertNotNull("options shouldn't be null", options); assertFalse("options shouldn't be empty", options.isEmpty()); } @Test
private void abstractTestListOptionsProblem(final Class<?> exceptionType) throws Exception { FSMenuService service = createMockedService(exceptionType); try { service.listOptions(); fail("listOptions shouldn't succeed"); } catch (MenuServiceException e) { assertNotNull("e shouldn't be null", e); Throwable cause = e.getCause(); assertNotNull("cause shouldn't be null", cause); assertTrue("cause should be a " + exceptionType.getName(), cause.getClass().equals(exceptionType)); } }