<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=cbeams" rel="nofollow">Chris Beams</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5879?redirect=false" rel="nofollow">SPR-5879</a></strong> and commented</p>
<p dir="auto">Some, but not all of the functionality available in <code class="notranslate">AbstractTransactionalSpringContextTests</code> is currently available in the TestContext framework.</p>
<p dir="auto">Notably missing is support for <code class="notranslate">setComplete()</code>, <code class="notranslate">endTransaction()</code>, and <code class="notranslate">startNewTransaction()</code> methods.</p>
<p dir="auto">Since these methods ultimately manipulate thread-bound resources, it should be possible to provide equivalent support through static methods on utility class that ships as part of the TestContext support.</p>
<hr>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398090331" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9753" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9753/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9753">#9753</a> Support programmatic starting and stopping of transactions in the TestContext framework (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto">1 votes, 1 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=p_d_austin" rel="nofollow">Paul Austin</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6993?redirect=false" rel="nofollow">SPR-6993</a></strong> and commented</p>
<p dir="auto">At the moment the AnnotationMethodHandlerAdaptor only uses a simple approach to content negotiation for RequestBody and ResponseBody parameters using the Accept and Content-type headers.</p>
<p dir="auto">It would be useful if additional content negotiation, such as using file name extensions, request parameter and a default media type were also provided. This is similar to the approach provided by the ContentNegotiatingViewResolver for views.</p>
<p dir="auto">I have implemented an example implementation if you'd like to use that as a basis for the implementation.</p>
<p dir="auto">Look at the ServletHandlerMethodInvoker.handleResponseBodyMethod and the ServletHandlerMethodInvoker.resolveRequestBody. You'll see it uses a MediaTypeUtils class to get all the possible accepted media types.</p>
<p dir="auto">The MediaTypeUtils uses the mediaTypeOrder field to decide which order the content negotiation should be performed in. This gives the developer the option to decide which types of content negotiation can be performed and the precedence order of these. The important thing to note is that all media types from all the selected sources are added so that there is fall back if one of the options is not supported by the different message converters.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.1</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/16304/AnnotationMethodHandlerAdapter.java" rel="nofollow">AnnotationMethodHandlerAdapter.java</a> (<em>47.27 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/16474/ContentNegotatingResponseBody.java" rel="nofollow">ContentNegotatingResponseBody.java</a> (<em>5.91 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/16473/ContentNegotatingResponseBody.java" rel="nofollow">ContentNegotatingResponseBody.java</a> (<em>5.86 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/16303/MediaTypeUtil.java" rel="nofollow">MediaTypeUtil.java</a> (<em>4.29 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398100331" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11163" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11163/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11163">#11163</a> <code class="notranslate">@RequestMapping</code> should support accept header and url extension (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398112762" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13057" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13057/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13057">#13057</a> Content negotiation improvements (<em><strong>"is superseded by"</strong></em>)</li>
</ul>
<p dir="auto">9 votes, 7 watchers</p>