Package by.stub.yaml.stubs

Examples of by.stub.yaml.stubs.StubRequest


         .withStatus("200")
         .withLiteralBody("This is a response for 555").build();

      loadYamlToDataStore(yaml);

      final StubRequest assertingRequest =
         REQUEST_BUILDER
            .withUrl(url)
            .withMethodGet()
            .withHeaders(StubRequest.AUTH_HEADER, "Basic BadCredentials").build();
View Full Code Here


         .withStatus("200")
         .withLiteralBody("This is a response for 555").build();

      loadYamlToDataStore(yaml);

      final StubRequest assertingRequest =
         REQUEST_BUILDER
            .withUrl(url)
            .withMethodGet()
            .withHeaders(StubRequest.AUTH_HEADER, null).build();
View Full Code Here

         .withStatus("200")
         .withLiteralBody("This is a response for 125").build();

      loadYamlToDataStore(yaml);

      final StubRequest assertingRequest =
         REQUEST_BUILDER
            .withUrl("/invoice/300")
            .withMethodGet().build();

      final StubResponse foundStubResponse = stubbedDataManager.findStubResponseFor(assertingRequest);
View Full Code Here

         .withStatus(expectedStatus)
         .withLiteralBody(expectedBody).build();

      loadYamlToDataStore(yaml);

      final StubRequest assertingRequest =
         REQUEST_BUILDER
            .withUrl(url)
            .withMethodPost()
            .withPost(postData).build();
View Full Code Here

         .withStatus("503")
         .withLiteralBody("This is a response for 567").build();

      loadYamlToDataStore(yaml);

      final StubRequest assertingRequest =
         REQUEST_BUILDER
            .withUrl(url)
            .withMethodPost().build();

      final StubResponse foundStubResponse = stubbedDataManager.findStubResponseFor(assertingRequest);
View Full Code Here

         .withStatus("503")
         .withLiteralBody("This is a response for 567").build();

      loadYamlToDataStore(yaml);

      final StubRequest assertingRequest =
         REQUEST_BUILDER
            .withUrl(url)
            .withMethodPost().build();

      final StubResponse foundStubResponse = stubbedDataManager.findStubResponseFor(assertingRequest);
View Full Code Here

         .withStatus("503")
         .withLiteralBody("This is a response for 567").build();

      loadYamlToDataStore(yaml);

      final StubRequest assertingRequest =
         REQUEST_BUILDER
            .withUrl(url)
            .withMethodPost()
            .withPost(postData).build();
View Full Code Here

         .withFoldedBody(expectedBody)
         .withHeaders("content-type", "application/json").build();

      loadYamlToDataStore(yaml);

      final StubRequest assertingRequest =
         REQUEST_BUILDER
            .withUrl(url)
            .withMethodGet()
            .withQuery("type_name", "user")
            .withQuery("client_id", "id")
View Full Code Here

      when(mockHttpServletRequest.getQueryString())
         .thenReturn(
            "type_name=user&client_id=id&client_secret=secret&attributes=[%22id%22,%22uuid%22,%22created%22,%22lastUpdated%22,%22displayName%22,%22email%22,%22givenName%22,%22familyName%22]"
         );

      final StubRequest assertingRequest = StubRequest.createFromHttpServletRequest(mockHttpServletRequest);

      final StubResponse foundStubResponse = stubbedDataManager.findStubResponseFor(assertingRequest);

      assertThat(foundStubResponse).isNotInstanceOf(NotFoundStubResponse.class);
      assertThat(foundStubResponse).isInstanceOf(StubResponse.class);
View Full Code Here

      when(mockHttpServletRequest.getQueryString())
         .thenReturn(
            "type_name=user&client_id=id&client_secret=secret&attributes=[%22NOMATCH%22,%22uuid%22,%22created%22,%22lastUpdated%22,%22displayName%22,%22email%22,%22givenName%22,%22familyName%22]"
         );

      final StubRequest assertingRequest = StubRequest.createFromHttpServletRequest(mockHttpServletRequest);
      final StubResponse foundStubResponse = stubbedDataManager.findStubResponseFor(assertingRequest);

      assertThat(foundStubResponse).isInstanceOf(NotFoundStubResponse.class);
      assertThat(StubResponseTypes.NOTFOUND).isSameAs(foundStubResponse.getStubResponseType());
View Full Code Here

TOP

Related Classes of by.stub.yaml.stubs.StubRequest

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.