use of org.mapstruct.ap.test.builder.multiple.builder.Case in project mapstruct by mapstruct.
the class MultipleBuilderMapperTest method tooManyBuilderCreationMethods.
@WithClasses({ TooManyBuilderCreationMethodsMapper.class })
@ExpectedCompilationOutcome(value = CompilationResult.SUCCEEDED, diagnostics = { @Diagnostic(type = Case.class, kind = javax.tools.Diagnostic.Kind.WARNING, line = 11, message = "More than one builder creation method for \"org.mapstruct.ap.test.builder.multiple.builder" + ".Case\". Found methods: \"wrongBuilder(), builder()\". Builder will not be used. Consider " + "implementing a custom BuilderProvider SPI.") })
@ProcessorTest
public void tooManyBuilderCreationMethods() {
Case caseTarget = TooManyBuilderCreationMethodsMapper.INSTANCE.map(new Source("test"));
assertThat(caseTarget).isNotNull();
assertThat(caseTarget.getName()).isEqualTo("test");
assertThat(caseTarget.getBuilderCreationMethod()).isNull();
assertThat(caseTarget.getBuildMethod()).isEqualTo("constructor");
}
Aggregations