use of com.unboundid.ldap.sdk.unboundidds.UnboundIDChangeLogEntry in project ldapsdk by pingidentity.
the class ChangelogEntryIntermediateResponseTestCase method testEntryResponseWithUnboundIDChangelogEntry.
/**
* Provides generic coverage for a changelog entry intermediate response.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testEntryResponseWithUnboundIDChangelogEntry() throws Exception {
final StringBuilder changes = new StringBuilder();
changes.append("objectClass: top").append(StaticUtils.EOL);
changes.append("objectClass: domain").append(StaticUtils.EOL);
changes.append("dc: example").append(StaticUtils.EOL);
final ChangeLogEntry e = new UnboundIDChangeLogEntry(new Entry("dn: changeNumber=1,cn=changelog", "objectClass: top", "objectClass: changeLogEntry", "changeNumber: 1", "targetDN: dc=example,dc=com", "changeType: add", "changes:: " + Base64.encode(changes.toString())));
final String serverID = CryptoHelper.getRandomUUID().toString();
final ASN1OctetString resumeToken = new ASN1OctetString("foo");
ChangelogEntryIntermediateResponse ir = new ChangelogEntryIntermediateResponse(e, serverID, resumeToken, new Control("1.2.3.4"), new Control("5.6.7.8"));
ir = new ChangelogEntryIntermediateResponse(ir);
assertNotNull(ir);
assertNotNull(ir.getChangeLogEntry());
assertEquals(ir.getChangeLogEntry(), e);
assertNotNull(ir.getServerID());
assertEquals(ir.getServerID(), serverID);
assertNotNull(ir.getResumeToken());
assertTrue(Arrays.equals(ir.getResumeToken().getValue(), resumeToken.getValue()));
assertNotNull(ir.getIntermediateResponseName());
assertNotNull(ir.valueToString());
assertNotNull(ir.toString());
}
Aggregations