use of org.mapstruct.ap.test.imports.from.Foo in project mapstruct by mapstruct.
the class ConflictingTypesNamesTest method mapperImportingTypesWithConflictingNamesCanBeGenerated.
@ProcessorTest
public void mapperImportingTypesWithConflictingNamesCanBeGenerated() {
Named source = new Named();
source.setFoo(123);
source.setBar(456L);
ParseException target = SourceTargetMapper.INSTANCE.sourceToTarget(source);
assertThat(target).isNotNull();
Foo foo = new Foo();
foo.setName("bar");
org.mapstruct.ap.test.imports.to.Foo foo2 = SourceTargetMapper.INSTANCE.fooToFoo(foo);
assertThat(foo2).isNotNull();
assertThat(foo2.getName()).isEqualTo("bar");
}
use of org.mapstruct.ap.test.imports.from.Foo in project mapstruct by mapstruct.
the class ConflictingTypesNamesTest method importsForTargetTypes.
@ProcessorTest
@IssueKey("156")
public void importsForTargetTypes() {
FooWrapper source = new FooWrapper();
Foo value = new Foo();
value.setName("foo");
source.setValue(value);
org.mapstruct.ap.test.imports.to.FooWrapper result = SecondSourceTargetMapper.INSTANCE.fooWrapperToFooWrapper(source);
assertThat(result).isNotNull();
assertThat(result.getValue()).isNotNull();
assertThat(result.getValue().getName()).isEqualTo("foo");
}
Aggregations