@Test
public void testSearch_AttributesMapper_ReturningAttrs() throws Exception {

	expectGetReadOnlyContext();
	String[] attrs = new String[0];
	SearchControls controls = new SearchControls();
	controls.setSearchScope(SearchControls.ONELEVEL_SCOPE);
	controls.setReturningObjFlag(false);
	controls.setReturningAttributes(attrs);
	BasicAttributes expectedAttributes = new BasicAttributes();
	SearchResult searchResult = new SearchResult("", null, expectedAttributes);
	singleSearchResult(controls, searchResult);
	Object expectedResult = new Object();
	when(attributesMapperMock.mapFromAttributes(expectedAttributes)).thenReturn(expectedResult);
	List list = tested.search(nameMock, "(ou=somevalue)", 1, attrs, attributesMapperMock);
       verify(namingEnumerationMock).close();
       verify(dirContextMock).close();
       assertThat(list).isNotNull();
	assertThat(list).hasSize(1);
	assertThat(list.get(0)).isSameAs(expectedResult);
}