use of com.unboundid.ldap.sdk.SCRAMSHA1BindRequest in project ldapsdk by pingidentity.
the class SASLUtilsTestCase method testValidSCRAMSHA1Bind.
/**
* Tests the ability to create a valid SCRAM-SHA-1 bind request.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testValidSCRAMSHA1Bind() throws Exception {
final BindRequest bindRequest = SASLUtils.createBindRequest(null, "password", null, "mech=SCRAM-SHA-1", "username=jdoe");
assertNotNull(bindRequest);
assertTrue(bindRequest instanceof SCRAMSHA1BindRequest);
final SCRAMSHA1BindRequest scramBind = (SCRAMSHA1BindRequest) bindRequest;
assertNotNull(scramBind.getUsername());
assertEquals(scramBind.getUsername(), "jdoe");
assertNotNull(scramBind.getPasswordString());
assertEquals(scramBind.getPasswordString(), "password");
}
Aggregations