tests/src/integration/tests/test_auth.cpp
/**
 * Perform plain text authentication session connections using custom
 * authenticator callback
 *
 * This test will perform a plain text authentication using the custom
 * authenticator callback, assigning a NULL error,  and fail to establish a
 * session connection against a single node cluster.
 *
 * @jira_ticket: CPP-368
 * @test_category authentication
 * @since core:1.3.0
 * @expected_result Session will not be established
 */
Perform plain text authentication session connections using custom
authenticator callback

This test will perform a plain text authentication using the custom
authenticator callback, assigning a NULL error,  and fail to establish a
session connection against a single node cluster.

@jira_ticket: CPP-368
@test_category authentication
@since core:1.3.0
@expected_result Session will not be established
Perform plain text authentication session connections using custom authenticator callback This test will perform a plain text authentication using the custom authenticator callback assigning a NULL error and fail to establish a session connection against a single node cluster . @jira_ticket : CPP - 368 @test_category authentication @since core : 1 . 3 . 0 @expected_result Session will not be established
CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, AuthenticatorSetErrorNull) {
  CHECK_FAILURE;
  CCM::CassVersion cass_version = this->server_version_;
  if (!Options::is_cassandra()) {
    cass_version = static_cast<CCM::DseVersion>(cass_version).get_cass_version();
  }
  if (cass_version >= "3.10") {
    logger_.add_critera("Provided username invalid and/or password are incorrect");
  } else {
    logger_.add_critera("Username and/or password are incorrect");
  }
  CassAuthenticatorCallbacks authentication_callbacks = {
    AuthenticationTests::handle_authenticator_initial, NULL, NULL, NULL
  };
  cluster_.with_authenticator_callbacks(&authentication_callbacks, NULL, NULL);
  Session session =
      connect_using_credentials(CASS_HIGHEST_SUPPORTED_PROTOCOL_VERSION, "invalid", "invalid");
  ASSERT_EQ(session.connect_error_code(), CASS_ERROR_SERVER_BAD_CREDENTIALS);
  ASSERT_GE(logger_.count(), 1u);
}
CASSANDRA_INTEGRATION_TEST_F ( AuthenticationTests , AuthenticatorSetErrorNull ) { CHECK_FAILURE ; CCM :: CassVersion cass_version = this -> server_version_ ; if ( ! Options :: is_cassandra ( ) ) { cass_version = static_cast < CCM :: DseVersion > ( cass_version ) . get_cass_version ( ) ; } if ( cass_version >= " " ) { logger_ . add_critera ( " " ) ; } else { logger_ . add_critera ( " " ) ; } CassAuthenticatorCallbacks authentication_callbacks = { AuthenticationTests :: handle_authenticator_initial , NULL , NULL , NULL } ; cluster_ . with_authenticator_callbacks ( & authentication_callbacks , NULL , NULL ) ; Session session = connect_using_credentials ( CASS_HIGHEST_SUPPORTED_PROTOCOL_VERSION , " " , " " ) ; ASSERT_EQ ( session . connect_error_code ( ) , CASS_ERROR_SERVER_BAD_CREDENTIALS ) ; ASSERT_GE ( logger_ . count ( ) , 1u ) ; }
Perform plain text authentication session connections using custom
 authenticator callback
Perform plain text authentication session connections using custom authenticator callback
// Add the proper logging criteria (based on server version) // Attempt to establish session connection using authentication callback