@RepeatedTest(1)
    @Tag("DisableTicketRegistryTestWithEncryption")
    void verifyTicketConsumer() throws Throwable {
        val objectToSend = new AddTicketMessageQueueCommand(new PublisherIdentifier(),
            new TicketGrantingTicketImpl(UUID.randomUUID().toString(),
                CoreAuthenticationTestUtils.getAuthentication(), NeverExpiresExpirationPolicy.INSTANCE));
        val originalMessage = pubSubMessageConverter.toPubSubMessage(objectToSend, Map.of());

        val topic = Topic.newBuilder().setName(UUID.randomUUID().toString()).build();
        val subscription = Subscription.newBuilder().setName(UUID.randomUUID().toString()).build();
        val cmd = new GoogleCloudTicketRegistryMessageQueueConsumer(topic, subscription,
            messageQueueTicketRegistryReceiver, pubSubMessageConverter);
        val message = mock(BasicAcknowledgeablePubsubMessage.class);
        when(message.getProjectSubscriptionName())
            .thenReturn(ProjectSubscriptionName.of("project", "subscription"));
        when(message.getPubsubMessage()).thenReturn(originalMessage);

        val apiFuture = mock(CompletableFuture.class);
        when(apiFuture.get()).thenReturn(Boolean.TRUE.toString());
        when(message.ack()).thenReturn(apiFuture);
        when(message.nack()).thenReturn(apiFuture);

        assertDoesNotThrow(() -> cmd.accept(message));

        when(message.getProjectSubscriptionName()).thenReturn(null);
        assertDoesNotThrow(() -> cmd.accept(message));
    }
This is {@link GoogleCloudPubSubTicketRegistryTests}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-gcp-pubsub-ticket-registry/src/test/java/org/apereo/cas/ticket/registry/GoogleCloudPubSubTicketRegistryTests.java