@Test
public void verifyThatFindOneThrowsEmptyResultIfNoResult() throws Exception {

    Class<Object> expectedClass = Object.class;
    when(contextSourceMock.getReadOnlyContext()).thenReturn(dirContextMock);
    when(odmMock.filterFor(expectedClass,
            new EqualsFilter("ou", "somevalue"))).thenReturn(new EqualsFilter("ou", "somevalue"));
    noSearchResults(searchControlsRecursive());
    try {
        tested.findOne(query().where("ou").is("somevalue"), expectedClass);
        fail("EmptyResultDataAccessException expected");
    } catch (EmptyResultDataAccessException expected) {
        assertThat(true).isTrue();
    }
    verify(namingEnumerationMock).close();
    verify(dirContextMock).close();
    verify(odmMock, never()).mapFromLdapDataEntry(any(LdapDataEntry.class), any(Class.class));
}