Minor fix to RebindOperation and UnbindOperation
This commit is contained in:
@@ -115,7 +115,9 @@ public class RebindOperationExecutor implements
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ public class RebindOperationRecorder implements
|
||||
|
||||
Name temporaryName = renamingStrategy.getTemporaryName(dn);
|
||||
|
||||
ldapOperations.rename(dn, temporaryName);
|
||||
return new RebindOperationExecutor(ldapOperations, dn, temporaryName,
|
||||
object, attributes);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,9 @@ public class UnbindOperationExecutor implements
|
||||
* @see org.springframework.ldap.support.transaction.CompensatingTransactionOperationExecutor#performOperation()
|
||||
*/
|
||||
public void performOperation() {
|
||||
log.debug("Nothing to do in performOperation for unbind");
|
||||
log.debug("Performing operation for unbind -"
|
||||
+ " renaming to temporary entry.");
|
||||
ldapOperations.rename(originalDn, temporaryDn);
|
||||
}
|
||||
|
||||
LdapOperations getLdapOperations() {
|
||||
|
||||
@@ -55,8 +55,6 @@ public class UnbindOperationRecorder implements
|
||||
Name dn = LdapUtils.getFirstArgumentAsName(args);
|
||||
Name temporaryDn = renamingStrategy.getTemporaryName(dn);
|
||||
|
||||
ldapOperations.rename(dn, temporaryDn);
|
||||
|
||||
return new UnbindOperationExecutor(ldapOperations, dn, temporaryDn);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ public class RebindOperationExecutorTest extends TestCase {
|
||||
ldapOperationsMock, expectedOriginalDn, expectedTempDn,
|
||||
expectedObject, expectedAttributes);
|
||||
|
||||
ldapOperationsMock.rename(expectedOriginalDn, expectedTempDn);
|
||||
ldapOperationsMock.bind(expectedOriginalDn, expectedObject,
|
||||
expectedAttributes);
|
||||
|
||||
|
||||
@@ -59,8 +59,6 @@ public class RebindOperationRecorderTest extends TestCase {
|
||||
renamingStrategyControl.expectAndReturn(renamingStrategyMock
|
||||
.getTemporaryName(expectedDn), expectedTempDn);
|
||||
|
||||
ldapOperationsMock.rename(expectedDn, expectedTempDn);
|
||||
|
||||
replay();
|
||||
Object expectedObject = new Object();
|
||||
BasicAttributes expectedAttributes = new BasicAttributes();
|
||||
|
||||
@@ -37,8 +37,8 @@ public class UnbindOperationExecutorTest extends TestCase {
|
||||
UnbindOperationExecutor tested = new UnbindOperationExecutor(
|
||||
ldapOperationsMock, expectedOldName, expectedTempName);
|
||||
|
||||
// Nothing to do in performOperation for unbind.
|
||||
|
||||
ldapOperationsMock.rename(expectedOldName, expectedTempName);
|
||||
|
||||
replay();
|
||||
// Perform test
|
||||
tested.performOperation();
|
||||
|
||||
@@ -57,8 +57,6 @@ public class UnbindOperationRecorderTest extends TestCase {
|
||||
renamingStrategyControl.expectAndReturn(renamingStrategyMock
|
||||
.getTemporaryName(expectedDn), expectedTempName);
|
||||
|
||||
ldapOperationsMock.rename(expectedDn, expectedTempName);
|
||||
|
||||
replay();
|
||||
// Perform test
|
||||
CompensatingTransactionOperationExecutor operation = tested
|
||||
|
||||
Reference in New Issue
Block a user