RebindOperationExecutor implements
        CompensatingTransactionOperationExecutor { public void performOperation() { log.debug("Performing rebind operation - " + "renaming original entry and " + "binding new contents to entry."); ldapOperations.rename(originalDn, temporaryDn); ldapOperations.bind(originalDn, originalObject, originalAttributes); } RebindOperationExecutor(LdapOperations ldapOperations,
            Name originalDn, Name temporaryDn, Object originalObject,
            Attributes originalAttributes); void rollback(); void commit(); void performOperation();  }
@Test public void testPerformOperation() { LdapName expectedOriginalDn = LdapUtils.newLdapName( "cn=john doe"); LdapName expectedTempDn = LdapUtils.newLdapName( "cn=john doe_temp"); Object expectedObject = new Object(); BasicAttributes expectedAttributes = new BasicAttributes(); RebindOperationExecutor tested = new RebindOperationExecutor( ldapOperationsMock, expectedOriginalDn, expectedTempDn, expectedObject, expectedAttributes); tested.performOperation(); verify(ldapOperationsMock).rename(expectedOriginalDn, expectedTempDn); verify(ldapOperationsMock) .bind(expectedOriginalDn, expectedObject, expectedAttributes); }