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

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

  AddPermissionRequest addPermissionRequest = new AddPermissionRequest()
      .withActionNames(ImmutableList.of("READ", "WRITE"))
      .withAWSAccountIds(ImmutableList.of("1", "2")).withLabel("unsecure-topic").withTopicArn(
          "arn:aws:sns:us-east-1:123456789012:my_corporate_topic:02034b43-fefa-4e07-a5eb-3be56f8c54ce");

  AddPermissionResult result = sns.addPermission(addPermissionRequest);

  assertNotNull("verify adding permission returns ok", result);
}
项目:unitstack    文件:MockSnsTest.java   
@Test
public void testAddPermissionAsync_shouldWork() throws InterruptedException, ExecutionException {
  mockSns(new MockParameters());

  AddPermissionRequest addPermissionRequest = new AddPermissionRequest()
      .withActionNames(ImmutableList.of("READ", "WRITE"))
      .withAWSAccountIds(ImmutableList.of("1", "2")).withLabel("unsecure-topic").withTopicArn(
          "arn:aws:sns:us-east-1:123456789012:my_corporate_topic:02034b43-fefa-4e07-a5eb-3be56f8c54ce");

  Future<AddPermissionResult> result = sns.addPermissionAsync(addPermissionRequest);
  assertNotNull("verify also async call works fine", result.get());
}
项目:unitstack    文件:MockSnsTest.java   
@Test
public void testAddPermissionAsync_withNoRequestParams_shouldWork() throws InterruptedException, ExecutionException {
  mockSns(new MockParameters());
  Future<AddPermissionResult> result = sns.addPermissionAsync(new AddPermissionRequest());
  assertNotNull(result.get());
}
项目:Camel    文件:AmazonSNSClientMock.java   
@Override
public AddPermissionResult addPermission(AddPermissionRequest addPermissionRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException();
}