Package com.google.sitebricks.client

Examples of com.google.sitebricks.client.WebResponse


        Person person = new Person();
        person.setFirstName("firstName");
        person.setLastName("lastName");
        person.setAge(20);

        WebResponse response = createInjector().getInstance(Web.class)
                .clientOf(AcceptanceTest.baseUrl() + "/restvalidatingdao")
                .transports(Person.class).over(Json.class).get();

        assert response.toString().contains(person.getLastName());

    }
View Full Code Here


        Person person = new Person();
        person.setFirstName("firstName");
        person.setLastName("lastName");
        person.setAge(20);

        WebResponse response = createInjector().getInstance(Web.class)
                .clientOf(AcceptanceTest.baseUrl() + "/restvalidatingdao")
                .transports(Person.class).over(Json.class).post(person);

        assert response.toString().contains(person.getLastName());

    }
View Full Code Here

        Person person = new Person();
        person.setFirstName(null);
        person.setLastName("lastName");
        person.setAge(20);

        WebResponse response = createInjector().getInstance(Web.class)
                .clientOf(AcceptanceTest.baseUrl() + "/restvalidatingdao")
                .transports(Person.class).over(Json.class).post(person);

        assert response.toString().contains("constraintViolationNullFirstName");

    }
View Full Code Here

 
 
  public void update() {
    String url = AcceptanceTest.baseUrl() + BASE_SERVICE_PATH  + "/1";
    System.out.println("PUT " + url);
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(url)
        .transports(String.class)
        .over(Json.class)
        .put("");

    assert UPDATE.equals(response.toString());
  }
View Full Code Here

  }

  public void delete() {
    String url = AcceptanceTest.baseUrl() + BASE_SERVICE_PATH  + "/1";
    System.out.println("DELETE " + url);
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(url)
        .transports(String.class)
        .over(Json.class)
        .delete();

    assert DELETE.equals(response.toString());
  }
View Full Code Here

*/
@Test(suiteName = AcceptanceTest.SUITE)
public class SpiRestfuWebServiceWithCRUDAcceptanceTest {

  public void shouldServiceReadCollection() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/issue")
        .transports(String.class)
        .over(Json.class)
        .get();

    assert "READ_COLLECTION".equals(response.toString());
  }
View Full Code Here

    assert "READ_COLLECTION".equals(response.toString());
  }

  public void shouldServiceCreate() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/issue")
        .transports(String.class)
        .over(Json.class)
        .post("");

    assert "CREATE".equals(response.toString()) : response.toString();
 
View Full Code Here

    assert "CREATE".equals(response.toString()) : response.toString();
 
 
  public void shouldServiceRead() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/issue/0")
        .transports(String.class)
        .over(Json.class)
        .get();

    assert "READ".equals(response.toString());
  }
View Full Code Here

    assert "READ".equals(response.toString());
  }
 
  public void shouldServiceUpdate() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/issue/0")
        .transports(String.class)
        .over(Json.class)
        .put("");

    assert "UPDATE".equals(response.toString()) : response.toString();
  }
View Full Code Here

    assert "UPDATE".equals(response.toString()) : response.toString();
  }
 
  public void shouldServiceDelete() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/issue/0")
        .transports(String.class)
        .over(Json.class)
        .delete();

    assert "DELETE".equals(response.toString()) : response.toString();
  }
View Full Code Here

TOP

Related Classes of com.google.sitebricks.client.WebResponse

Copyright © 2018 www.massapicom. 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.