use of org.mapstruct.ap.test.selection.qualifier.bean.AbstractEntry in project mapstruct by mapstruct.
the class NamedTest method testFactorySelectionWithQualifier.
@ProcessorTest
@WithClasses({ MovieFactoryMapper.class, ReleaseFactory.class, CreateGermanRelease.class })
@IssueKey("342")
public void testFactorySelectionWithQualifier() {
OriginalRelease foreignMovies = new OriginalRelease();
foreignMovies.setTitle("Sixth Sense, The");
foreignMovies.setKeyWords(Arrays.asList("evergreen", "magnificent"));
Map<String, List<String>> facts = new HashMap<>();
facts.put("director", Arrays.asList("M. Night Shyamalan"));
facts.put("cast", Arrays.asList("Bruce Willis", "Haley Joel Osment", "Toni Collette"));
facts.put("plot keywords", Arrays.asList("boy", "child psychologist", "I see dead people"));
foreignMovies.setFacts(facts);
AbstractEntry abstractEntry = MovieFactoryMapper.INSTANCE.toGerman(foreignMovies);
assertThat(abstractEntry).isNotNull();
assertThat(abstractEntry).isInstanceOf(GermanRelease.class);
assertThat(abstractEntry.getTitle()).isEqualTo("Sixth Sense, The");
assertThat(abstractEntry.getKeyWords()).isNotNull();
assertThat(abstractEntry.getKeyWords().size()).isEqualTo(2);
assertThat(abstractEntry.getKeyWords()).containsSequence("evergreen", "magnificent");
assertThat(abstractEntry.getFacts()).isNotNull();
assertThat(abstractEntry.getFacts()).hasSize(3);
assertThat(abstractEntry.getFacts()).contains(entry("director", Arrays.asList("M. Night Shyamalan")), entry("cast", Arrays.asList("Bruce Willis", "Haley Joel Osment", "Toni Collette")), entry("plot keywords", Arrays.asList("boy", "child psychologist", "I see dead people")));
}
use of org.mapstruct.ap.test.selection.qualifier.bean.AbstractEntry in project mapstruct by mapstruct.
the class QualifierTest method testFactorySelectionWithQualifier.
@ProcessorTest
@WithClasses({ MovieFactoryMapper.class, ReleaseFactory.class, CreateGermanRelease.class })
@IssueKey("342")
public void testFactorySelectionWithQualifier() {
OriginalRelease foreignMovies = new OriginalRelease();
foreignMovies.setTitle("Sixth Sense, The");
foreignMovies.setKeyWords(Arrays.asList("evergreen", "magnificent"));
Map<String, List<String>> facts = new HashMap<>();
facts.put("director", Arrays.asList("M. Night Shyamalan"));
facts.put("cast", Arrays.asList("Bruce Willis", "Haley Joel Osment", "Toni Collette"));
facts.put("plot keywords", Arrays.asList("boy", "child psychologist", "I see dead people"));
foreignMovies.setFacts(facts);
AbstractEntry abstractEntry = MovieFactoryMapper.INSTANCE.toGerman(foreignMovies);
assertThat(abstractEntry).isNotNull();
assertThat(abstractEntry).isInstanceOf(GermanRelease.class);
assertThat(abstractEntry.getTitle()).isEqualTo("Sixth Sense, The");
assertThat(abstractEntry.getKeyWords()).isNotNull();
assertThat(abstractEntry.getKeyWords().size()).isEqualTo(2);
assertThat(abstractEntry.getKeyWords()).containsSequence("evergreen", "magnificent");
assertThat(abstractEntry.getFacts()).isNotNull();
assertThat(abstractEntry.getFacts()).hasSize(3);
assertThat(abstractEntry.getFacts()).contains(entry("director", Arrays.asList("M. Night Shyamalan")), entry("cast", Arrays.asList("Bruce Willis", "Haley Joel Osment", "Toni Collette")), entry("plot keywords", Arrays.asList("boy", "child psychologist", "I see dead people")));
}
Aggregations