@Test public void canGetCurrentTransUnitId() { selectedTU = currentPageRows.get(0); presenter.setStatesForTesting(selectedTU.getId(), 0, display); TransUnitId result = presenter.getCurrentTransUnitIdOrNull(); assertThat(result, Matchers.sameInstance(selectedTU.getId())); }
private static void assertTestExceptionThrown(AtomicReference<?>... refs) { for (AtomicReference<?> ref : refs) assertThat("ExecutionException expected", ref.get(), instanceOf(ExecutionException.class)); for (AtomicReference<?> ref : refs) assertThat( "TEST_EXCEPTION expected as cause", ((Throwable) ref.get()).getCause(), Matchers.<Throwable>sameInstance(THROW_TEST_EXCEPTION)); }
@Test public void canGetNewTargets() { selectedTU = currentPageRows.get(0); when(display.getNewTargets()).thenReturn(NEW_TARGETS); presenter.setStatesForTesting(selectedTU.getId(), 0, display); List<String> result = presenter.getNewTargets(); MatcherAssert.assertThat(result, Matchers.sameInstance(NEW_TARGETS)); }