public static CookieBuilder newCookieBuilder(HttpRequest request) {
    return new CookieBuilder(request);
  }
@Test
  public void create_cookie_when_web_context() {
    when(request.getContextPath()).thenReturn("/sonarqube");
    Cookie cookie = newCookieBuilder(request).setName("name").setValue("value").setHttpOnly(true).setExpiry(10).build();
    assertThat(cookie.getName()).isEqualTo("name");
    assertThat(cookie.getValue()).isEqualTo("value");
    assertThat(cookie.isHttpOnly()).isTrue();
    assertThat(cookie.getMaxAge()).isEqualTo(10);
    assertThat(cookie.isSecure()).isFalse();
    assertThat(cookie.getPath()).isEqualTo("/sonarqube");
  }