DittoBsonJson { public BsonDocument parse(final JsonObject jsonObject) { return jsonObjectToBsonDocumentMapper.apply(jsonObject); } private  DittoBsonJson(final Function<JsonObject, BsonDocument> jsonObjectToBsonDocumentMapper,
            final Function<JsonArray, BsonArray> jsonArrayToBsonArrayMapper,
            final Function<BsonDocument, JsonObject> bsonDocumentToJsonObjectMapper,
            final Function<BsonArray, JsonArray> bsonArrayToJsonObjectMapper); static DittoBsonJson getInstance(); JsonValue serialize(final BsonValue bsonValue); JsonObject serialize(final BsonDocument bsonDocument); JsonArray serialize(final BsonArray bsonArray); BsonDocument parse(final JsonObject jsonObject); BsonArray parse(final JsonArray jsonArray);  }
@Test public void parseJsonWithDotsInKeys() throws JSONException { final BsonDocument expected = BsonDocument.parse(JSON_WITH_UNICODE_DOTS_INKEYS); final Object parsed = underTest.parse(JsonFactory.newObject(JSON_WITH_DOTS_INKEYS)); assertThat(parsed).isEqualTo(expected); }
@Test public void parseJsonWithUnicodeDotsInKeys() throws JSONException { final BsonDocument expected = BsonDocument.parse(JSON_WITH_UNICODE_DOTS_INKEYS); final Object parsed = underTest.parse(JsonFactory.newObject(JSON_WITH_DOTS_INKEYS)); assertThat(parsed).isEqualTo(expected); }
@Test public void parseJsonWithDollarsInKeys() throws JSONException { final BsonDocument expected = BsonDocument.parse(JSON_WITH_UNICODE_DOLLAR_INKEYS); final Object parsed = underTest.parse(JsonFactory.newObject(JSON_WITH_DOLLAR_INKEYS)); assertThat(parsed).isEqualTo(expected); }
@Test public void parseJsonWithUnicodeDollarsInKeys() throws JSONException { final BsonDocument expected = BsonDocument.parse(JSON_WITH_UNICODE_DOLLAR_INKEYS); final Object parsed = underTest.parse(JsonFactory.newObject(JSON_WITH_DOLLAR_INKEYS)); assertThat(parsed).isEqualTo(expected); }
@Test public void parseJsonWithNestedUnicodeDotsInKeys() throws JSONException { final BsonDocument expected = BsonDocument.parse(JSON_NESTED_WITH_UNICODE_DOTS_INKEYS); final Object parsed = underTest.parse(JsonFactory.newObject(JSON_NESTED_WITH_DOTS_INKEYS)); assertThat(parsed).isEqualTo(expected); }