use of org.apache.logging.log4j.plugins.test.validation.ValidatingPluginWithTypedBuilder in project logging-log4j2 by apache.
the class ValidatingPluginWithTypedBuilderTest method testNullDefaultValue.
@Test
public void testNullDefaultValue() throws Exception {
// @formatter:off
final ValidatingPluginWithTypedBuilder validatingPlugin = (ValidatingPluginWithTypedBuilder) new PluginBuilder(plugin).setConfiguration(new NullConfiguration()).setConfigurationNode(node).build();
// @formatter:on
assertNull(validatingPlugin);
}
use of org.apache.logging.log4j.plugins.test.validation.ValidatingPluginWithTypedBuilder in project logging-log4j2 by apache.
the class ValidatingPluginWithTypedBuilderTest method testNonNullValue.
@Test
public void testNonNullValue() throws Exception {
node.getAttributes().put("name", "foo");
// @formatter:off
final ValidatingPluginWithTypedBuilder validatingPlugin = (ValidatingPluginWithTypedBuilder) new PluginBuilder(plugin).setConfiguration(new NullConfiguration()).setConfigurationNode(node).build();
// @formatter:on
assertNotNull(validatingPlugin);
assertEquals("foo", validatingPlugin.getName());
}
use of org.apache.logging.log4j.plugins.test.validation.ValidatingPluginWithTypedBuilder in project logging-log4j2 by apache.
the class ValidatingPluginWithTypedBuilderTest method setUp.
@SuppressWarnings("unchecked")
@BeforeEach
public void setUp() throws Exception {
final PluginManager manager = new PluginManager("Test");
manager.collectPlugins();
plugin = (PluginType<ValidatingPluginWithTypedBuilder>) manager.getPluginType("ValidatingPluginWithTypedBuilder");
assertNotNull(plugin, "Rebuild this module to make sure annotation processing kicks in.");
node = new Node(null, "Validator", plugin);
}
Aggregations