forked from public-mirrors/ConfigLib
Add toBuilder method to create a builder from a properties object
parent
7c4f630f7c
commit
f70c44f159
@ -0,0 +1,22 @@
|
|||||||
|
package de.exlll.configlib;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
|
import static org.hamcrest.Matchers.is;
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class YamlConfigurationPropertiesTest {
|
||||||
|
@Test
|
||||||
|
void builderCtorCopiesValues() {
|
||||||
|
YamlConfigurationProperties properties = YamlConfigurationProperties.newBuilder()
|
||||||
|
.outputNulls(true)
|
||||||
|
.header("A")
|
||||||
|
.build()
|
||||||
|
.toBuilder()
|
||||||
|
.build();
|
||||||
|
|
||||||
|
assertThat(properties.outputNulls(), is(true));
|
||||||
|
assertThat(properties.getHeader(), is("A"));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue