title: Integration testing against an http server - junit?
body: <p>I want to to integration tests against an http server. So far I have only experiences with junit for unit testing.</p>
  
  <p>I have two requirements: The framework must have a maven plugin and the tests cases code must be clean - so no dirty hacks and no boilerplate code.</p>
  
  <p>Plain JUnit is good for unit testings, @Test methods are individual. But for integration testing I have to process several dependant steps which must exchange some kind of state (variables).</p>
  
  <p>I already read:</p>
  
  <p><a href="https://stackoverflow.com/questions/284774/can-we-use-junit-for-automated-integration-testing">Can we use JUNIT for Automated Integration Testing?</a> and <a href="https://stackoverflow.com/questions/3144887/passing-junit-data-between-tests">Passing JUnit data between tests</a> and came to the conclusion that I don't like static fields in unit test and I don't want to use TestNG and add dependency annotations on tests and I don't want to put my test into one long unreadable test method.</p>
  
  <p>I though more about some syntax like:</p>
  
  <pre><code>public class MyIntegrationTest() {
  
     @Step
     public void testCreate(Context context) {context.put("foo");}
  
     @Step
     public void testUpdate(Context context) {context.get();}
  
     @Step
     public void testDelete(Context context) {context.get()}
  
  }
  </code></pre>
  
  <p>So I want to enhance/use ?Unit in a way that it executes @Step methods with a context instance as argument. The methods must be called by the framework in order and cannot be called individually. In a perfect world, all ?Unit guis would show the @Step like an @Test but this is optional...</p>
  
  <p>Any hints how to do this?</p>
  
  <p>Jan</p>