Package se.dannej.fakehttpserver.expect

Examples of se.dannej.fakehttpserver.expect.Expectations


    server.stop();
  }
 
  @Test
  public void delegatesRequestsToAddedHandlers() {
    new Expectations() {{
      oneOf(server).post();
        will(sendStatus(200));
    }};
   
    server.start();
View Full Code Here


    assertThat(response, hasStatus(200));
  }
 
  @Test
  public void isSatisfiedReturnsTrueWhenExpectationsAreMet() {
    new Expectations() {{
      oneOf(server).post();
    }};
     
    server.start();
   
View Full Code Here

 
  @Test
  public void allowsMoreThanOneExpectationAssertingContent() {
    final String expectedContent = "content-match";
   
    new Expectations() {{
      allowing(server).post().with(content("content-mismatch"));
        will(sendStatus(200));
      oneOf(server).post().with(content(expectedContent));
        will(sendStatus(200));
    }};
View Full Code Here

  }
 
  @Test
  public void exactlyOnePost() {

    new Expectations() {{
      oneOf(server).post();
    }};
   
    caller.resource().post();
  }
View Full Code Here

  }
 
  @Test
  public void exactlyOneGet() {

    new Expectations() {{
      oneOf(server).get();
    }};
   
    caller.resource().get(ClientResponse.class);
  }
View Full Code Here

  }

  @Test
  public void exactlyOneHead() {

    new Expectations() {{
      oneOf(server).head();
    }};
   
    caller.resource().head();
  }
View Full Code Here

  }

  @Test
  public void exactlyOnePut() {

    new Expectations() {{
      oneOf(server).put();
    }};
   
    caller.resource().put();
  }
View Full Code Here

  }
 
  @Test
  public void exactlyOneOptions() {

    new Expectations() {{
      oneOf(server).options();
    }};
   
    caller.resource().options(ClientResponse.class);
  }
View Full Code Here

  }

  @Test
  public void exactlyOneDelete() {

    new Expectations() {{
      oneOf(server).delete();
    }};
   
    caller.resource().delete();
  }
View Full Code Here

  }
 
  @Test
  public void executesGivenResponseActionsForGivenExpectations() {

    new Expectations() {{
      oneOf(server).post().with(path(EXPECTED_PATH), contentType(CONTENT_TYPE), content(CONTENT));
        will(
          sendContentType(CONTENT_TYPE),
          sendContent("[1]"));
    }};
View Full Code Here

TOP

Related Classes of se.dannej.fakehttpserver.expect.Expectations

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.