@Test
public void testCycleElasticsearchUrlsBasicAuth() throws Exception {

	CorePlugin corePlugin = ConfigurationRegistry.builder()
			.addOptionProvider(new CorePlugin())
			.addConfigSource(new SimpleSource("test")
					.add("stagemonitor.reporting.elasticsearch.url", "http://bla:1/,http://other:p%21p@bla:2,https://bla:3,http://bla:4/search")
					.add("stagemonitor.reporting.elasticsearch.username", "user")
					.add("stagemonitor.reporting.elasticsearch.password", "p@ssword!"))
			.build()
			.getConfig(CorePlugin.class);
	URL cycle1 = corePlugin.getElasticsearchUrl();
	String basicAuth = HttpClient.getBasicAuthFromUserInfo(cycle1);
	String testBasicAuth = "Basic " + DatatypeConverter.printBase64Binary("user:p@ssword!".getBytes());
	assertThat(basicAuth).isEqualTo(testBasicAuth);
	assertThat(cycle1.toString()).isEqualTo("http://user:p%40ssword%21@bla:1");
	URL cycle2 = corePlugin.getElasticsearchUrl();
	String basicAuthCycle2 = HttpClient.getBasicAuthFromUserInfo(cycle2);
	String testBasicAuthCycle2 = "Basic " + DatatypeConverter.printBase64Binary("other:p!p".getBytes());
	assertThat(basicAuth).isEqualTo(testBasicAuth);
	assertThat(cycle2.toString()).isEqualTo("http://other:p%21p@bla:2");
	assertThat(corePlugin.getElasticsearchUrl().toString()).isEqualTo("https://user:p%40ssword%21@bla:3");
	assertThat(corePlugin.getElasticsearchUrl().toString()).isEqualTo("http://user:p%40ssword%21@bla:4/search");
	assertThat(corePlugin.getElasticsearchUrl().toString()).isEqualTo("http://user:p%40ssword%21@bla:1");
	assertThat(corePlugin.getElasticsearchUrl().toString()).isEqualTo("http://other:p%21p@bla:2");
	assertThat(corePlugin.getElasticsearchUrl().toString()).isEqualTo("https://user:p%40ssword%21@bla:3");
	assertThat(corePlugin.getElasticsearchUrl().toString()).isEqualTo("http://user:p%40ssword%21@bla:4/search");
}