"}" +
"}";
cns2.setSubscriptionAttributes(new SetSubscriptionAttributesRequest(subscriptionArn1, attributeName2, attributeValue2));
GetSubscriptionAttributesResult result = cns3.getSubscriptionAttributes(new GetSubscriptionAttributesRequest(subscriptionArn2));
{
JSONObject effectiveDeliveryPolicy = new JSONObject(result.getAttributes().get("EffectiveDeliveryPolicy"));
assertTrue(effectiveDeliveryPolicy.has("healthyRetryPolicy"));
JSONObject healthyRetryPolicy = effectiveDeliveryPolicy.getJSONObject("healthyRetryPolicy");
assertTrue(healthyRetryPolicy != null);
assertTrue("healthyRetryPolicy.numRetries returns incorrect value", healthyRetryPolicy.getInt("numRetries") == 30);
assertTrue("healthyRetryPolicy.minDelayTarget returns incorrect value", healthyRetryPolicy.getInt("minDelayTarget") == 10);
assertTrue("healthyRetryPolicy.maxDelayTarget returns incorrect value", healthyRetryPolicy.getInt("maxDelayTarget") == 10);
assertTrue("healthyRetryPolicy.numMinDelayRetries returns incorrect value", healthyRetryPolicy.getInt("numMinDelayRetries") == 11);
assertTrue("healthyRetryPolicy.numMaxDelayRetries returns incorrect value", healthyRetryPolicy.getInt("numMaxDelayRetries") == 11);
assertTrue("healthyRetryPolicy.numNoDelayRetries returns incorrect value", healthyRetryPolicy.getInt("numNoDelayRetries") == 0);
assertTrue("healthyRetryPolicy.backoffFunction returns incorrect value", healthyRetryPolicy.getString("backoffFunction").equals("geometric"));
assertTrue(effectiveDeliveryPolicy.has("sicklyRetryPolicy"));
JSONObject sicklyRetryPolicy = effectiveDeliveryPolicy.getJSONObject("sicklyRetryPolicy");
assertTrue(sicklyRetryPolicy != null);
assertTrue("sicklyRetryPolicy.numRetries returns incorrect value", sicklyRetryPolicy.getInt("numRetries") == 16);
assertTrue("sicklyRetryPolicy.minDelayTarget returns incorrect value", sicklyRetryPolicy.getInt("minDelayTarget") == 1);
assertTrue("sicklyRetryPolicy.maxDelayTarget returns incorrect value", sicklyRetryPolicy.getInt("maxDelayTarget") == 3);
assertTrue("sicklyRetryPolicy.numMinDelayRetries returns incorrect value", sicklyRetryPolicy.getInt("numMinDelayRetries") == 1);
assertTrue("sicklyRetryPolicy.numMaxDelayRetries returns incorrect value", sicklyRetryPolicy.getInt("numMaxDelayRetries") == 3);
assertTrue("sicklyRetryPolicy.numNoDelayRetries returns incorrect value", sicklyRetryPolicy.getInt("numNoDelayRetries") == 3);
assertTrue("sicklyRetryPolicy.backoffFunction returns incorrect value", sicklyRetryPolicy.getString("backoffFunction").equals("exponential"));
assertTrue(effectiveDeliveryPolicy.has("throttlePolicy"));
JSONObject throttlePolicy = effectiveDeliveryPolicy.getJSONObject("throttlePolicy");
assertTrue(throttlePolicy.getInt("maxReceivesPerSecond") == 3);
assertTrue(result.getAttributes().get("ConfirmationWasAuthenticated").equals("false"));
JSONObject deliveryPolicy = new JSONObject(result.getAttributes().get("DeliveryPolicy"));
assertTrue(deliveryPolicy.has("healthyRetryPolicy"));
healthyRetryPolicy = deliveryPolicy.getJSONObject("healthyRetryPolicy");
assertTrue(healthyRetryPolicy != null);
assertTrue("healthyRetryPolicy.numRetries returns incorrect value", healthyRetryPolicy.getInt("numRetries") == 30);
assertTrue("healthyRetryPolicy.minDelayTarget returns incorrect value", healthyRetryPolicy.getInt("minDelayTarget") == 10);
assertTrue("healthyRetryPolicy.maxDelayTarget returns incorrect value", healthyRetryPolicy.getInt("maxDelayTarget") == 10);
assertTrue("healthyRetryPolicy.numMinDelayRetries returns incorrect value", healthyRetryPolicy.getInt("numMinDelayRetries") == 11);
assertTrue("healthyRetryPolicy.numMaxDelayRetries returns incorrect value", healthyRetryPolicy.getInt("numMaxDelayRetries") == 11);
assertTrue("healthyRetryPolicy.numNoDelayRetries returns incorrect value", healthyRetryPolicy.getInt("numNoDelayRetries") == 0);
assertTrue("healthyRetryPolicy.backoffFunction returns incorrect value", healthyRetryPolicy.getString("backoffFunction").equals("geometric"));
assertTrue(deliveryPolicy.has("sicklyRetryPolicy"));
assertTrue(deliveryPolicy.has("throttlePolicy"));
throttlePolicy = deliveryPolicy.getJSONObject("throttlePolicy");
assertTrue(throttlePolicy.getInt("maxReceivesPerSecond") == 3);
sicklyRetryPolicy = deliveryPolicy.getJSONObject("sicklyRetryPolicy");
assertTrue(sicklyRetryPolicy != null);
assertTrue("sicklyRetryPolicy.numRetries returns incorrect value", sicklyRetryPolicy.getInt("numRetries") == 16);
assertTrue("sicklyRetryPolicy.minDelayTarget returns incorrect value", sicklyRetryPolicy.getInt("minDelayTarget") == 1);
assertTrue("sicklyRetryPolicy.maxDelayTarget returns incorrect value", sicklyRetryPolicy.getInt("maxDelayTarget") == 3);
assertTrue("sicklyRetryPolicy.numMinDelayRetries returns incorrect value", sicklyRetryPolicy.getInt("numMinDelayRetries") == 1);
assertTrue("sicklyRetryPolicy.numMaxDelayRetries returns incorrect value", sicklyRetryPolicy.getInt("numMaxDelayRetries") == 3);
assertTrue("sicklyRetryPolicy.numNoDelayRetries returns incorrect value", sicklyRetryPolicy.getInt("numNoDelayRetries") == 3);
assertTrue("sicklyRetryPolicy.backoffFunction returns incorrect value", sicklyRetryPolicy.getString("backoffFunction").equals("exponential"));
assertTrue(result.getAttributes().get("TopicArn").equals(topicArn));
assertTrue(result.getAttributes().get("SubscriptionArn").equals(subscriptionArn2));
}
result = cns2.getSubscriptionAttributes(new GetSubscriptionAttributesRequest(subscriptionArn1));
{
JSONObject effectiveDeliveryPolicy = new JSONObject(result.getAttributes().get("EffectiveDeliveryPolicy"));
assertTrue(effectiveDeliveryPolicy.has("healthyRetryPolicy"));