@Test public void testRollback() { ModificationItem[] expectedCompensatingItems = new ModificationItem[0]; ModificationItem[] expectedActualItems = new ModificationItem[0]; Name expectedDn = LdapUtils.newLdapName("cn=john doe"); ModifyAttributesOperationExecutor tested = new ModifyAttributesOperationExecutor(ldapOperationsMock, expectedDn, expectedActualItems, expectedCompensatingItems); tested.rollback(); verify(ldapOperationsMock).modifyAttributes(expectedDn, expectedCompensatingItems); }
public void rollback() { try { log.debug("Rolling back modifyAttributes operation"); ldapOperations.modifyAttributes(dn, compensatingModifications); } catch (Exception e) { log .warn("Failed to rollback ModifyAttributes operation, dn: " + dn); } }
ModifyAttributesOperationExecutor implements
        CompensatingTransactionOperationExecutor { public void rollback() { try { log.debug("Rolling back modifyAttributes operation"); ldapOperations.modifyAttributes(dn, compensatingModifications); } catch (Exception e) { log .warn("Failed to rollback ModifyAttributes operation, dn: " + dn); } } }
ModifyAttributesOperationExecutor implements
        CompensatingTransactionOperationExecutor { public void rollback() { try { log.debug("Rolling back modifyAttributes operation"); ldapOperations.modifyAttributes(dn, compensatingModifications); } catch (Exception e) { log .warn("Failed to rollback ModifyAttributes operation, dn: " + dn); } } ModifyAttributesOperationExecutor(LdapOperations ldapOperations,
            Name dn, ModificationItem[] actualModifications,
            ModificationItem[] compensatingModifications); }
ModifyAttributesOperationExecutor implements
        CompensatingTransactionOperationExecutor { public void rollback() { try { log.debug("Rolling back modifyAttributes operation"); ldapOperations.modifyAttributes(dn, compensatingModifications); } catch (Exception e) { log .warn("Failed to rollback ModifyAttributes operation, dn: " + dn); } } ModifyAttributesOperationExecutor(LdapOperations ldapOperations,
            Name dn, ModificationItem[] actualModifications,
            ModificationItem[] compensatingModifications); void rollback(); void commit(); void performOperation(); }
ModifyAttributesOperationExecutor implements
        CompensatingTransactionOperationExecutor { public void rollback() { try { log.debug("Rolling back modifyAttributes operation"); ldapOperations.modifyAttributes(dn, compensatingModifications); } catch (Exception e) { log .warn("Failed to rollback ModifyAttributes operation, dn: " + dn); } } ModifyAttributesOperationExecutor(LdapOperations ldapOperations,
            Name dn, ModificationItem[] actualModifications,
            ModificationItem[] compensatingModifications); void rollback(); void commit(); void performOperation();  }