Package com.google.sitebricks.client

Examples of com.google.sitebricks.client.WebResponse.status()


    assertThat(url, endsWith("/pojo/1234"));
  }

  public void jsr303_single_validation_failed() {
    WebResponse response = post("");
    assertThat(response.status(), equalTo(HttpServletResponse.SC_OK));

    FormResponseJson res = response.to(FormResponseJson.class).using(Json.class);
    assertThat(res.isValid(), equalTo(false));

    List<FieldErrorJson> errors = res.getErrors();
View Full Code Here


    assertThat(url, is(nullValue()));
  }

  public void jsr303_multiple_validation_failed() {
    WebResponse response = post("?positive=-5");
    assertThat(response.status(), equalTo(HttpServletResponse.SC_OK));

    FormResponseJson res = response.to(FormResponseJson.class).using(Json.class);
    assertThat(res.isValid(), equalTo(false));

    List<FieldErrorJson> errors = res.getErrors();
View Full Code Here

    assertThat(url, is(nullValue()));
  }

  public void custom_validation_should_fail() {
    WebResponse response = post("?notNull=abc&positive=5&fail=true");
    assertThat(response.status(), equalTo(HttpServletResponse.SC_OK));

    FormResponseJson res = response.to(FormResponseJson.class).using(Json.class);
    assertThat(res.isValid(), equalTo(false));

    List<FieldErrorJson> errors = res.getErrors();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.