@Test
public void testSearchForObject() throws Exception {

	expectGetReadOnlyContext();
	Object expectedObject = new Object();
	SearchResult searchResult = new SearchResult("", expectedObject, new BasicAttributes());
	singleSearchResult(searchControlsRecursive(), searchResult);
	Object expectedResult = expectedObject;
	when(contextMapperMock.mapFromContext(expectedObject)).thenReturn(expectedResult);
	Object result = tested.searchForObject(nameMock, "(ou=somevalue)", contextMapperMock);
       verify(dirContextMock).close();
       assertThat(result).isNotNull();
	assertThat(result).isSameAs(expectedResult);
}