/** * Returns the requested path. * * @return the path being requested */ public String path() { return url.path(); }
/** * @return the request URL path component */ public String path() { return url.path(); }
/** * Returns the requested path. * * @return the path being requested */ public String path() { return url.path(); }
/** * Returns the requested path. * * @return the path being requested */ public String path() { return url.path(); }
/** * @return the request URL path component */ public String path() { return url.path(); }
@Test public void transformsUri() { LiveHttpRequest request = LiveHttpRequest.get("/x").build() .newBuilder() .uri("/y") .build(); assertEquals(request.url().path(), "/y"); }
@Test public void canModifyPreviouslyCreatedRequest() { LiveHttpRequest request = get("/foo") .header("remove", "remove") .build(); LiveHttpRequest newRequest = request.newBuilder() .uri("/home") .header("remove", "notanymore") .build(); assertThat(newRequest.url().path(), is("/home")); assertThat(newRequest.headers(), hasItem(header("remove", "notanymore"))); }
@Test public void transformsRequest() { HttpRequest request = get("/foo") .header("remove", "remove") .build(); HttpRequest newRequest = request.newBuilder() .method(DELETE) .uri("/home") .header("remove", "notanymore") .build(); assertThat(newRequest.method(), is(DELETE)); assertThat(newRequest.url().path(), is("/home")); assertThat(newRequest.headers(), hasItem(header("remove", "notanymore"))); }
@Test public void transformsUrl() { LiveHttpRequest request = LiveHttpRequest.get("/").build() .newBuilder() .url(url("/z").build()) .build(); assertEquals(request.url().path(), "/z"); }