use of org.mapstruct.ap.test.bugs._2170.entity.Person in project lzl_workspace by hpulzl.
the class test method xmlBeanFactory.
public static void xmlBeanFactory() {
// 加载配置文件
ClassPathResource resource = new ClassPathResource("ApplicationContext.xml");
// 解析文件
BeanFactory beanFactory = new XmlBeanFactory(resource);
// 创建对应bean,依赖注入过程
Person p = (Person) beanFactory.getBean("person");
System.out.println("p = " + p);
}
use of org.mapstruct.ap.test.bugs._2170.entity.Person in project mapstruct by mapstruct.
the class Issue2170Test method shouldGenerateCodeThatCompiles.
@ProcessorTest
public void shouldGenerateCodeThatCompiles() {
AddressDto addressDto = AddressMapper.INSTANCE.toDto(new Address("10000", Collections.singletonList(new Person("Tester"))));
assertThat(addressDto).isNotNull();
assertThat(addressDto.getZipCode()).isEqualTo("10000");
assertThat(addressDto.getPeople()).extracting(PersonDto::getName).containsExactly("Tester");
}
use of org.mapstruct.ap.test.bugs._2170.entity.Person in project lzl_workspace by hpulzl.
the class test method defaultListableBeanFactory.
public static void defaultListableBeanFactory() {
// 加载配置文件
ClassPathResource resource = new ClassPathResource("ApplicationContext.xml");
DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory);
reader.loadBeanDefinitions(resource);
// 输出
Person p = (Person) factory.getBean("person");
System.out.println("p = " + p);
}
Aggregations