Here are the classes involve.

```
public class UserAuthDto {

    private String username;

    private String password;

    private List<String> roles;

    private String tenantCode;

    public UserAuthDto(String username,
                           String password,
                           List<String> roles,
                           String tenantCode){
        this.username=username;
        this.password=password;
        this.roles=roles;
        this.tenantCode=tenantCode;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setRoles(List<String> roles) {
        this.roles = roles;
    }

    public void setTenantCode(String tenantCode) {
        this.tenantCode = tenantCode;
    }

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public List<String> getRoles() {
        return roles;
    }

    public String getTenantCode() {
        return tenantCode;
    }
}

```

Another DTO 

```
public class UserAuthRequest {

    private UserAuthDto userAuthDto;

    public UserAuthRequest(UserAuthDto authDto){
        if(authDto == null){
            throw new IllegalArgumentException("User Authentication DTO Should Not be null");
        }
        this.userAuthDto = authDto;
    }
    public String getUsername(){
        return userAuthDto.getUsername();
    }

    public String getPassword(){
        return userAuthDto.getPassword();
    }

    public List<String> getRoles(){
        return  userAuthDto.getRoles();
    }

    public String getTenantCode(){
        return  userAuthDto.getTenantCode();
    }

    public void setUsername(String username) {
        this.userAuthDto.setUsername(username);
    }

    public void setPassword(String password) {
        this.userAuthDto.setPassword(password);
    }

    public void setRoles(List<String> roles) {
        this.userAuthDto.setRoles(roles);
    }

    public void setTenantCode(String tenantCode) {
        this.userAuthDto.setTenantCode(tenantCode);
    }
}

```

And here's the Controller that was processing the request.

```
@RequestMapping(value = "authenticate", method = RequestMethod.POST,consumes = "application/json",produces = "application/json")
    public UserAuthResponse authenticate(@RequestBody UserAuthRequest authRequest){
       //.
    }

```

However when I send this data

```
{"username": "test","password":"test","roles":null,"tenantCode":"test"}

```

I receive a 400 bad request. any idea why?