title: Trouble with BeanValidation
body: <p>I am trying to follow the example in <a href="https://jersey.java.net/documentation/latest/bean-validation.html#d0e13678" rel="nofollow">https://jersey.java.net/documentation/latest/bean-validation.html#d0e13678</a>, esp. section 18.4.3. I want to disallow json where Foo.number is missing. But my test returns status 200. Here is the full text of my test (I do have the jersey-bean-validation artifact in my pom):</p>
  
  <pre><code>import javax.ws.rs.POST;
  import javax.ws.rs.Path;
  import javax.ws.rs.Produces;
  import javax.ws.rs.core.Application;
  import javax.ws.rs.core.Response;
  
  import javax.validation.Valid;
  import javax.validation.constraints.NotNull;
  
  import org.glassfish.jersey.client.ClientConfig;
  import org.glassfish.jersey.jackson.JacksonFeature;
  import org.glassfish.jersey.server.ResourceConfig;
  import org.glassfish.jersey.test.JerseyTest;
  import org.junit.Test;
  
  import static org.junit.Assert.assertTrue;
  
  
  public class DeleteMe extends JerseyTest {
      @Path("/")
      public static class Resource {
          @POST
          @Produces("application/json")
          public Foo post(@Valid Foo foo) {
              return foo;
          }
      }
      public static class Foo {
         @NotNull
         private Integer number;
  
         public void setNumber(final Integer number) {
           this.number = number;
         }
         public Integer getNumber() {
           return number;
         }
      }
      @Override
      protected Application configure() {
          return new ResourceConfig(Resource.class)
                  .register(JacksonFeature.class);
      }
  
      @Override
      protected void configureClient(final ClientConfig config) {
          config.register(JacksonFeature.class);
      }
      @Test
      public void testEntityFail() throws Exception {
          Foo foo = new Foo();
          Response response = target().request().post(javax.ws.rs.client.Entity.json(foo));
         //I get 200 here...but foo is no good
          assertTrue("Status "+response.getStatus(),response.getStatus() == 400);
       }
  }
  </code></pre>