title: JerseyTest field becomes NULL in resource
body: <p>For some strange reason a field of my entity has been changed to NULL in my resource.  </p>
  
  <p><strong>User Entity</strong><br>
  The User entity contains: userName, firstName, lastName, email. The JerseyTest instantiates a new User object:  </p>
  
  <pre><code>newUser = new User();
      newUser.setEmail(getEmail());
      newUser.setFirstName("Erwin");
      newUser.setLastName("Eberhard");
      newUser.setUserName("abc");    
  </code></pre>
  
  <p><strong>Send entity in test</strong><br>
  Before sending the data, the log in the test tells me:  </p>
  
  <pre><code>[main] INFO feature.AccountStepDefinition - Erwin Eberhard erwin  
        erwineberhard@gmail.com
  </code></pre>
  
  <p>Everthing seems to be OK, so the test sends the data to the resource:  </p>
  
  <pre><code>logger.info(newUser.toString());
  responseUser = target("auth/register").request().post(Entity.json(newUser), User.class); 
  </code></pre>
  
  <p><strong>AccountResource</strong><br>
  The AccountResource retrieves the user, and the log tells us:  </p>
  
  <pre><code>[qtp1533672820-20] INFO nl.bolt.ffinschrijven.controllers.AccountsController   
  - Erwin Eberhard null erwineberhard@gmail.com  
  </code></pre>
  
  <p>For some reason the username has been changed in NULL.  </p>
  
  <p><strong>Method in AccountResource</strong> </p>
  
  <pre><code>@POST
  @Path("/register")
  @ApiOperation(value = "Register user.", notes = "After registration a JWT token has been added as header value.")
  @ApiResponse(code = 200, message = "", response = User.class, responseHeaders = @ResponseHeader(name = "X-FFI-AUTH", description = "Token generated after authentication", response = String.class) )
  @Consumes("application/json")
  public Response callback(User user) {
  
          logger.info(user.toString());
  
          ServiceResult serviceResult = accountService.register(user);
          if (serviceResult.serviceState == ServiceState.success) {
              String jwt = "Bearer " + JwtHelper.createJWT(UUID.randomUUID().toString(), ApiConfiguration.issuer,
                      user.getEmail(), Long.valueOf(ApiConfiguration.token_ttl));
              return Response.status(201).entity(serviceResult.content).header("Authorization", jwt).build();
          }
  
          if (serviceResult.serviceState == ServiceState.invalid) {
              return Response.status(400).entity(serviceResult.responseMessages.toString()).build();
          }
  
          return Response.status(500).build();
  }
  </code></pre>
  
  <p><strong>Postman</strong><br>
  When I send the data with POSTMAN, there is no problem: </p>
  
  <p><em>Headers</em>  </p>
  
  <p>Content-Type application/json </p>
  
  <p><em>Raw content</em> </p>
  
  <pre><code>{
  "firstName": "Erwin",
  "lastName" : "Eberhard",
  "email" : "erwin@gmail.com",
  "userName": "erwineberhard" 
  }  
  </code></pre>
  
  <p>How to get the beloved 201 with my JerseyTest?  </p>
  
  <p><strong>UPDATE 1</strong> </p>
  
  <p><strong>User.class</strong>  </p>
  
  <p>The User class extends from a generic User class:  </p>
  
  <pre><code>@Entity
  @Table
  public class User extends GenericUser {
  
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  @Column(name = "id")
  private Long id;
  
  @OneToMany(mappedBy="user", cascade=CascadeType.ALL)
  private List&lt;Eventcomponent&gt; eventcomponents =   
  new ArrayList&lt;Eventcomponent&gt;();
  
  public Long getId() {
      return id;
  }
  
  @Override
  public String toString(){
      return this.getFirstName() + " " +  this.getLastName() + " " +     this.getUserName() 
      +  " " + this.getEmail();
  }
  }
  </code></pre>
  
  <p><strong>GenericUser.class</strong>  </p>
  
  <pre><code>@MappedSuperclass
  public abstract class GenericUser implements IEmail{
  
  @NotNull(message="Gebruikersnaam niet meegegeven.")
  @Column(name="userName", nullable = false)
  protected String userName;
  @NotNull(message="Email niet meegegeven.")
  @Column(name="email", nullable = false)
  protected String email;
  @NotNull(message="Voornaam niet meegegeven.")
  @Column(name="firstName", nullable = false)
  protected String firstName;
  @NotNull(message="Achternaam niet meegegeven.")
  @Column(name="lastName", nullable = false)
  protected String lastName;
  @Column(name="locked", nullable = false)
  protected Boolean locked;
  
  protected String getUserName() {
      return userName;
  }
  public void setUserName(String userName) {
      this.userName = userName;
  }
  public String getEmail() {
      return email;
  }
  public void setEmail(String email) {
      this.email = email;
  }
  public String getFirstName() {
      return firstName;
  }
  public void setFirstName(String firstName) {
      this.firstName = firstName;
  }
  public String getLastName() {
      return lastName;
  }
  public void setLastName(String lastName) {
      this.lastName = lastName;
  }
  public Boolean getLocked() {
      return locked;
  }
  public void setLocked(Boolean locked) {
      this.locked = locked;
  }  
  }
  </code></pre>