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:
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user