tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwaastad <he...@waastad.org>
Subject @JohnzonProperty
Date Wed, 01 Jun 2016 08:13:06 GMT
Hi,
I might be missing something but:


public class TokenResponse {

    @JohnzonProperty("token_type")
    private String tokenType;
    @JohnzonProperty("mapi")
    private String mapi;
    @JohnzonProperty("access_token")
    private String accessToken;
    @JohnzonProperty("expires_in")
    private Integer expiresIn;

    ..constructs and getters setters
}

and this test is failing on readObject:

final Mapper build = new MapperBuilder().setPretty(true).build();
String response =
"{\"access_token\":\"muz7bkezs6bfk6ea4vaz97de\",\"token_type\":\"bearer\",\"expires_in\":3600}";
        String response2 =
"{\"accessToken\":\"muz7bkezs6bfk6ea4vaz97de\",\"tokenType\":\"bearer\",\"expiresIn\":3600}";
        TokenResponse readObject = build.readObject(response,
TokenResponse.class);
        TokenResponse readObject2 = build.readObject(response2,
TokenResponse.class);
        assertNotNull(readObject.getAccessToken());
        assertNotNull(readObject2.getAccessToken());


/hw




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JohnzonProperty-tp4678709.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Mime
View raw message