1 Reply Latest reply on Apr 14, 2014 5:53 AM by nilspreusker

    Multi-module maven project with multiple WARs

    nilspreusker

      Hi, I have a conceptual question about testing a multi-module maven project with multiple WARs that interact via REST.

       

      Let's picture a simple demo use-case where we have two WARs, war-1 and war-2. War-1 provides a REST API:

       

      * HTTP POST /war-1/rest/war1

       

      When this is called, in turn it makes a REST call to war-2:

       

      * HTTP POST /war-2/rest/war2

       

      ...when the call is successful, both APIs return HTTP 201 created and a location header.

       

      How would I go about writing a test case for this in terms of deployments?

       

      Options I considered so far:

      * single WAR deployment, mocking war2's REST API

      * adding a third integration-test module to the parent project, creating both deployments and the test case there (here I'm not sure what would be the best way to create the deployments, maybe someone can provide an example)

       

      Which approach would you recommend or is there another one that I haven't considered?

       

      Thanks in advanced, any thoughts on this are greatly appreciated!

       

      Cheers,

      Nils