@Test
public void testUriRewrite() throws URISyntaxException {

    assertThat(rewrite(new URI("eureka://myservice:7001"), INSTANCE_1)).isEqualTo(new URI("http://1.0.0.1:7001"));
    assertThat(rewrite(new URI("eureka://myservice:7001/mypath?k=v"), INSTANCE_1)).isEqualTo(new URI("http://1.0.0.1:7001/mypath?k=v"));
    assertThat(rewrite(new URI("eureka://myservice:7001?secure=true"), INSTANCE_1)).isEqualTo(new URI("https://1.0.0.1:7001?secure=true"));
    assertThat(rewrite(new URI("eureka://myservice:7001/mypath?k=v&secure=true"), INSTANCE_1)).isEqualTo(new URI("https://1.0.0.1:7001/mypath?k=v&secure=true"));
}