use of org.commonjava.indy.stats.IndyVersioning in project indy by Commonjava.
the class IndyVersioningTest method roundTripJson.
@Test
public void roundTripJson() throws Exception {
final IndyObjectMapper mapper = new IndyObjectMapper(true);
final IndyVersioning versioning = new IndyVersioning("0.0.1", "somebody", "01010101010101", "2014-11-02 21:45:00", "1");
final String json = mapper.writeValueAsString(versioning);
System.out.println(json);
final IndyVersioning result = mapper.readValue(json, IndyVersioning.class);
assertThat(result.getVersion(), equalTo(versioning.getVersion()));
assertThat(result.getBuilder(), equalTo(versioning.getBuilder()));
assertThat(result.getCommitId(), equalTo(versioning.getCommitId()));
assertThat(result.getTimestamp(), equalTo(versioning.getTimestamp()));
}
Aggregations