#include "anonymous_tokens/cpp/client/anonymous_tokens_public_key_client.h"
#include <cstddef>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/status/status.h"
#include "absl/strings/string_view.h"
#include "anonymous_tokens/cpp/shared/proto_utils.h"
#include "anonymous_tokens/cpp/shared/status_utils.h"
#include "anonymous_tokens/cpp/testing/utils.h"
#include "anonymous_tokens/proto/anonymous_tokens.pb.h"
namespace anonymous_tokens {
namespace {
constexpr int kKeyByteSize = …;
constexpr int kSaltByteLength = …;
constexpr int kMessageMaskByteLength = …;
constexpr absl::Duration kEndTimeIncrement = …;
constexpr absl::Duration kStartTimeIncrement = …;
class AnonymousTokensPublicKeysGetClientTest : public ::testing::Test { … };
TEST_F(AnonymousTokensPublicKeysGetClientTest,
PublicKeyGetClientMoreThanOneRequest) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
PublicKeyGetClientInvalidUseCaseRequest) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
PublicKeyGetClientInvalidKeyVersionRequest) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
PublicKeyGetClientExpiryBeforeValidityStartRequest) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
PublicKeyGetClientExpiryInThePastRequest) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
CreateAnonymousTokensPublicKeysGetRequestWithExpiryTime) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
CreateAnonymousTokensPublicKeysGetRequestWithNoExpiryTime) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
ProcessPublicKeyGetResponseWithoutCreatingRequest) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
UndefinedUseCaseInPublicKeyGetResponse) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
UseCaseInPublicKeyGetResponseDifferentThanRequest) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
KeyVersionZeroInPublicKeyGetResponse) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
KeyVersionDifferentThanRequestedInPublicKeyGetResponse) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
SaltLengthZeroInPublicKeyGetResponse) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
SaltLengthNegativeInPublicKeyGetResponse) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
InvalidKeySizeInPublicKeyGetResponse) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
NegativeKeySizeInPublicKeyGetResponse) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
UndefinedOrUnsupportedMessageMaskType) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
MessageMaskConcatSizeLessThan32) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest, MessageMaskNoMaskSizeNotZero) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest, KeySizeIsDifferentThanRealSize) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
NoPublicKeyInPublicKeyGetResponse) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
NoValidityStartTimeInPublicKeyGetResponse) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
ValidityStartTimeAfterRequestedStartTime) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
IndefinitelyValidKeyReturnedButNotRequested) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
KeyWithExpirationTimeReturnedButIndefinitelyValidKeyWasRequested) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest, WrongExpirationTime) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest, KeyExpiredBeforeValidityStart) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest, AlreadyExpiredKey) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
DuplicateResponsesInPublicKeyGetResponse) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest, ProcessPublicKeyGetResponse) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
ProcessPublicKeyGetResponseNoExpiry) { … }
TEST_F(AnonymousTokensPublicKeysGetClientTest,
ProcessResponseContainingMultiplePublicKeys) { … }
}
}