本文整理汇总了Java中com.amazonaws.services.kinesis.model.CreateStreamResult类的典型用法代码示例。如果您正苦于以下问题:Java CreateStreamResult类的具体用法?Java CreateStreamResult怎么用?Java CreateStreamResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CreateStreamResult类属于com.amazonaws.services.kinesis.model包,在下文中一共展示了CreateStreamResult类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testProvisionProducerSuccessfulWithNewStream
import com.amazonaws.services.kinesis.model.CreateStreamResult; //导入依赖的package包/类
@Test
public void testProvisionProducerSuccessfulWithNewStream() {
AmazonKinesis amazonKinesisMock = mock(AmazonKinesis.class);
KinesisBinderConfigurationProperties binderProperties = new KinesisBinderConfigurationProperties();
KinesisStreamProvisioner provisioner = new KinesisStreamProvisioner(amazonKinesisMock, binderProperties);
ExtendedProducerProperties<KinesisProducerProperties> extendedProducerProperties =
new ExtendedProducerProperties<>(new KinesisProducerProperties());
String name = "test-stream";
Integer shards = 1;
DescribeStreamResult describeStreamResult =
describeStreamResultWithShards(Collections.singletonList(new Shard()));
when(amazonKinesisMock.describeStream(any(DescribeStreamRequest.class)))
.thenThrow(new ResourceNotFoundException("I got nothing"))
.thenReturn(describeStreamResult);
when(amazonKinesisMock.createStream(name, shards))
.thenReturn(new CreateStreamResult());
ProducerDestination destination = provisioner.provisionProducerDestination(name, extendedProducerProperties);
verify(amazonKinesisMock, times(2))
.describeStream(any(DescribeStreamRequest.class));
verify(amazonKinesisMock)
.createStream(name, shards);
assertThat(destination.getName()).isEqualTo(name);
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream-binder-aws-kinesis,代码行数:32,代码来源:KinesisStreamProvisionerTests.java
示例2: testProvisionConsumerSuccessfulWithNewStream
import com.amazonaws.services.kinesis.model.CreateStreamResult; //导入依赖的package包/类
@Test
public void testProvisionConsumerSuccessfulWithNewStream() {
AmazonKinesis amazonKinesisMock = mock(AmazonKinesis.class);
KinesisBinderConfigurationProperties binderProperties = new KinesisBinderConfigurationProperties();
KinesisStreamProvisioner provisioner = new KinesisStreamProvisioner(amazonKinesisMock, binderProperties);
int instanceCount = 1;
int concurrency = 1;
ExtendedConsumerProperties<KinesisConsumerProperties> extendedConsumerProperties =
new ExtendedConsumerProperties<>(new KinesisConsumerProperties());
extendedConsumerProperties.setInstanceCount(instanceCount);
extendedConsumerProperties.setConcurrency(concurrency);
String name = "test-stream";
String group = "test-group";
DescribeStreamResult describeStreamResult =
describeStreamResultWithShards(Collections.singletonList(new Shard()));
when(amazonKinesisMock.describeStream(any(DescribeStreamRequest.class)))
.thenThrow(new ResourceNotFoundException("I got nothing"))
.thenReturn(describeStreamResult);
when(amazonKinesisMock.createStream(name, instanceCount * concurrency))
.thenReturn(new CreateStreamResult());
ConsumerDestination destination = provisioner.provisionConsumerDestination(name, group,
extendedConsumerProperties);
verify(amazonKinesisMock, times(2))
.describeStream(any(DescribeStreamRequest.class));
verify(amazonKinesisMock)
.createStream(name, instanceCount * concurrency);
assertThat(destination.getName()).isEqualTo(name);
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream-binder-aws-kinesis,代码行数:39,代码来源:KinesisStreamProvisionerTests.java
示例3: createStream
import com.amazonaws.services.kinesis.model.CreateStreamResult; //导入依赖的package包/类
@Override
public CreateStreamResult createStream(CreateStreamRequest createStreamRequest) throws AmazonServiceException, AmazonClientException
{
// Setup method to create a new stream:
InternalStream stream = new InternalStream(createStreamRequest.getStreamName(), createStreamRequest.getShardCount(), true);
this.streams.add(stream);
return new CreateStreamResult();
}
示例4: createStream
import com.amazonaws.services.kinesis.model.CreateStreamResult; //导入依赖的package包/类
@Override
public CreateStreamResult createStream(CreateStreamRequest createStreamRequest) {
throw new RuntimeException("Not implemented");
}