diff --git a/blob/blob-gcp/src/test/java/com/salesforce/multicloudj/blob/gcp/GcpBlobStoreTest.java b/blob/blob-gcp/src/test/java/com/salesforce/multicloudj/blob/gcp/GcpBlobStoreTest.java index b5219a6c..6c3d5c9c 100644 --- a/blob/blob-gcp/src/test/java/com/salesforce/multicloudj/blob/gcp/GcpBlobStoreTest.java +++ b/blob/blob-gcp/src/test/java/com/salesforce/multicloudj/blob/gcp/GcpBlobStoreTest.java @@ -2015,7 +2015,6 @@ void testDoDownloadDirectory_SkipsFolderMarkers() throws Exception { } @Test - @Disabled void testDoDownloadDirectory_PathTraversalProtection() throws Exception { // Given String prefix = "test-prefix/"; diff --git a/pubsub/pubsub-aws/src/java/com/salesforce/multicloudj/pubsub/aws/AwsSubscription.java b/pubsub/pubsub-aws/src/java/com/salesforce/multicloudj/pubsub/aws/AwsSubscription.java index 566b7e59..c4c8f973 100644 --- a/pubsub/pubsub-aws/src/java/com/salesforce/multicloudj/pubsub/aws/AwsSubscription.java +++ b/pubsub/pubsub-aws/src/java/com/salesforce/multicloudj/pubsub/aws/AwsSubscription.java @@ -2,12 +2,12 @@ import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.concurrent.CompletableFuture; import com.salesforce.multicloudj.common.aws.AwsConstants; import com.salesforce.multicloudj.common.exceptions.SubstrateSdkException; import com.salesforce.multicloudj.pubsub.batcher.Batcher; +import com.salesforce.multicloudj.pubsub.client.GetAttributeResult; import com.salesforce.multicloudj.pubsub.driver.AbstractSubscription; import com.salesforce.multicloudj.pubsub.driver.AckID; import com.salesforce.multicloudj.pubsub.driver.Message; @@ -56,8 +56,11 @@ public boolean canNack() { } @Override - public Map getAttributes() { - return null; + public GetAttributeResult getAttributes() { + return new GetAttributeResult.Builder() + .name("aws-subscription") + .topic("aws-topic") + .build(); } @Override diff --git a/pubsub/pubsub-client/src/main/java/com/salesforce/multicloudj/pubsub/client/GetAttributeResult.java b/pubsub/pubsub-client/src/main/java/com/salesforce/multicloudj/pubsub/client/GetAttributeResult.java new file mode 100644 index 00000000..e66572bf --- /dev/null +++ b/pubsub/pubsub-client/src/main/java/com/salesforce/multicloudj/pubsub/client/GetAttributeResult.java @@ -0,0 +1,45 @@ +package com.salesforce.multicloudj.pubsub.client; + + +/** + * Result object containing subscription attributes that are common across all Pub/Sub providers. + * This class provides a standardized way to access subscription configuration properties + * regardless of the underlying cloud provider (AWS, GCP, Aliyun, etc.). + */ +public class GetAttributeResult { + + // Core Identification + private String name; + private String topic; + + // Default constructor + public GetAttributeResult() {} + + // Builder pattern for easy construction + public static class Builder { + private final GetAttributeResult result = new GetAttributeResult(); + + public Builder name(String name) { + result.name = name; + return this; + } + + public Builder topic(String topic) { + result.topic = topic; + return this; + } + + public GetAttributeResult build() { + return result; + } + } + + // Getters + public String getName() { return name; } + public String getTopic() { return topic; } + + // Setters + public void setName(String name) { this.name = name; } + public void setTopic(String topic) { this.topic = topic; } + +} \ No newline at end of file diff --git a/pubsub/pubsub-client/src/main/java/com/salesforce/multicloudj/pubsub/client/SubscriptionClient.java b/pubsub/pubsub-client/src/main/java/com/salesforce/multicloudj/pubsub/client/SubscriptionClient.java index ed2f4084..5aa719f9 100644 --- a/pubsub/pubsub-client/src/main/java/com/salesforce/multicloudj/pubsub/client/SubscriptionClient.java +++ b/pubsub/pubsub-client/src/main/java/com/salesforce/multicloudj/pubsub/client/SubscriptionClient.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.List; -import java.util.Map; import java.util.concurrent.CompletableFuture; import com.salesforce.multicloudj.common.exceptions.ExceptionHandler; @@ -145,10 +144,10 @@ public boolean canNack() { * This may include provider-specific configuration like delivery delay, * message retention period, etc. * - * @return A map of subscription attributes + * @return A GetAttributeResult containing subscription attributes * @throws SubstrateSdkException If the operation fails */ - public Map getAttributes() { + public GetAttributeResult getAttributes() { try { return subscription.getAttributes(); } catch (Throwable t) { diff --git a/pubsub/pubsub-client/src/main/java/com/salesforce/multicloudj/pubsub/driver/AbstractSubscription.java b/pubsub/pubsub-client/src/main/java/com/salesforce/multicloudj/pubsub/driver/AbstractSubscription.java index a70b2234..b57da670 100644 --- a/pubsub/pubsub-client/src/main/java/com/salesforce/multicloudj/pubsub/driver/AbstractSubscription.java +++ b/pubsub/pubsub-client/src/main/java/com/salesforce/multicloudj/pubsub/driver/AbstractSubscription.java @@ -7,7 +7,6 @@ import java.util.Collections; import java.util.Queue; import java.util.List; -import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -21,6 +20,7 @@ import com.salesforce.multicloudj.common.exceptions.FailedPreconditionException; import com.salesforce.multicloudj.common.exceptions.InvalidArgumentException; import com.salesforce.multicloudj.common.exceptions.SubstrateSdkException; +import com.salesforce.multicloudj.pubsub.client.GetAttributeResult; import com.salesforce.multicloudj.pubsub.batcher.Batcher; import com.salesforce.multicloudj.sts.model.CredentialsOverrider; @@ -410,7 +410,7 @@ public CompletableFuture sendNacks(List ackIDs) { public abstract boolean canNack(); public abstract boolean isRetryable(Throwable error); - public abstract Map getAttributes(); + public abstract GetAttributeResult getAttributes(); protected abstract void doSendAcks(List ackIDs); protected abstract void doSendNacks(List ackIDs); diff --git a/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/client/AbstractPubsubIT.java b/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/client/AbstractPubsubIT.java index 61080b4d..8c6c2c21 100644 --- a/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/client/AbstractPubsubIT.java +++ b/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/client/AbstractPubsubIT.java @@ -4,6 +4,7 @@ import com.salesforce.multicloudj.pubsub.driver.AbstractTopic; import com.salesforce.multicloudj.pubsub.driver.Message; import com.salesforce.multicloudj.pubsub.driver.AckID; +import com.salesforce.multicloudj.pubsub.client.GetAttributeResult; import com.salesforce.multicloudj.common.util.common.TestsUtil; import com.salesforce.multicloudj.common.exceptions.InvalidArgumentException; @@ -325,4 +326,25 @@ public void testDoubleAck() throws Exception { subscription.sendAck(receivedMessages.get(0).getAckID()); } } + + @Test + public void testGetAttributes() throws Exception { + try (AbstractSubscription subscription = harness.createSubscriptionDriver()) { + GetAttributeResult attributes = subscription.getAttributes(); + + // Verify that attributes are returned + Assertions.assertNotNull(attributes, "Attributes should not be null"); + + // Verify essential attributes that should be present across all providers + Assertions.assertNotNull(attributes.getName(), "Name should not be null"); + Assertions.assertFalse(attributes.getName().isEmpty(), "Name should not be empty"); + + Assertions.assertNotNull(attributes.getTopic(), "Topic should not be null"); + Assertions.assertFalse(attributes.getTopic().isEmpty(), "Topic should not be empty"); + + // Verify that we have the essential attributes + Assertions.assertNotNull(attributes.getName(), "Should have name attribute"); + Assertions.assertNotNull(attributes.getTopic(), "Should have topic attribute"); + } + } } diff --git a/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/client/SubscriptionClientTest.java b/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/client/SubscriptionClientTest.java index 7620b50d..7c488885 100644 --- a/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/client/SubscriptionClientTest.java +++ b/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/client/SubscriptionClientTest.java @@ -137,11 +137,14 @@ public void testCanNack() { @Test public void testGetAttributes() { // Arrange - Map expectedAttributes = Map.of("key", "value"); + GetAttributeResult expectedAttributes = new GetAttributeResult.Builder() + .name("test-subscription") + .topic("test-topic") + .build(); when(mockSubscription.getAttributes()).thenReturn(expectedAttributes); // Act - Map result = subscriptionClient.getAttributes(); + GetAttributeResult result = subscriptionClient.getAttributes(); // Assert assertEquals(expectedAttributes, result); diff --git a/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/driver/AbstractSubscriptionTest.java b/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/driver/AbstractSubscriptionTest.java index 4f3cd004..b421dd6b 100644 --- a/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/driver/AbstractSubscriptionTest.java +++ b/pubsub/pubsub-client/src/test/java/com/salesforce/multicloudj/pubsub/driver/AbstractSubscriptionTest.java @@ -3,6 +3,7 @@ import com.salesforce.multicloudj.common.exceptions.InvalidArgumentException; import com.salesforce.multicloudj.common.exceptions.SubstrateSdkException; import com.salesforce.multicloudj.pubsub.batcher.Batcher; +import com.salesforce.multicloudj.pubsub.client.GetAttributeResult; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; @@ -133,7 +134,12 @@ protected Batcher.Options createAckBatcherOptions() { public boolean canNack() { return false; } @Override - public Map getAttributes() { return Collections.emptyMap(); } + public GetAttributeResult getAttributes() { + return new GetAttributeResult.Builder() + .name("test-subscription") + .topic("test-topic") + .build(); + } @Override public boolean isRetryable(Throwable error) { diff --git a/pubsub/pubsub-gcp/src/main/java/com/salesforce/multicloudj/pubsub/gcp/GcpSubscription.java b/pubsub/pubsub-gcp/src/main/java/com/salesforce/multicloudj/pubsub/gcp/GcpSubscription.java index f3882c63..4d943890 100644 --- a/pubsub/pubsub-gcp/src/main/java/com/salesforce/multicloudj/pubsub/gcp/GcpSubscription.java +++ b/pubsub/pubsub-gcp/src/main/java/com/salesforce/multicloudj/pubsub/gcp/GcpSubscription.java @@ -14,8 +14,10 @@ import com.google.pubsub.v1.PullResponse; import com.google.pubsub.v1.ReceivedMessage; import com.salesforce.multicloudj.common.exceptions.SubstrateSdkException; +import com.google.pubsub.v1.Subscription; import com.salesforce.multicloudj.common.gcp.GcpConstants; import com.salesforce.multicloudj.common.exceptions.InvalidArgumentException; +import com.salesforce.multicloudj.pubsub.client.GetAttributeResult; import com.salesforce.multicloudj.common.gcp.GcpCredentialsProvider; import com.salesforce.multicloudj.pubsub.batcher.Batcher; @@ -36,6 +38,9 @@ import java.net.Proxy; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.BlockingQueue; @@ -184,9 +189,17 @@ public boolean isRetryable(Throwable error) { } @Override - public Map getAttributes() { - // TODO: Implement subscription attributes retrieval - return Collections.emptyMap(); + public GetAttributeResult getAttributes() { + try { + Subscription sub = getOrCreateSubscriptionAdminClient().getSubscription(subscriptionName); + + return new GetAttributeResult.Builder() + .name(sub.getName()) + .topic(sub.getTopic()) + .build(); + } catch (ApiException e) { + throw new SubstrateSdkException("Failed to retrieve subscription attributes", e); + } } @Override diff --git a/pubsub/pubsub-gcp/src/test/java/com/salesforce/multicloudj/pubsub/gcp/GcpSubscriptionTest.java b/pubsub/pubsub-gcp/src/test/java/com/salesforce/multicloudj/pubsub/gcp/GcpSubscriptionTest.java index d7ac1643..550adc3f 100644 --- a/pubsub/pubsub-gcp/src/test/java/com/salesforce/multicloudj/pubsub/gcp/GcpSubscriptionTest.java +++ b/pubsub/pubsub-gcp/src/test/java/com/salesforce/multicloudj/pubsub/gcp/GcpSubscriptionTest.java @@ -14,6 +14,7 @@ import com.google.cloud.pubsub.v1.SubscriptionAdminClient; import com.google.protobuf.Empty; import com.google.pubsub.v1.ModifyAckDeadlineRequest; +import com.salesforce.multicloudj.pubsub.client.GetAttributeResult; import com.google.pubsub.v1.PullRequest; import com.google.pubsub.v1.PullResponse; import com.google.pubsub.v1.ReceivedMessage; @@ -22,6 +23,16 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import static org.junit.jupiter.api.Assertions.assertNull; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.Subscription.State; +import com.google.pubsub.v1.ExpirationPolicy; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.PushConfig.OidcToken; +import com.google.pubsub.v1.DeadLetterPolicy; +import com.google.pubsub.v1.RetryPolicy; +import com.google.protobuf.Duration; +import java.util.Arrays; import java.net.URI; import java.util.ArrayList; @@ -126,10 +137,306 @@ void testDoReceiveBatchWithEmptyQueue() { } @Test - void testGetAttributes() { - Map attributes = subscription.getAttributes(); + void testGetAttributesWithBasicSubscription() { + // Mock a basic subscription with minimal configuration + Subscription mockSubscription = Subscription.newBuilder() + .setName(VALID_SUBSCRIPTION_NAME) + .setTopic("projects/test-project/topics/test-topic") + .setAckDeadlineSeconds(60) + .setEnableMessageOrdering(false) + .setEnableExactlyOnceDelivery(false) + .setRetainAckedMessages(false) + .setDetached(false) + .setState(State.ACTIVE) + .build(); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenReturn(mockSubscription); + + GetAttributeResult attributes = subscription.getAttributes(); + + assertNotNull(attributes); + assertEquals(VALID_SUBSCRIPTION_NAME, attributes.getName()); + assertEquals("projects/test-project/topics/test-topic", attributes.getTopic()); + } + + @Test + void testGetAttributesWithFilter() { + Subscription mockSubscription = Subscription.newBuilder() + .setName(VALID_SUBSCRIPTION_NAME) + .setTopic("projects/test-project/topics/test-topic") + .setAckDeadlineSeconds(60) + .setFilter("attributes.event_type = \"user_created\"") + .setState(State.ACTIVE) + .build(); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenReturn(mockSubscription); + + GetAttributeResult attributes = subscription.getAttributes(); + + assertNotNull(attributes); + assertEquals(VALID_SUBSCRIPTION_NAME, attributes.getName()); + assertEquals("projects/test-project/topics/test-topic", attributes.getTopic()); + } + + @Test + void testGetAttributesWithMessageRetention() { + Duration retentionDuration = Duration.newBuilder().setSeconds(3600).build(); + Duration topicRetentionDuration = Duration.newBuilder().setSeconds(7200).build(); + + Subscription mockSubscription = Subscription.newBuilder() + .setName(VALID_SUBSCRIPTION_NAME) + .setTopic("projects/test-project/topics/test-topic") + .setAckDeadlineSeconds(60) + .setMessageRetentionDuration(retentionDuration) + .setTopicMessageRetentionDuration(topicRetentionDuration) + .setState(State.ACTIVE) + .build(); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenReturn(mockSubscription); + + GetAttributeResult attributes = subscription.getAttributes(); + + assertNotNull(attributes); + assertEquals(VALID_SUBSCRIPTION_NAME, attributes.getName()); + assertEquals("projects/test-project/topics/test-topic", attributes.getTopic()); + } + + @Test + void testGetAttributesWithExpirationPolicy() { + Duration ttl = Duration.newBuilder().setSeconds(86400).build(); + ExpirationPolicy expirationPolicy = ExpirationPolicy.newBuilder().setTtl(ttl).build(); + + Subscription mockSubscription = Subscription.newBuilder() + .setName(VALID_SUBSCRIPTION_NAME) + .setTopic("projects/test-project/topics/test-topic") + .setAckDeadlineSeconds(60) + .setExpirationPolicy(expirationPolicy) + .setState(State.ACTIVE) + .build(); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenReturn(mockSubscription); + + GetAttributeResult attributes = subscription.getAttributes(); + + assertNotNull(attributes); + // Note: GCP expiration policy is not directly mapped to GetAttributeResult fields + } + + @Test + void testGetAttributesWithPushConfig() { + OidcToken oidcToken = OidcToken.newBuilder() + .setServiceAccountEmail("test@example.com") + .setAudience("test-audience") + .build(); + + PushConfig pushConfig = PushConfig.newBuilder() + .setPushEndpoint("https://example.com/push") + .setOidcToken(oidcToken) + .build(); + + Subscription mockSubscription = Subscription.newBuilder() + .setName(VALID_SUBSCRIPTION_NAME) + .setTopic("projects/test-project/topics/test-topic") + .setAckDeadlineSeconds(60) + .setPushConfig(pushConfig) + .setState(State.ACTIVE) + .build(); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenReturn(mockSubscription); + + GetAttributeResult attributes = subscription.getAttributes(); + + assertNotNull(attributes); + assertEquals(VALID_SUBSCRIPTION_NAME, attributes.getName()); + assertEquals("projects/test-project/topics/test-topic", attributes.getTopic()); + } + + @Test + void testGetAttributesWithDeadLetterPolicy() { + DeadLetterPolicy deadLetterPolicy = DeadLetterPolicy.newBuilder() + .setDeadLetterTopic("projects/test-project/topics/dead-letter") + .setMaxDeliveryAttempts(5) + .build(); + + Subscription mockSubscription = Subscription.newBuilder() + .setName(VALID_SUBSCRIPTION_NAME) + .setTopic("projects/test-project/topics/test-topic") + .setAckDeadlineSeconds(60) + .setDeadLetterPolicy(deadLetterPolicy) + .setState(State.ACTIVE) + .build(); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenReturn(mockSubscription); + + GetAttributeResult attributes = subscription.getAttributes(); + + assertNotNull(attributes); + // Note: Dead letter policy is not directly mapped to GetAttributeResult fields + } + + @Test + void testGetAttributesWithRetryPolicy() { + Duration minBackoff = Duration.newBuilder().setSeconds(1).build(); + Duration maxBackoff = Duration.newBuilder().setSeconds(60).build(); + + RetryPolicy retryPolicy = RetryPolicy.newBuilder() + .setMinimumBackoff(minBackoff) + .setMaximumBackoff(maxBackoff) + .build(); + + Subscription mockSubscription = Subscription.newBuilder() + .setName(VALID_SUBSCRIPTION_NAME) + .setTopic("projects/test-project/topics/test-topic") + .setAckDeadlineSeconds(60) + .setRetryPolicy(retryPolicy) + .setState(State.ACTIVE) + .build(); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenReturn(mockSubscription); + + GetAttributeResult attributes = subscription.getAttributes(); + + assertNotNull(attributes); + // Note: Retry policy is not directly mapped to GetAttributeResult fields + } + + @Test + void testGetAttributesWithLabels() { + Subscription mockSubscription = Subscription.newBuilder() + .setName(VALID_SUBSCRIPTION_NAME) + .setTopic("projects/test-project/topics/test-topic") + .setAckDeadlineSeconds(60) + .putLabels("environment", "production") + .putLabels("team", "backend") + .putLabels("version", "1.0") + .setState(State.ACTIVE) + .build(); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenReturn(mockSubscription); + + GetAttributeResult attributes = subscription.getAttributes(); + + assertNotNull(attributes); + // Note: Labels are not directly mapped to GetAttributeResult fields + } + + @Test + void testGetAttributesWithAllFeatures() { + Duration retentionDuration = Duration.newBuilder().setSeconds(3600).build(); + Duration ttl = Duration.newBuilder().setSeconds(86400).build(); + Duration minBackoff = Duration.newBuilder().setSeconds(1).build(); + Duration maxBackoff = Duration.newBuilder().setSeconds(60).build(); + + OidcToken oidcToken = OidcToken.newBuilder() + .setServiceAccountEmail("test@example.com") + .setAudience("test-audience") + .build(); + + PushConfig pushConfig = PushConfig.newBuilder() + .setPushEndpoint("https://example.com/push") + .setOidcToken(oidcToken) + .build(); + + DeadLetterPolicy deadLetterPolicy = DeadLetterPolicy.newBuilder() + .setDeadLetterTopic("projects/test-project/topics/dead-letter") + .setMaxDeliveryAttempts(5) + .build(); + + RetryPolicy retryPolicy = RetryPolicy.newBuilder() + .setMinimumBackoff(minBackoff) + .setMaximumBackoff(maxBackoff) + .build(); + + ExpirationPolicy expirationPolicy = ExpirationPolicy.newBuilder().setTtl(ttl).build(); + + Subscription mockSubscription = Subscription.newBuilder() + .setName(VALID_SUBSCRIPTION_NAME) + .setTopic("projects/test-project/topics/test-topic") + .setAckDeadlineSeconds(120) + .setEnableMessageOrdering(true) + .setEnableExactlyOnceDelivery(true) + .setRetainAckedMessages(true) + .setDetached(false) + .setFilter("attributes.event_type = \"user_created\"") + .setMessageRetentionDuration(retentionDuration) + .setExpirationPolicy(expirationPolicy) + .setPushConfig(pushConfig) + .setDeadLetterPolicy(deadLetterPolicy) + .setRetryPolicy(retryPolicy) + .putLabels("environment", "production") + .putLabels("team", "backend") + .setState(State.ACTIVE) + .build(); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenReturn(mockSubscription); + + GetAttributeResult attributes = subscription.getAttributes(); + + assertNotNull(attributes); + + // Basic attributes + assertEquals(VALID_SUBSCRIPTION_NAME, attributes.getName()); + assertEquals("projects/test-project/topics/test-topic", attributes.getTopic()); + } + + @Test + void testGetAttributesWithApiException() { + ApiException apiException = mock(ApiException.class); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenThrow(apiException); + + SubstrateSdkException exception = assertThrows(SubstrateSdkException.class, + () -> subscription.getAttributes()); + assertTrue(exception.getMessage().contains("Failed to retrieve subscription attributes")); + } + + @Test + void testGetAttributesWithEmptyLabels() { + Subscription mockSubscription = Subscription.newBuilder() + .setName(VALID_SUBSCRIPTION_NAME) + .setTopic("projects/test-project/topics/test-topic") + .setAckDeadlineSeconds(60) + .setState(State.ACTIVE) + .build(); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenReturn(mockSubscription); + + GetAttributeResult attributes = subscription.getAttributes(); + + assertNotNull(attributes); + // Verify basic attributes are present + assertEquals(VALID_SUBSCRIPTION_NAME, attributes.getName()); + assertEquals("projects/test-project/topics/test-topic", attributes.getTopic()); + } + + @Test + void testGetAttributesWithoutOptionalFields() { + Subscription mockSubscription = Subscription.newBuilder() + .setName(VALID_SUBSCRIPTION_NAME) + .setTopic("projects/test-project/topics/test-topic") + .setAckDeadlineSeconds(60) + .setState(State.ACTIVE) + .build(); + + when(mockSubscriptionAdminClient.getSubscription(VALID_SUBSCRIPTION_NAME)) + .thenReturn(mockSubscription); + + GetAttributeResult attributes = subscription.getAttributes(); + assertNotNull(attributes); - assertTrue(attributes.isEmpty()); + assertEquals(VALID_SUBSCRIPTION_NAME, attributes.getName()); + assertEquals("projects/test-project/topics/test-topic", attributes.getTopic()); } @Test diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/get-ptnzwpurbw.json b/pubsub/pubsub-gcp/src/test/resources/mappings/get-ptnzwpurbw.json new file mode 100644 index 00000000..e58672af --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/get-ptnzwpurbw.json @@ -0,0 +1,25 @@ +{ + "id" : "1097bd98-cbc4-41a9-8e96-6e22b3081a5b", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscription", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription?$alt=json;enum-encoding%3Dint", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "{\n \"name\": \"projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription\",\n \"topic\": \"projects/substrate-sdk-gcp-poc1/topics/test-topic\",\n \"pushConfig\": {},\n \"ackDeadlineSeconds\": 10,\n \"messageRetentionDuration\": \"604800s\",\n \"expirationPolicy\": {\n \"ttl\": \"2678400s\"\n },\n \"state\": 1\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 21:38:34 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "1097bd98-cbc4-41a9-8e96-6e22b3081a5b", + "persistent" : true, + "insertionIndex" : 39 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/get-xgyjyywyn6.json b/pubsub/pubsub-gcp/src/test/resources/mappings/get-xgyjyywyn6.json new file mode 100644 index 00000000..15ac23b2 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/get-xgyjyywyn6.json @@ -0,0 +1,25 @@ +{ + "id" : "1e0da11b-6c5b-4a9a-8f61-7f9cac3eda03", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscription", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription?$alt=json;enum-encoding%3Dint", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "{\n \"name\": \"projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription\",\n \"topic\": \"projects/substrate-sdk-gcp-poc1/topics/test-topic\",\n \"pushConfig\": {},\n \"ackDeadlineSeconds\": 10,\n \"messageRetentionDuration\": \"604800s\",\n \"expirationPolicy\": {\n \"ttl\": \"2678400s\"\n },\n \"state\": 1\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:27 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "1e0da11b-6c5b-4a9a-8f61-7f9cac3eda03", + "persistent" : true, + "insertionIndex" : 32 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-0oltbmizoh.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-0oltbmizoh.json new file mode 100644 index 00000000..bbb635e4 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-0oltbmizoh.json @@ -0,0 +1,33 @@ +{ + "id" : "4bdfff8d-5121-4273-9a94-81625a0f2d8a", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16894086563979837\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:38:11 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "4bdfff8d-5121-4273-9a94-81625a0f2d8a", + "persistent" : true, + "scenarioName" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish", + "requiredScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-2", + "newScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-3", + "insertionIndex" : 3 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-9vssu9erhs.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-9vssu9erhs.json new file mode 100644 index 00000000..22e5b1da --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-9vssu9erhs.json @@ -0,0 +1,30 @@ +{ + "id" : "c036d94d-1b64-4e7b-b9d8-21709cd7c1c2", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionmodifyackdeadline", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:modifyAckDeadline?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.ackIds" + }, { + "matchesJsonPath" : "$.ackIds[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:25 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "c036d94d-1b64-4e7b-b9d8-21709cd7c1c2", + "persistent" : true, + "insertionIndex" : 24 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-atjxbkf41h.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-atjxbkf41h.json new file mode 100644 index 00000000..3e61251f --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-atjxbkf41h.json @@ -0,0 +1,30 @@ +{ + "id" : "f72eabe6-737e-4e5a-8412-537a2494f44b", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionpull", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:pull?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.returnImmediately" + }, { + "matchesJsonPath" : "$.maxMessages" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"receivedMessages\": [\n {\n \"ackId\": \"RFAGFixdRkhRNxkIaFEOT14jPzUgKEUaCQJPAihdeTFPKkFYcWhRDRlyfWB8O1sUVAsTUC1cUR0HaE5tdR_636eKS0NUa1wVCANEUXxfXx4MaF1fdgV54Y7NpM3ui3sJOjrugcCnbTuf5LgdZiM9XhJLLD5-Jz1FQV5AEkwsCERJUytDCypYEU4EISE-MD5FUw\",\n \"message\": {\n \"data\": \"VGhpcyBpcyBhIGluZm8gbWVzc2FnZSBmcm9tIE11bHRpQ2xvdWRK\",\n \"attributes\": {\n \"priority\": \"normal\",\n \"messageType\": \"info\",\n \"timestamp\": \"1761337800041\"\n },\n \"messageId\": \"16691122045101332\",\n \"publishTime\": \"2025-10-24T20:30:00.127Z\"\n }\n }\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:27 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "f72eabe6-737e-4e5a-8412-537a2494f44b", + "persistent" : true, + "insertionIndex" : 29 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-bllhejukpy.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-bllhejukpy.json new file mode 100644 index 00000000..905aafb9 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-bllhejukpy.json @@ -0,0 +1,30 @@ +{ + "id" : "82069d56-d9da-4d7a-b1f7-33c690da0bb6", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16892945831350627\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:21 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "82069d56-d9da-4d7a-b1f7-33c690da0bb6", + "persistent" : true, + "insertionIndex" : 18 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-e9wao6yen7.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-e9wao6yen7.json new file mode 100644 index 00000000..8ca99e65 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-e9wao6yen7.json @@ -0,0 +1,33 @@ +{ + "id" : "3e7d15bf-7874-45b5-ade1-42baf85f8026", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16893206737111243\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:23 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "3e7d15bf-7874-45b5-ade1-42baf85f8026", + "persistent" : true, + "scenarioName" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish", + "requiredScenarioState" : "Started", + "newScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-2", + "insertionIndex" : 22 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-ex9spczou2.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-ex9spczou2.json new file mode 100644 index 00000000..88f81959 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-ex9spczou2.json @@ -0,0 +1,33 @@ +{ + "id" : "f02d895b-7dec-429c-b071-31b9cafee24f", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionpull", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:pull?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.returnImmediately" + }, { + "matchesJsonPath" : "$.maxMessages" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"receivedMessages\": [\n {\n \"ackId\": \"UAYWLF1GSFE3GQhoUQ5PXiM_NSAoRRoJAk8CKF15MU8qQVhxaFENGXJ9YHw7WxRUCxNQLVxRGgdoTm11H_Lfp4pLQ1RrXBUIA0RRfF9fHgxoXV53Annhjs2kze6Lewk9OuaBwKdtO8uM1cBEZiM9XhJLLD5-Jz1FQV5AEkwsCERJUytDCypYEU4EISE-MD5FU0Q\",\n \"message\": {\n \"data\": \"QmF0Y2ggbWVzc2FnZSAjMSBmcm9tIE11bHRpQ2xvdWRK\",\n \"attributes\": {\n \"messageType\": \"batch\",\n \"timestamp\": \"1761337799637\",\n \"sequence\": \"1\"\n },\n \"messageId\": \"16691122045101225\",\n \"publishTime\": \"2025-10-24T20:29:59.722Z\"\n }\n }\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:19 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "f02d895b-7dec-429c-b071-31b9cafee24f", + "persistent" : true, + "scenarioName" : "scenario-2-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:pull", + "requiredScenarioState" : "scenario-2-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:pull-2", + "newScenarioState" : "scenario-2-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:pull-3", + "insertionIndex" : 10 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-fgc6xp3kqc.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-fgc6xp3kqc.json new file mode 100644 index 00000000..ce0eb0e1 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-fgc6xp3kqc.json @@ -0,0 +1,32 @@ +{ + "id" : "54128638-2698-4ebe-addf-912c72bddec2", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16893489913316079\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:15 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "54128638-2698-4ebe-addf-912c72bddec2", + "persistent" : true, + "scenarioName" : "scenario-3-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish", + "requiredScenarioState" : "scenario-3-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-3", + "insertionIndex" : 12 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-fre0csbqaz.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-fre0csbqaz.json new file mode 100644 index 00000000..00292530 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-fre0csbqaz.json @@ -0,0 +1,33 @@ +{ + "id" : "c8520ba2-212b-4fbf-ab70-93fbec2c5233", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionmodifyackdeadline", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:modifyAckDeadline?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.ackIds" + }, { + "matchesJsonPath" : "$.ackIds[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:20 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "c8520ba2-212b-4fbf-ab70-93fbec2c5233", + "persistent" : true, + "scenarioName" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:modifyAckDeadline", + "requiredScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:modifyAckDeadline-2", + "newScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:modifyAckDeadline-3", + "insertionIndex" : 7 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-ggsu9e1eye.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-ggsu9e1eye.json new file mode 100644 index 00000000..b27bd6ee --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-ggsu9e1eye.json @@ -0,0 +1,30 @@ +{ + "id" : "4cb4ba9d-07d4-4f66-9986-c27b64520810", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionacknowledge", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:acknowledge?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.ackIds" + }, { + "matchesJsonPath" : "$.ackIds[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:27 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "4cb4ba9d-07d4-4f66-9986-c27b64520810", + "persistent" : true, + "insertionIndex" : 28 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-hcewouuipa.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-hcewouuipa.json new file mode 100644 index 00000000..fe792b0f --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-hcewouuipa.json @@ -0,0 +1,30 @@ +{ + "id" : "d01d86a7-4ce2-4b40-817b-3703c752a5c4", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionpull", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:pull?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.returnImmediately" + }, { + "matchesJsonPath" : "$.maxMessages" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"receivedMessages\": [\n {\n \"ackId\": \"UAYWLF1GSFE3GQhoUQ5PXiM_NSAoRRoJAk8CKF15MU8qQVhxaFENGXJ9YHw7WxRUCxNQLVxRHgdoTm11H_jfp4pLQ1RrXBUIA0RRfF9fHgxoXV90B3nhjs2kze6Lewk9OuyBwKdtO_bbzutEZiM9XhJLLD5-Jz1FQV5AEkwsCERJUytDCypYEU4EISE-MD5FU0Q\",\n \"message\": {\n \"data\": \"QmF0Y2ggbWVzc2FnZSAjNSBmcm9tIE11bHRpQ2xvdWRK\",\n \"attributes\": {\n \"timestamp\": \"1761337799961\",\n \"sequence\": \"5\",\n \"messageType\": \"batch\"\n },\n \"messageId\": \"16691122045101310\",\n \"publishTime\": \"2025-10-24T20:30:00.042Z\"\n }\n }\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:25 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "d01d86a7-4ce2-4b40-817b-3703c752a5c4", + "persistent" : true, + "insertionIndex" : 25 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-i4papgz5et.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-i4papgz5et.json new file mode 100644 index 00000000..80058790 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-i4papgz5et.json @@ -0,0 +1,32 @@ +{ + "id" : "6955fe7e-dbb2-427a-a24d-717df938efa3", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionpull", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:pull?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.returnImmediately" + }, { + "matchesJsonPath" : "$.maxMessages" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"receivedMessages\": [\n {\n \"ackId\": \"UAYWLF1GSFE3GQhoUQ5PXiM_NSAoRRoJAk8CKF15MU8qQVhxaFENGXJ9YHw7WxRUCxNQLVxRGQdoTm11H_Xfp4pLQ1RrXBUIA0RRfF9fHgxoXV5xBnnhjs2kze6Lewk9OuGBwKdtO9iqutJHZiM9XhJLLD5-Jz1FQV5AEkwsCERJUytDCypYEU4EISE-MD5FU0Q\",\n \"message\": {\n \"data\": \"QmF0Y2ggbWVzc2FnZSAjMiBmcm9tIE11bHRpQ2xvdWRK\",\n \"attributes\": {\n \"timestamp\": \"1761337799722\",\n \"sequence\": \"2\",\n \"messageType\": \"batch\"\n },\n \"messageId\": \"16691122045101241\",\n \"publishTime\": \"2025-10-24T20:29:59.802Z\"\n }\n }\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:20 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "6955fe7e-dbb2-427a-a24d-717df938efa3", + "persistent" : true, + "scenarioName" : "scenario-2-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:pull", + "requiredScenarioState" : "scenario-2-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:pull-3", + "insertionIndex" : 9 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-ihjauybobq.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-ihjauybobq.json new file mode 100644 index 00000000..b9b283f7 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-ihjauybobq.json @@ -0,0 +1,32 @@ +{ + "id" : "6ba4380e-78c4-4b72-b393-1a78be97de86", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16893620213419350\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:23 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "6ba4380e-78c4-4b72-b393-1a78be97de86", + "persistent" : true, + "scenarioName" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish", + "requiredScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-3", + "insertionIndex" : 20 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-ls1rrtlx69.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-ls1rrtlx69.json new file mode 100644 index 00000000..e3a3eda4 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-ls1rrtlx69.json @@ -0,0 +1,32 @@ +{ + "id" : "1b42e68e-5f92-4508-b3b4-f7d13de8e752", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16894393646937564\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:38:11 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "1b42e68e-5f92-4508-b3b4-f7d13de8e752", + "persistent" : true, + "scenarioName" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish", + "requiredScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-3", + "insertionIndex" : 2 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-mot0wfdfny.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-mot0wfdfny.json new file mode 100644 index 00000000..00aa5db1 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-mot0wfdfny.json @@ -0,0 +1,30 @@ +{ + "id" : "9cff0794-327d-4371-adf1-b6fa773eb6d6", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16893916512078419\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:25 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "9cff0794-327d-4371-adf1-b6fa773eb6d6", + "persistent" : true, + "insertionIndex" : 30 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-ph3izwkurj.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-ph3izwkurj.json new file mode 100644 index 00000000..bf96534c --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-ph3izwkurj.json @@ -0,0 +1,30 @@ +{ + "id" : "931f08c5-e2e5-45a7-9b8d-1e5189dd9ad8", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionpull", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:pull?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.returnImmediately" + }, { + "matchesJsonPath" : "$.maxMessages" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"receivedMessages\": [\n {\n \"ackId\": \"BhYsXUZIUTcZCGhRDk9eIz81IChFGgkCTwIoXXkwRTFBXXYPPg0Zcn1hdGMLEAcETAErCl8RDWJcTkQHSavIzIVXV0tbFQkLQVN2WV4dDmFbVX0EViX15cK42fG7Mhs-ffWv4aMtLZv91682ZiI9XhJLLD5-Jz1FQV5AEkwsCERJUytDCypYEU4EISE-MD5FU0RQ\",\n \"message\": {\n \"data\": \"YmF0Y2gtYWNrLTI=\",\n \"attributes\": {\n \"batch\": \"ack\"\n },\n \"messageId\": \"16894086563979837\",\n \"publishTime\": \"2025-10-30T18:38:11.178Z\"\n }\n }\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:38:14 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "931f08c5-e2e5-45a7-9b8d-1e5189dd9ad8", + "persistent" : true, + "insertionIndex" : 1 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-pzivw2gvq9.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-pzivw2gvq9.json new file mode 100644 index 00000000..ce1f9a63 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-pzivw2gvq9.json @@ -0,0 +1,33 @@ +{ + "id" : "129dc621-1e12-4c42-b1e1-3eb46c029fd3", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16893600313812286\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:15 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "129dc621-1e12-4c42-b1e1-3eb46c029fd3", + "persistent" : true, + "scenarioName" : "scenario-3-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish", + "requiredScenarioState" : "Started", + "newScenarioState" : "scenario-3-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-2", + "insertionIndex" : 14 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-qduzeyaphe.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-qduzeyaphe.json new file mode 100644 index 00000000..12db90c9 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-qduzeyaphe.json @@ -0,0 +1,30 @@ +{ + "id" : "e9fdb15c-9b5b-4cb1-89e5-2939eabed6a2", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionpull", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:pull?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.returnImmediately" + }, { + "matchesJsonPath" : "$.maxMessages" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"receivedMessages\": [\n {\n \"ackId\": \"UAYWLF1GSFE3GQhoUQ5PXiM_NSAoRRoJAk8CKF15MU8qQVhxaFENGXJ9YHw7WxRUCxNQLVxRHwdoTm11H_ffp4pLQ1RrXBUIA0RRfF9fHgxoXV59D3nhjs2kze6Lewk9OuOBwKdtO7eBruVGZiM9XhJLLD5-Jz1FQV5AEkwsCERJUytDCypYEU4EISE-MD5FU0Q\",\n \"message\": {\n \"data\": \"QmF0Y2ggbWVzc2FnZSAjNCBmcm9tIE11bHRpQ2xvdWRK\",\n \"attributes\": {\n \"timestamp\": \"1761337799882\",\n \"sequence\": \"4\",\n \"messageType\": \"batch\"\n },\n \"messageId\": \"16691122045101288\",\n \"publishTime\": \"2025-10-24T20:29:59.964Z\"\n }\n }\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:22 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "e9fdb15c-9b5b-4cb1-89e5-2939eabed6a2", + "persistent" : true, + "insertionIndex" : 17 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-qwz6rhz3qx.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-qwz6rhz3qx.json new file mode 100644 index 00000000..7ac94c04 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-qwz6rhz3qx.json @@ -0,0 +1,30 @@ +{ + "id" : "f2de49ee-b81c-4ae4-9453-c5d47d881e35", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16894417656865712\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:23 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "f2de49ee-b81c-4ae4-9453-c5d47d881e35", + "persistent" : true, + "insertionIndex" : 26 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-rqvix1jipv.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-rqvix1jipv.json new file mode 100644 index 00000000..9c8094dc --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-rqvix1jipv.json @@ -0,0 +1,33 @@ +{ + "id" : "009c4776-262e-4f53-ac93-c0e5602da86c", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionmodifyackdeadline", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:modifyAckDeadline?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.ackIds" + }, { + "matchesJsonPath" : "$.ackIds[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:20 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "009c4776-262e-4f53-ac93-c0e5602da86c", + "persistent" : true, + "scenarioName" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:modifyAckDeadline", + "requiredScenarioState" : "Started", + "newScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:modifyAckDeadline-2", + "insertionIndex" : 8 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-tgqy3dblbi.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-tgqy3dblbi.json new file mode 100644 index 00000000..7f720c25 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-tgqy3dblbi.json @@ -0,0 +1,33 @@ +{ + "id" : "b28c63e6-cc16-499c-a196-eaad5c844877", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16893496156770591\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:15 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "b28c63e6-cc16-499c-a196-eaad5c844877", + "persistent" : true, + "scenarioName" : "scenario-3-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish", + "requiredScenarioState" : "scenario-3-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-2", + "newScenarioState" : "scenario-3-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-3", + "insertionIndex" : 13 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-vvqya4omya.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-vvqya4omya.json new file mode 100644 index 00000000..a657821c --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-vvqya4omya.json @@ -0,0 +1,32 @@ +{ + "id" : "19d20a50-00c2-4cf1-a582-77a871801100", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionmodifyackdeadline", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:modifyAckDeadline?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.ackIds" + }, { + "matchesJsonPath" : "$.ackIds[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:21 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "19d20a50-00c2-4cf1-a582-77a871801100", + "persistent" : true, + "scenarioName" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:modifyAckDeadline", + "requiredScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:modifyAckDeadline-3", + "insertionIndex" : 6 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-xhegrfruee.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-xhegrfruee.json new file mode 100644 index 00000000..1f757974 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-xhegrfruee.json @@ -0,0 +1,33 @@ +{ + "id" : "e416a345-1928-4e1b-889a-107ab0fe4c3a", + "name" : "v1_projects_substrate-sdk-gcp-poc1_subscriptions_test-subscriptionpull", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/subscriptions/test-subscription:pull?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.returnImmediately" + }, { + "matchesJsonPath" : "$.maxMessages" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"receivedMessages\": [\n {\n \"ackId\": \"RFAGFixdRkhRNxkIaFEOT14jPzUgKEUaCQJPAihdeTFFMUFbcmhRDRlyfWB8O1kVB1AUUC9ZURsHaE5tdR_z36eKS0NUa1wbCAFDU35cWhgFaV5efQF54Y7NpM3ui3sJOjrngcCnbTuI59wnZiM9XhJLLD5-Jz1FQV5AEkwsCERJUytDCypYEU4EISE-MD5FUw\",\n \"message\": {\n \"data\": \"YmF0Y2gtbmFjay0x\",\n \"attributes\": {\n \"batch\": \"nack\"\n },\n \"messageId\": \"16893600313812286\",\n \"publishTime\": \"2025-10-30T18:40:15.276Z\"\n }\n }\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:18 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "e416a345-1928-4e1b-889a-107ab0fe4c3a", + "persistent" : true, + "scenarioName" : "scenario-2-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:pull", + "requiredScenarioState" : "Started", + "newScenarioState" : "scenario-2-v1-projects-substrate-sdk-gcp-poc1-subscriptions-test-subscription:pull-2", + "insertionIndex" : 11 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-zsxnjbmc1d.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-zsxnjbmc1d.json new file mode 100644 index 00000000..c67e8947 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-zsxnjbmc1d.json @@ -0,0 +1,33 @@ +{ + "id" : "e9e27174-3c27-4351-a71a-fd17a01cf690", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16893235220054904\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:40:23 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "e9e27174-3c27-4351-a71a-fd17a01cf690", + "persistent" : true, + "scenarioName" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish", + "requiredScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-2", + "newScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-3", + "insertionIndex" : 21 +} \ No newline at end of file diff --git a/pubsub/pubsub-gcp/src/test/resources/mappings/post-zzspd5mfbr.json b/pubsub/pubsub-gcp/src/test/resources/mappings/post-zzspd5mfbr.json new file mode 100644 index 00000000..c3faeec7 --- /dev/null +++ b/pubsub/pubsub-gcp/src/test/resources/mappings/post-zzspd5mfbr.json @@ -0,0 +1,33 @@ +{ + "id" : "7e24f63c-b16b-4f3e-b02b-309612aaf957", + "name" : "v1_projects_substrate-sdk-gcp-poc1_topics_test-topicpublish", + "request" : { + "url" : "/v1/projects/substrate-sdk-gcp-poc1/topics/test-topic:publish?$alt=json;enum-encoding%3Dint", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonPath" : "$.messages" + }, { + "matchesJsonPath" : "$.messages[*]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"messageIds\": [\n \"16893187740922489\"\n ]\n}\n", + "headers" : { + "X-Frame-Options" : "SAMEORIGIN", + "Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", + "Server" : "ESF", + "X-Content-Type-Options" : "nosniff", + "Vary" : [ "Origin", "X-Origin", "Referer" ], + "X-XSS-Protection" : "0", + "Date" : "Thu, 30 Oct 2025 18:38:10 GMT", + "Content-Type" : "application/json; charset=UTF-8" + } + }, + "uuid" : "7e24f63c-b16b-4f3e-b02b-309612aaf957", + "persistent" : true, + "scenarioName" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish", + "requiredScenarioState" : "Started", + "newScenarioState" : "scenario-1-v1-projects-substrate-sdk-gcp-poc1-topics-test-topic:publish-2", + "insertionIndex" : 4 +} \ No newline at end of file