@Test
public void testSearch_String_SearchControls_ContextMapper_ReturningObjFlagNotSet() throws Exception {

	expectGetReadOnlyContext();
	SearchControls controls = new SearchControls();
	controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
	SearchControls expectedControls = new SearchControls();
	expectedControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
	expectedControls.setReturningObjFlag(true);
	Object expectedObject = new Object();
	SearchResult searchResult = new SearchResult("", expectedObject, new BasicAttributes());
	singleSearchResultWithStringBase(expectedControls, searchResult);
	Object expectedResult = expectedObject;
	when(contextMapperMock.mapFromContext(expectedObject)).thenReturn(expectedResult);
	List list = tested.search(DEFAULT_BASE_STRING, "(ou=somevalue)", controls, contextMapperMock);
       verify(namingEnumerationMock).close();
       verify(dirContextMock).close();
       assertThat(list).isNotNull();
	assertThat(list).hasSize(1);
	assertThat(list.get(0)).isSameAs(expectedResult);
}