|
|
@ -24,14 +24,11 @@ import org.junit.Test; |
|
|
|
import org.springframework.mock.web.test.MockHttpServletRequest; |
|
|
|
import org.springframework.mock.web.test.MockHttpServletRequest; |
|
|
|
import org.springframework.web.servlet.mvc.condition.ProducesRequestCondition.ProduceMediaTypeExpression; |
|
|
|
import org.springframework.web.servlet.mvc.condition.ProducesRequestCondition.ProduceMediaTypeExpression; |
|
|
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.*; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
import static org.junit.Assert.assertNull; |
|
|
|
|
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
import static org.junit.Assert.fail; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Unit tests for {@link ProducesRequestCondition}. |
|
|
|
* Unit tests for {@link ProducesRequestCondition}. |
|
|
|
|
|
|
|
* |
|
|
|
* @author Arjen Poutsma |
|
|
|
* @author Arjen Poutsma |
|
|
|
* @author Rossen Stoyanchev |
|
|
|
* @author Rossen Stoyanchev |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -330,6 +327,7 @@ public class ProducesRequestConditionTests { |
|
|
|
assertNull(result); |
|
|
|
assertNull(result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void assertConditions(ProducesRequestCondition condition, String... expected) { |
|
|
|
private void assertConditions(ProducesRequestCondition condition, String... expected) { |
|
|
|
Collection<ProduceMediaTypeExpression> expressions = condition.getContent(); |
|
|
|
Collection<ProduceMediaTypeExpression> expressions = condition.getContent(); |
|
|
|
assertEquals("Invalid number of conditions", expressions.size(), expected.length); |
|
|
|
assertEquals("Invalid number of conditions", expressions.size(), expected.length); |
|
|
|