Java 类com.amazonaws.services.sns.model.DeleteTopicResult 实例源码

项目:unitstack    文件:MockSnsTest.java   
@Test
public void testCreateListDeleteTopic_shouldCreateReturnAndDelete() {
  mockSns(new MockParameters());

  ListTopicsResult listTopicResultBefore = sns.listTopics();
  assertEquals("topic list should contain zero items before insert",0,listTopicResultBefore.getTopics().size());

  CreateTopicRequest create = new CreateTopicRequest()
      .withName("major-topic");
  CreateTopicResult createResult = sns.createTopic(create);
  String topicArn = createResult.getTopicArn();
  assertNotNull("verify returned topic ARN", topicArn);

  ListTopicsResult listTopicResult = sns.listTopics();
  assertEquals("after insert topic list should contain 1 item",1,listTopicResult.getTopics().size());
  assertEquals("after insert topic list should contain before inserted topic arn", topicArn, 
      listTopicResult.getTopics().get(0).getTopicArn());

  DeleteTopicResult deleteResult = sns.deleteTopic(topicArn);
  assertNotNull(deleteResult);

  ListTopicsResult listTopicsAfterDeletion = sns.listTopics();
  assertEquals("topic list should contain zero items after deletion",0,listTopicsAfterDeletion.getTopics().size());
}
项目:awslocal    文件:InMemorySNS.java   
@Override
public DeleteTopicResult deleteTopic(DeleteTopicRequest deleteTopicRequest) throws AmazonClientException {
    List<String> subscriptions = Objects.firstNonNull(
            _subscriptionsForTopic.remove(deleteTopicRequest.getTopicArn()),
            new ArrayList<String>());
    for (String subscription : subscriptions) {
        _subscriptionsByArn.remove(subscription);
    }
    return new DeleteTopicResult();
}
项目:Java-9-Programming-Blueprints    文件:SnsClient.java   
private DeleteTopicResult deleteTopic(String arn) {
    return snsClient.deleteTopic(arn);
}
项目:Camel    文件:AmazonSNSClientMock.java   
@Override
public DeleteTopicResult deleteTopic(DeleteTopicRequest deleteTopicRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException();
}