@Test public void testConnectionURLChange() { when(view.getConnectionURL()).thenReturn(CONNECTION_URL); // emulates the presenter method executed from the UI. mainPanel.onConnectionURLChange(); verify(view, times(1)).getConnectionURL(); // the handler should have been invoked and collected the expected value. assertEquals(CONNECTION_URL, connectionURL); }
@Test public void testGetConnectionURL() { when(view.getConnectionURL()).thenReturn(CONNECTION_URL); assertEquals(CONNECTION_URL, mainPanel.getConnectionURL()); }