Junit CXF REST API and rollback test data
<p>I would like to write Junit test cases for REST API. The APIs are written using CXF framework.</p>

<p><strong>web.xml:</strong></p>

<pre><code>&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/api/*&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
</code></pre>

<p><strong>spring-config.xml:</strong></p>

<pre><code>&lt;jaxrs:server id="/SomeAction" address="/SomeAction" staticSubresourceResolution="true" publishedEndpointUrl="${endpointUrl}/SomeAction"&gt;
    &lt;jaxrs:serviceBeans&gt;
        &lt;ref bean="SomeWebService"&gt;&lt;/ref&gt;
    &lt;/jaxrs:serviceBeans&gt;
    &lt;jaxrs:providers&gt;
        &lt;ref bean="jsonProvider"&gt;&lt;/ref&gt;
        &lt;ref bean="exceptionMapper"&gt;&lt;/ref&gt;
    &lt;/jaxrs:providers&gt;

&lt;/jaxrs:server&gt;
</code></pre>

<p><strong>Webservice:</strong></p>

<pre><code>@Override
@POST
@Consumes("application/json")
@Produces("application/json")
@Path("/doSome")
public WSResponse doSome(WSRequest request) {
//Do Some operation
}
</code></pre>

<p><strong>Junit</strong></p>

<pre><code>@Test
public void testDoSome()
        throws Exception {
    mockMvc.perform(
            post("/SomeAction/doSome").contentType(contentType))
            .andExpect(status().isFound());
}
</code></pre>

<p>I can write Junit test cases for simple REST API and rollback the data after test is done using spring test. But I couldn't write when CXF framework is involved. I have two issues here.</p>

<ul>
<li><p>The above Junit code returns 404 response instead of 200.</p></li>
<li><p>I want to
   rollback the data when test is done</p></li>
</ul>

<p>Pleas help me to resolve the issues</p>