Search in sources :

Example 1 with UnboundIDChangeLogEntry

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());
}
Also used : ASN1OctetString(com.unboundid.asn1.ASN1OctetString) Entry(com.unboundid.ldap.sdk.Entry) ChangeLogEntry(com.unboundid.ldap.sdk.ChangeLogEntry) UnboundIDChangeLogEntry(com.unboundid.ldap.sdk.unboundidds.UnboundIDChangeLogEntry) Control(com.unboundid.ldap.sdk.Control) UnboundIDChangeLogEntry(com.unboundid.ldap.sdk.unboundidds.UnboundIDChangeLogEntry) ChangeLogEntry(com.unboundid.ldap.sdk.ChangeLogEntry) UnboundIDChangeLogEntry(com.unboundid.ldap.sdk.unboundidds.UnboundIDChangeLogEntry) ASN1OctetString(com.unboundid.asn1.ASN1OctetString) Test(org.testng.annotations.Test)

Aggregations

ASN1OctetString (com.unboundid.asn1.ASN1OctetString)1 ChangeLogEntry (com.unboundid.ldap.sdk.ChangeLogEntry)1 Control (com.unboundid.ldap.sdk.Control)1 Entry (com.unboundid.ldap.sdk.Entry)1 UnboundIDChangeLogEntry (com.unboundid.ldap.sdk.unboundidds.UnboundIDChangeLogEntry)1 Test (org.testng.annotations.Test)1