use of cn.taketoday.core.env.AbstractEnvironment in project today-infrastructure by TAKETODAY.
the class EnvironmentConverterTests method convertedEnvironmentHasSameActiveProfiles.
@Test
void convertedEnvironmentHasSameActiveProfiles() {
AbstractEnvironment originalEnvironment = new MockEnvironment();
originalEnvironment.setActiveProfiles("activeProfile1", "activeProfile2");
StandardEnvironment convertedEnvironment = EnvironmentConverter.convertIfNecessary(getClass().getClassLoader(), originalEnvironment, StandardEnvironment.class);
assertThat(convertedEnvironment.getActiveProfiles()).containsExactly("activeProfile1", "activeProfile2");
}
use of cn.taketoday.core.env.AbstractEnvironment in project today-framework by TAKETODAY.
the class EnvironmentConverterTests method convertedEnvironmentHasSameConversionService.
@Test
void convertedEnvironmentHasSameConversionService() {
AbstractEnvironment originalEnvironment = new MockEnvironment();
ConfigurableConversionService conversionService = mock(ConfigurableConversionService.class);
originalEnvironment.setConversionService(conversionService);
StandardEnvironment convertedEnvironment = EnvironmentConverter.convertIfNecessary(getClass().getClassLoader(), originalEnvironment, StandardEnvironment.class);
assertThat(convertedEnvironment.getConversionService()).isEqualTo(conversionService);
}
use of cn.taketoday.core.env.AbstractEnvironment in project today-framework by TAKETODAY.
the class EnvironmentConverterTests method convertedEnvironmentHasSameActiveProfiles.
@Test
void convertedEnvironmentHasSameActiveProfiles() {
AbstractEnvironment originalEnvironment = new MockEnvironment();
originalEnvironment.setActiveProfiles("activeProfile1", "activeProfile2");
StandardEnvironment convertedEnvironment = EnvironmentConverter.convertIfNecessary(getClass().getClassLoader(), originalEnvironment, StandardEnvironment.class);
assertThat(convertedEnvironment.getActiveProfiles()).containsExactly("activeProfile1", "activeProfile2");
}
use of cn.taketoday.core.env.AbstractEnvironment in project today-infrastructure by TAKETODAY.
the class EnvironmentConverterTests method convertedEnvironmentHasSameConversionService.
@Test
void convertedEnvironmentHasSameConversionService() {
AbstractEnvironment originalEnvironment = new MockEnvironment();
ConfigurableConversionService conversionService = mock(ConfigurableConversionService.class);
originalEnvironment.setConversionService(conversionService);
StandardEnvironment convertedEnvironment = EnvironmentConverter.convertIfNecessary(getClass().getClassLoader(), originalEnvironment, StandardEnvironment.class);
assertThat(convertedEnvironment.getConversionService()).isEqualTo(conversionService);
}
Aggregations