use of org.springframework.core.io.ProtocolResolver in project spring-boot by spring-projects.
the class ConfigurationPropertiesTests method customProtocolResolverIsInvoked.
@Test
void customProtocolResolverIsInvoked() {
this.context = new AnnotationConfigApplicationContext();
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.context, "test.resource=application.properties");
ProtocolResolver protocolResolver = mock(ProtocolResolver.class);
given(protocolResolver.resolve(anyString(), any(ResourceLoader.class))).willReturn(null);
this.context.addProtocolResolver(protocolResolver);
this.context.register(PropertiesWithResource.class);
this.context.refresh();
then(protocolResolver).should().resolve(eq("application.properties"), any(ResourceLoader.class));
}
Aggregations