ErrorPopup { protected void onDetail() { boolean detailCollapsed = view.isDetailCollapsed(); view.setCollapseDetailIcon(!detailCollapsed); if (detailCollapsed) { view.setDetailLabel(view.getCloseDetailLabel()); } else { view.setDetailLabel(view.getShowDetailLabel()); } } @Inject  ErrorPopup(final View view); @PostConstruct void init(); void showError(final String message); void showError(final String message,
                          final DisplayMode displayMode); void showError(final String message,
                          final String detail); void showError(final String message,
                          final String detail,
                          final DisplayMode displayMode);  }
@Test public void testOnDetailWhenDetailCollapsed() { when(view.isDetailCollapsed()).thenReturn(true); popup.onDetail(); verify(view, times(1)).setCollapseDetailIcon(false); verify(view, times(1)).setDetailLabel(CLOSE_DETAIL_LABEL); }
@Test public void testOnDetailWhenDetailNotCollapsed() { when(view.isDetailCollapsed()).thenReturn(false); popup.onDetail(); verify(view, times(1)).setCollapseDetailIcon(true); verify(view, times(1)).setDetailLabel(SHOW_DETAIL_LABEL); }