@Test
public void should_get_connection() throws Exception {

    SonarConnection mockedConnection = new SonarConnection();
    when(sonarConnectionFactory.create(anyString(), anyString(), anyString())).thenReturn(mockedConnection);
    SonarConnection connection = sonar.getConnection(new URL("http://url"), new HashMap<String, String>());
    assertEquals(mockedConnection, connection);
}