@Test void createInstance_stackWithNextTag_returnsStackResourceRegistryBuildWithTwoPages() throws Exception { AmazonCloudFormation cloudFormationClient = mock(AmazonCloudFormation.class); StackResourceRegistryFactoryBean stackResourceRegistryFactoryBean = new StackResourceRegistryFactoryBean( cloudFormationClient, new StaticStackNameProvider(STACK_NAME)); when(cloudFormationClient.listStackResources( new ListStackResourcesRequest().withStackName(STACK_NAME))) .thenReturn(new ListStackResourcesResult().withNextToken("2") .withStackResourceSummaries(new StackResourceSummary() .withLogicalResourceId("log1"))); when(cloudFormationClient.listStackResources(new ListStackResourcesRequest() .withStackName(STACK_NAME).withNextToken("2"))) .thenReturn(new ListStackResourcesResult() .withStackResourceSummaries(new StackResourceSummary() .withLogicalResourceId("log2"))); ListableStackResourceFactory stackResourceFactory = stackResourceRegistryFactoryBean .createInstance(); verify(cloudFormationClient, times(2)) .listStackResources(isA(ListStackResourcesRequest.class)); assertThat(stackResourceFactory.getAllResources().size()).isEqualTo(2); }
@Override protected ListableStackResourceFactory createInstance() { String stackName = this.stackNameProvider.getStackName(); return new StaticStackResourceRegistry(stackName, getResourceMappings("", stackName)); }
StackResourceRegistryFactoryBean extends AbstractFactoryBean<ListableStackResourceFactory> { @Override protected ListableStackResourceFactory createInstance() { String stackName = this.stackNameProvider.getStackName(); return new StaticStackResourceRegistry(stackName, getResourceMappings("", stackName)); } }
StackResourceRegistryFactoryBean extends AbstractFactoryBean<ListableStackResourceFactory> { @Override protected ListableStackResourceFactory createInstance() { String stackName = this.stackNameProvider.getStackName(); return new StaticStackResourceRegistry(stackName, getResourceMappings("", stackName)); } StackResourceRegistryFactoryBean(
			AmazonCloudFormation amazonCloudFormationClient,
			StackNameProvider stackNameProvider); }
StackResourceRegistryFactoryBean extends AbstractFactoryBean<ListableStackResourceFactory> { @Override protected ListableStackResourceFactory createInstance() { String stackName = this.stackNameProvider.getStackName(); return new StaticStackResourceRegistry(stackName, getResourceMappings("", stackName)); } StackResourceRegistryFactoryBean(
			AmazonCloudFormation amazonCloudFormationClient,
			StackNameProvider stackNameProvider); @Override Class<?> getObjectType(); }
StackResourceRegistryFactoryBean extends AbstractFactoryBean<ListableStackResourceFactory> { @Override protected ListableStackResourceFactory createInstance() { String stackName = this.stackNameProvider.getStackName(); return new StaticStackResourceRegistry(stackName, getResourceMappings("", stackName)); } StackResourceRegistryFactoryBean(
			AmazonCloudFormation amazonCloudFormationClient,
			StackNameProvider stackNameProvider); @Override Class<?> getObjectType();  }