@Test void matchesShouldReturnFalseIfTypePatternDoesNotMatch() { ResourceCreatorConfiguration configuration = createMatcherTestConfiguration("provider_.*", "type_.*"); CompiledResourceCreatorConfiguration compiledResourceCreatorConfiguration = new CompiledResourceCreatorConfiguration(configuration); TerraformResource resource = mock(TerraformResource.class); when(resource.getProviderName()).thenReturn("provider_matching"); when(resource.getType()).thenReturn("type1_not_matching"); boolean matches = compiledResourceCreatorConfiguration.matches(resource); assertThat(matches).isFalse(); verify(resource, times(1)).getType(); }
public boolean matches(TerraformResource resource) { return typePattern.matcher(resource.getType()).matches() && providerPattern.matcher(resource.getProviderName()).matches(); }
CompiledResourceCreatorConfiguration { public boolean matches(TerraformResource resource) { return typePattern.matcher(resource.getType()).matches() && providerPattern.matcher(resource.getProviderName()).matches(); } }
CompiledResourceCreatorConfiguration { public boolean matches(TerraformResource resource) { return typePattern.matcher(resource.getType()).matches() && providerPattern.matcher(resource.getProviderName()).matches(); } CompiledResourceCreatorConfiguration(ResourceCreatorConfiguration resourceCreatorConfiguration); }
CompiledResourceCreatorConfiguration { public boolean matches(TerraformResource resource) { return typePattern.matcher(resource.getType()).matches() && providerPattern.matcher(resource.getProviderName()).matches(); } CompiledResourceCreatorConfiguration(ResourceCreatorConfiguration resourceCreatorConfiguration); boolean matches(TerraformResource resource); Collection<VirtualTerraformResource> apply(TerraformResource resource); }
CompiledResourceCreatorConfiguration { public boolean matches(TerraformResource resource) { return typePattern.matcher(resource.getType()).matches() && providerPattern.matcher(resource.getProviderName()).matches(); } CompiledResourceCreatorConfiguration(ResourceCreatorConfiguration resourceCreatorConfiguration); boolean matches(TerraformResource resource); Collection<VirtualTerraformResource> apply(TerraformResource resource);  }