VirtualListViewControlDirContextProcessor extends AbstractFallbackRequestAndResponseControlDirContextProcessor { public VirtualListViewResultsCookie getCookie() { return cookie; } VirtualListViewControlDirContextProcessor(int pageSize);  VirtualListViewControlDirContextProcessor(int pageSize,
            int targetOffset, int listSize, VirtualListViewResultsCookie cookie); VirtualListViewResultsCookie getCookie(); int getPageSize(); int getListSize(); NamingException getException(); int getTargetOffset(); void setOffsetPercentage(boolean isPercentage); boolean isOffsetPercentage(); Control createRequestControl();  }
@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; 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); }