@Test
public void should_resolve_url_with_default_provider() throws NoSuchFieldException, MalformedURLException {

    try {
        System.setProperty("urlvar", "http://www.arquillian.org");
        EnvironmentUrlResourceProvider environmentUrlResourceProvider = new EnvironmentUrlResourceProvider();
        environmentUrlResourceProvider.algeronProviderConfigurationInstance = () -> {
            final HashMap<String, String> config = new HashMap<>();
            config.put("skipDeployment", "false");
            return AlgeronProviderConfiguration.fromMap(config);
        };
        when(injector.inject(Matchers.any())).thenReturn(urlResourceProvider);
        when(urlResourceProvider.doLookup(Matchers.any(), Matchers.any())).thenReturn(new URL("http://mocked.org"));
        environmentUrlResourceProvider.injectorInstance = () -> injector;
        final Field urlField = TestWithFieldEnricher.class.getField("url");
        final Object url = environmentUrlResourceProvider.doLookup(urlField.getAnnotation(ArquillianResource.class),
            urlField.getAnnotation(Environment.class));
        assertThat(url).isInstanceOf(URL.class);
        URL urlObject = (URL) url;
        assertThat(urlObject).hasHost("mocked.org");
    } finally {
        System.clearProperty("urlvar");
    }
}