use of org.commonjava.indy.folo.data.idxmodel.TrackingKey2StringMapper in project indy by Commonjava.
the class TrackingKey2StringMapperTest method testMapper.
@Test
public void testMapper() throws IOException {
TrackingKey2StringMapper mapper = new TrackingKey2StringMapper();
TrackingKey key = new TrackingKey(TEST_ID);
Assert.assertTrue(mapper.isSupportedType(TrackingKey.class));
Assert.assertFalse(mapper.isSupportedType(Object.class));
Assert.assertFalse(mapper.isSupportedType(TrackedContent.class));
Assert.assertTrue(mapper.isSupportedType(WrappedByteArray.class));
Object genKey = mapper.getKeyMapping(TEST_ID);
Assert.assertEquals(key, genKey);
String genId = mapper.getStringMapping(key);
Assert.assertEquals(TEST_ID, genId);
WrappedByteArray array = bytesOfTrackingKey(key);
genId = mapper.getStringMapping(array);
Assert.assertEquals(TEST_ID, genId);
}
Aggregations