@Test
public void testPostProcess() throws Exception {

	int pageSize = 5;
	int targetOffset = 25;
	int listSize = 1000;
	VirtualListViewControlDirContextProcessor tested = new VirtualListViewControlDirContextProcessor(
			pageSize, targetOffset, listSize,
			new VirtualListViewResultsCookie(new byte[0], 0, 0));
	int virtualListViewResult = 53; // unwilling to perform
	byte[] encoded = encodeResponseValue(10, listSize,
			virtualListViewResult);
	VirtualListViewResponseControl control = new VirtualListViewResponseControl(
			OID_RESPONSE, false, encoded);
	when(ldapContextMock.getResponseControls()).thenReturn(new Control[]{control});
	try {
		tested.postProcess(ldapContextMock);
		fail("OperationNotSupportedException expected");
	}
	catch (OperationNotSupportedException expected) {
		Throwable cause = expected.getCause();
		assertThat(cause.getClass()).isEqualTo(javax.naming.OperationNotSupportedException.class);
		assertThat(cause.getMessage()).isEqualTo("[LDAP: error code 53 - Unwilling To Perform]");
	}
	assertThat(tested.getCookie()).isNotNull();
	assertThat(tested.getCookie().getCookie().length).isEqualTo(0);
}