Search in sources :

Example 1 with IndyVersioning

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()));
}
Also used : IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) IndyVersioning(org.commonjava.indy.stats.IndyVersioning) Test(org.junit.Test)

Aggregations

IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)1 IndyVersioning (org.commonjava.indy.stats.IndyVersioning)1 Test (org.junit.Test)1