use of org.springframework.test.context.DynamicPropertyRegistry in project spring-framework by bluecrow1986.
the class DynamicPropertiesContextCustomizer method buildDynamicPropertiesMap.
private Map<String, Supplier<Object>> buildDynamicPropertiesMap() {
Map<String, Supplier<Object>> map = new LinkedHashMap<>();
DynamicPropertyRegistry dynamicPropertyRegistry = (name, valueSupplier) -> {
Assert.hasText(name, "'name' must not be null or blank");
Assert.notNull(valueSupplier, "'valueSupplier' must not be null");
map.put(name, valueSupplier);
};
this.methods.forEach(method -> {
ReflectionUtils.makeAccessible(method);
ReflectionUtils.invokeMethod(method, null, dynamicPropertyRegistry);
});
return Collections.unmodifiableMap(map);
}
use of org.springframework.test.context.DynamicPropertyRegistry in project spring-framework by spring-projects.
the class DynamicPropertiesContextCustomizer method buildDynamicPropertiesMap.
private Map<String, Supplier<Object>> buildDynamicPropertiesMap() {
Map<String, Supplier<Object>> map = new LinkedHashMap<>();
DynamicPropertyRegistry dynamicPropertyRegistry = (name, valueSupplier) -> {
Assert.hasText(name, "'name' must not be null or blank");
Assert.notNull(valueSupplier, "'valueSupplier' must not be null");
map.put(name, valueSupplier);
};
this.methods.forEach(method -> {
ReflectionUtils.makeAccessible(method);
ReflectionUtils.invokeMethod(method, null, dynamicPropertyRegistry);
});
return Collections.unmodifiableMap(map);
}
use of org.springframework.test.context.DynamicPropertyRegistry in project spring-framework-5.2.9.RELEASE by somepeopleHavingDream.
the class DynamicPropertiesContextCustomizer method buildDynamicPropertiesMap.
private Map<String, Supplier<Object>> buildDynamicPropertiesMap() {
Map<String, Supplier<Object>> map = new LinkedHashMap<>();
DynamicPropertyRegistry dynamicPropertyRegistry = (name, valueSupplier) -> {
Assert.hasText(name, "'name' must not be null or blank");
Assert.notNull(valueSupplier, "'valueSupplier' must not be null");
map.put(name, valueSupplier);
};
this.methods.forEach(method -> {
ReflectionUtils.makeAccessible(method);
ReflectionUtils.invokeMethod(method, null, dynamicPropertyRegistry);
});
return Collections.unmodifiableMap(map);
}
use of org.springframework.test.context.DynamicPropertyRegistry in project spring-framework-debug by Joker-5.
the class DynamicPropertiesContextCustomizer method buildDynamicPropertiesMap.
private Map<String, Supplier<Object>> buildDynamicPropertiesMap() {
Map<String, Supplier<Object>> map = new LinkedHashMap<>();
DynamicPropertyRegistry dynamicPropertyRegistry = (name, valueSupplier) -> {
Assert.hasText(name, "'name' must not be null or blank");
Assert.notNull(valueSupplier, "'valueSupplier' must not be null");
map.put(name, valueSupplier);
};
this.methods.forEach(method -> {
ReflectionUtils.makeAccessible(method);
ReflectionUtils.invokeMethod(method, null, dynamicPropertyRegistry);
});
return Collections.unmodifiableMap(map);
}
Aggregations