use of com.torodb.kvdocument.values.KvMongoObjectId in project torodb by torodb.
the class TestConvertJson method parse_id.
@Test
public void parse_id() {
KvDocument doc = parser.createFromResource("_idField.json");
assertTrue(doc.containsKey("_id"));
KvValue<?> id = doc.get("_id");
assertTrue(id instanceof KvMongoObjectId);
assertEquals("55129FF25916F02D31387E1C", id.toString());
}
use of com.torodb.kvdocument.values.KvMongoObjectId in project torodb by torodb.
the class PostgreSqlValueToCopyConverterTest method testMongoObjectId.
@Test
public void testMongoObjectId() {
KvMongoObjectId mongoObjectIdValue = new ByteArrayKvMongoObjectId(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc });
mongoObjectIdValue.accept(visitor, sb);
assertEquals("\\\\x0102030405060708090A0B0C", sb.toString());
}
Aggregations