Add jersey-bean-validation to spring-boot-starter-jersey

A dependency on org.glassfish.jersey.ext:jersey-bean-validation has
been added to spring-boot-starter-jersey. jersey-bean-validation’s EL
dependencies have been excluded in favour of those provided by
spring-boot-starter-tomcat (or starter-jetty or starter-undertow should
the user choose to use a different embedded container).

Closes gh-2315
This commit is contained in:
Andy Wilkinson
2015-01-15 09:50:05 +00:00
parent 16cb44f890
commit 492cf4ef54
5 changed files with 72 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2014 the original author or authors.
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,4 +48,19 @@ public class SampleJerseyApplicationTests {
assertEquals(HttpStatus.OK, entity.getStatusCode());
}
@Test
public void reverse() {
ResponseEntity<String> entity = this.restTemplate.getForEntity(
"http://localhost:" + this.port + "/reverse?input=olleh", String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertEquals("hello", entity.getBody());
}
@Test
public void validation() {
ResponseEntity<String> entity = this.restTemplate.getForEntity(
"http://localhost:" + this.port + "/reverse", String.class);
assertEquals(HttpStatus.BAD_REQUEST, entity.getStatusCode());
}
}