@Test
public void testSearch_NameNotFoundException() throws Exception {

	expectGetReadOnlyContext();
	final SearchControls controls = searchControlsRecursive();
	controls.setReturningObjFlag(false);
	javax.naming.NameNotFoundException ne = new javax.naming.NameNotFoundException("some text");
	when(dirContextMock.search(
               eq(nameMock),
               eq("(ou=somevalue)"),
               argThat(new SearchControlsMatcher(controls)))).thenThrow(ne);
	try {
		tested.search(nameMock, "(ou=somevalue)", handlerMock);
		fail("NameNotFoundException expected");
	}
	catch (NameNotFoundException expected) {
		assertThat(true).isTrue();
	}
	verify(dirContextMock).close();
}