@Test
public void shouldReturnUndefinedForException() throws InvalidSyntaxException {

    when(bundleContext.getAllServiceReferences(ORG_OSGI_SERVICE_HTTP_SERVICE, null))
            .thenThrow(new InvalidSyntaxException(null, null));
    int undfinedPort = HttpServiceUtil.getHttpServicePort(bundleContext);
    assertThat(undfinedPort, is(-1));
}