@Test(expectedExceptions = JmxConnectionException.class)
public void testBuildMBeanServerConnectionShouldThrowExceptionWhenMalformedUrl() throws IOException {

    //GIVEN
    given(urlFactory.createJmxServiceUrl(url)).willThrow(new MalformedURLException());
    //WHEN
    underTest.buildMBeanServerConnection(url);
    //THEN it should throw exception
}