@Test
public void testLoadByQuery() throws Exception {

    TestUser created = dao.create(TestUser.builder().name("Ian").email("ian@example.com").build());
    TestUser load = dao.loadByQuery(new Document("email", "ian@example.com"));
    assertEquals(load, created);
    try {
        dao.loadByQuery(new Document("email", "notfound@example.com"));
        fail("Expected DataNotFoundException");
    } catch (DataNotFoundException e) {
        assertEquals("TestUser not found", e.getMessage());
    }
}