Package com.google.sitebricks.client

Examples of com.google.sitebricks.client.WebResponse


    assert "delete:junk_more_junk_most_junk".equals(response.toString()) : response.toString();
  }

  public void shouldServiceThreeLevelDynamicPathWithPutMethod() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/superpath2/junk/more_junk/most_junk")
        .transports(String.class)
        .over(Json.class)
        .put("");

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


    assert "put:junk_more_junk_most_junk".equals(response.toString()) : response.toString();
  }

  public void shouldServiceThreeLevelDynamicPathWithPostMethod() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/superpath2/junk/more_junk/most_junk")
        .transports(String.class)
        .over(Json.class)
        .post("");

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

    assert "post:junk_more_junk_most_junk".equals(response.toString()) : response.toString();
  }

  public void shouldServiceThreeLevelDynamicPathWithGetMethod() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/superpath2/junk/more_junk/most_junk")
        .transports(String.class)
        .over(Json.class)
        .get();

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

public class RestfuWebServiceWithCRUDAcceptanceTest {

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

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

  }

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

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

 

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

    assert READ_INDIVIDUAL.equals(response.toString()) : response.toString();
 
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() + "/restvalidating")
                .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() + "/restvalidating")
                .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() + "/restvalidating")
                .transports(Person.class).over(Json.class).post(person);

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

    }
View Full Code Here

import org.browsermob.core.har.Har;

public class Test {
    public static void main(String[] args) {
        Injector injector = Guice.createInjector(new SitebricksModule());
        WebResponse response = injector.getInstance(Web.class)
                .clientOf("http://localhost:8080/proxy/9091/har")
                .transports(Har.class)
                .over(Json.class).get();
        Har har = response.to(Har.class).using(Json.class);
        System.out.println(har.getLog().getBrowser().getName());
    }
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.