Search in sources :

Example 21 with Origin

use of cn.taketoday.origin.Origin in project today-infrastructure by TAKETODAY.

the class ConfigDataLocationTests method splitWhenHasOriginReturnsElementsWithOriginSet.

@Test
void splitWhenHasOriginReturnsElementsWithOriginSet() {
    Origin origin = mock(Origin.class);
    ConfigDataLocation location = ConfigDataLocation.valueOf("a;b").withOrigin(origin);
    ConfigDataLocation[] split = location.split();
    assertThat(split[0].getOrigin()).isEqualTo(origin);
    assertThat(split[1].getOrigin()).isEqualTo(origin);
}
Also used : Origin(cn.taketoday.origin.Origin) Test(org.junit.jupiter.api.Test)

Example 22 with Origin

use of cn.taketoday.origin.Origin in project today-infrastructure by TAKETODAY.

the class ConfigurationPropertyTests method getPropertyOriginShouldReturnValuePropertyOrigin.

@Test
void getPropertyOriginShouldReturnValuePropertyOrigin() {
    Origin origin = mock(Origin.class);
    OriginProvider property = ConfigurationProperty.of(this.source, NAME, "foo", origin);
    assertThat(property.getOrigin()).isEqualTo(origin);
}
Also used : Origin(cn.taketoday.origin.Origin) OriginProvider(cn.taketoday.origin.OriginProvider) Test(org.junit.jupiter.api.Test)

Aggregations

Origin (cn.taketoday.origin.Origin)22 Test (org.junit.jupiter.api.Test)14 ConfigurationProperty (cn.taketoday.context.properties.source.ConfigurationProperty)4 ConfigurationPropertyName (cn.taketoday.context.properties.source.ConfigurationPropertyName)4 ArrayList (java.util.ArrayList)4 ConfigurableApplicationContext (cn.taketoday.context.ConfigurableApplicationContext)2 BindContext (cn.taketoday.context.properties.bind.BindContext)2 BindHandler (cn.taketoday.context.properties.bind.BindHandler)2 Bindable (cn.taketoday.context.properties.bind.Bindable)2 Binder (cn.taketoday.context.properties.bind.Binder)2 FailureAnalysis (cn.taketoday.framework.diagnostics.FailureAnalysis)2 Nullable (cn.taketoday.lang.Nullable)2 MockOrigin (cn.taketoday.origin.MockOrigin)2 OriginProvider (cn.taketoday.origin.OriginProvider)2 TextResourceOrigin (cn.taketoday.origin.TextResourceOrigin)2 Location (cn.taketoday.origin.TextResourceOrigin.Location)2 FieldError (cn.taketoday.validation.FieldError)2 ObjectError (cn.taketoday.validation.ObjectError)2 LinkedHashSet (java.util.LinkedHashSet)2