#include "anonymous_tokens/cpp/client/anonymous_tokens_redemption_client.h"
#include <cstdint>
#include <memory>
#include <random>
#include <string>
#include <utility>
#include <vector>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "anonymous_tokens/cpp/testing/utils.h"
#include "anonymous_tokens/proto/anonymous_tokens.pb.h"
namespace anonymous_tokens {
namespace {
HasSubstr;
std::string GetRandomString(int n, std::uniform_int_distribution<int>* distr_u8,
std::mt19937_64* generator) { … }
struct RedemptionInfoAndResult { … };
absl::flat_hash_map<std::string, RedemptionInfoAndResult>
CreateTokenToRedemptionResultMap(
const AnonymousTokensRedemptionResponse& response) { … }
class AnonymousTokensRedemptionClientTest : public testing::Test { … };
TEST_F(AnonymousTokensRedemptionClientTest, UndefinedUseCase) { … }
TEST_F(AnonymousTokensRedemptionClientTest, InvalidKeyVersions) { … }
TEST_F(AnonymousTokensRedemptionClientTest, EmptyRequest) { … }
TEST_F(AnonymousTokensRedemptionClientTest, CreatingRequestAgain) { … }
TEST_F(AnonymousTokensRedemptionClientTest, MissingTokenInRequest) { … }
TEST_F(AnonymousTokensRedemptionClientTest, WrongMaskSize) { … }
TEST_F(AnonymousTokensRedemptionClientTest, RepeatedTokenInRequest) { … }
TEST_F(AnonymousTokensRedemptionClientTest, ProcessBeforeRequestCreation) { … }
TEST_F(AnonymousTokensRedemptionClientTest, EmptyResponseProcessing) { … }
TEST_F(AnonymousTokensRedemptionClientTest, WrongSizeOfResponse) { … }
TEST_F(AnonymousTokensRedemptionClientTest, UseCaseMismatch) { … }
TEST_F(AnonymousTokensRedemptionClientTest, KeyVersionMismatch) { … }
TEST_F(AnonymousTokensRedemptionClientTest, EmptyTokenInResponse) { … }
TEST_F(AnonymousTokensRedemptionClientTest, MissingMaskInResponse) { … }
TEST_F(AnonymousTokensRedemptionClientTest, WrongMaskSizeInResponse) { … }
TEST_F(AnonymousTokensRedemptionClientTest, RepeatedTokenInResponse) { … }
TEST_F(AnonymousTokensRedemptionClientTest, NewTokenInResponse) { … }
TEST_F(AnonymousTokensRedemptionClientTest, PublicMetadataMismatch) { … }
TEST_F(AnonymousTokensRedemptionClientTest, PlaintextMessageMismatch) { … }
TEST_F(AnonymousTokensRedemptionClientTest, MessageMaskMismatch) { … }
TEST_F(AnonymousTokensRedemptionClientTest,
SuccessfulResponseProcessingWithOneToken) { … }
TEST_F(AnonymousTokensRedemptionClientTest,
SuccessfulResponseProcessingWithMultipleToken) { … }
}
}