@Test public void testSetGetSubscriptionAttributes_shouldSetAndRespondSubscriptionAttributes() { mockSns(new MockParameters()); // create topic and subscription CreateTopicResult topicResult = sns.createTopic(new CreateTopicRequest().withName("important-topic")); SubscribeResult subscribeResult = sns.subscribe(new SubscribeRequest().withTopicArn(topicResult.getTopicArn()) .withProtocol("sqs").withEndpoint("arn:aws:sqs:us-east-1:123456789012:queue1")); // set subscription attribute SetSubscriptionAttributesResult setAttrResult = sns.setSubscriptionAttributes(new SetSubscriptionAttributesRequest() .withAttributeName("unicorns-exist").withAttributeValue("only in scotland").withSubscriptionArn(subscribeResult.getSubscriptionArn())); assertNotNull("verify setting attributes result", setAttrResult); // get subscription attribute GetSubscriptionAttributesResult subAttributes = sns.getSubscriptionAttributes(new GetSubscriptionAttributesRequest() .withSubscriptionArn(subscribeResult.getSubscriptionArn())); assertEquals("verify subscription attribute","only in scotland",subAttributes.getAttributes().get("unicorns-exist")); }
@Override public void setAttributes(String attributeName, String attributeValue, ResultCapture<Void> extractor) { SetSubscriptionAttributesRequest request = new SetSubscriptionAttributesRequest() .withAttributeName(attributeName) .withAttributeValue(attributeValue); setAttributes(request, extractor); }
@Test public void testSetSubscriptionAttributes_withNoRequestParams_shouldWork() { mockSns(new MockParameters()); assertNotNull(sns.setSubscriptionAttributes(new SetSubscriptionAttributesRequest())); }
@Override public void setAttributes(SetSubscriptionAttributesRequest request) { setAttributes(request, null); }
@Override public void setAttributes(SetSubscriptionAttributesRequest request, ResultCapture<Void> extractor) { resource.performAction("SetAttributes", request, extractor); }
/** * Performs the <code>SetAttributes</code> action. * * <p> * The following request parameters will be populated from the data of this * <code>Subscription</code> resource, and any conflicting parameter value * set in the request will be overridden: * <ul> * <li> * <b><code>SubscriptionArn</code></b> * - mapped from the <code>Arn</code> identifier. * </li> * </ul> * * <p> * * @see SetSubscriptionAttributesRequest */ void setAttributes(SetSubscriptionAttributesRequest request);
/** * Performs the <code>SetAttributes</code> action and use a ResultCapture to * retrieve the low-level client response. * * <p> * The following request parameters will be populated from the data of this * <code>Subscription</code> resource, and any conflicting parameter value * set in the request will be overridden: * <ul> * <li> * <b><code>SubscriptionArn</code></b> * - mapped from the <code>Arn</code> identifier. * </li> * </ul> * * <p> * * @see SetSubscriptionAttributesRequest */ void setAttributes(SetSubscriptionAttributesRequest request, ResultCapture<Void> extractor);