Package org.jongo.util

Examples of org.jongo.util.JSONResultHandler


        assumeThatMongoVersionIsGreaterThan("2.1.1");

        collection.insert("{version : 1, days:[{name:'monday'},{name:'sunday'}]}");
        collection.insert("{version : 2, days:[{name:'wednesday'}]}");

        String monday = collection.findOne("{version:1}").projection("{days:{$elemMatch:{name: 'monday'}}}").map(new JSONResultHandler());

        assertThat(monday).contains("\"days\" : [ { \"name\" : \"monday\"}]");
    }
View Full Code Here


        BSONPrimitiveType result = collection.findOne("{}").as(BSONPrimitiveType.class);
        assertThat(result.complexList).contains(robert);
    }

    private void assertHasBeenPersistedAs(String expectedPersistedJSON) {
        String result = collection.findOne("{}").map(new JSONResultHandler());
        assertThat(result).contains(expectedPersistedJSON);
    }
View Full Code Here

        assertThat(result.id.getType()).isEqualTo(doc.id.getType());
        assertThat(result.id.getData()).isEqualTo(doc.id.getData());
    }

    private void assertHasBeenPersistedAs(String expectedPersistedJSON) {
        String result = collection.findOne().map(new JSONResultHandler());
        assertThat(result).contains(expectedPersistedJSON);
    }
View Full Code Here

TOP

Related Classes of org.jongo.util.JSONResultHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.