0 Replies Latest reply on Aug 3, 2013 10:53 AM by Adrian Cole

    black box testing with mocked backends

    Adrian Cole Newbie

      Hi, all.


      I have an application at netflix I'm testing with arquillian using @RunAsClient.  The web app I'm testing makes outgoing calls that correspond with the rest calls I issue via the @ArquillianResource.  What I'd like to do is setup a MockWebServer for each test method, which populates backend http expectations for each testcase.   I suspect there's a better approach, so ideas welcome!





          protected URL deploymentUrl;


          public void getNetworkStatusImpliesBackendCall() throws Exception {

              MockWebServer backend = new MockWebServer();

              backend.enqueue(new MockResponse().setResponseCode(200).setBody(getNeustarNetworkStatusResponse));



              // glitch here.. how do I send this to the web app cleanly..

              // particularly as the object will be different for each test




              try {

                  assertEquals(check(deploymentUrl), NetworkStatus.GOOD);


                  assertEquals(new String(server.takeRequest().getBody()), getNeustarNetworkStatus);

              } finally {