Search in sources :

Example 1 with ClientRequestContextWrapper

use of brave.jaxrs2.TracingClientFilter.ClientRequestContextWrapper in project brave by openzipkin.

the class ClientRequestContextWrapperTest method url.

@Test
public void url() {
    when(request.getUri()).thenReturn(URI.create("http://localhost/api"));
    assertThat(new ClientRequestContextWrapper(request).url()).isEqualTo("http://localhost/api");
}
Also used : ClientRequestContextWrapper(brave.jaxrs2.TracingClientFilter.ClientRequestContextWrapper) Test(org.junit.Test)

Example 2 with ClientRequestContextWrapper

use of brave.jaxrs2.TracingClientFilter.ClientRequestContextWrapper in project brave by openzipkin.

the class ClientRequestContextWrapperTest method path_emptyToSlash.

// NOTE: While technically possible, it is not easy to make URI.getPath() return null!
@Test
public void path_emptyToSlash() {
    when(request.getUri()).thenReturn(URI.create("http://localhost"));
    assertThat(new ClientRequestContextWrapper(request).path()).isEqualTo("/");
}
Also used : ClientRequestContextWrapper(brave.jaxrs2.TracingClientFilter.ClientRequestContextWrapper) Test(org.junit.Test)

Example 3 with ClientRequestContextWrapper

use of brave.jaxrs2.TracingClientFilter.ClientRequestContextWrapper in project brave by openzipkin.

the class ClientRequestContextWrapperTest method path.

@Test
public void path() {
    when(request.getUri()).thenReturn(URI.create("http://localhost/api"));
    assertThat(new ClientRequestContextWrapper(request).path()).isEqualTo("/api");
}
Also used : ClientRequestContextWrapper(brave.jaxrs2.TracingClientFilter.ClientRequestContextWrapper) Test(org.junit.Test)

Example 4 with ClientRequestContextWrapper

use of brave.jaxrs2.TracingClientFilter.ClientRequestContextWrapper in project brave by openzipkin.

the class ClientRequestContextWrapperTest method method.

@Test
public void method() {
    when(request.getMethod()).thenReturn("GET");
    assertThat(new ClientRequestContextWrapper(request).method()).isEqualTo("GET");
}
Also used : ClientRequestContextWrapper(brave.jaxrs2.TracingClientFilter.ClientRequestContextWrapper) Test(org.junit.Test)

Example 5 with ClientRequestContextWrapper

use of brave.jaxrs2.TracingClientFilter.ClientRequestContextWrapper in project brave by openzipkin.

the class ClientRequestContextWrapperTest method header.

@Test
public void header() {
    when(request.getHeaderString("name")).thenReturn("value");
    assertThat(new ClientRequestContextWrapper(request).header("name")).isEqualTo("value");
}
Also used : ClientRequestContextWrapper(brave.jaxrs2.TracingClientFilter.ClientRequestContextWrapper) Test(org.junit.Test)

Aggregations

ClientRequestContextWrapper (brave.jaxrs2.TracingClientFilter.ClientRequestContextWrapper)6 Test (org.junit.Test)6 Headers (org.jboss.resteasy.core.Headers)1