diff --git a/processor/src/test/java/org/mapstruct/ap/test/accessibility/referenced/ReferencedAccessibilityTest.java b/processor/src/test/java/org/mapstruct/ap/test/accessibility/referenced/ReferencedAccessibilityTest.java index 1516e3769..eb36ad966 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/accessibility/referenced/ReferencedAccessibilityTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/accessibility/referenced/ReferencedAccessibilityTest.java @@ -37,7 +37,7 @@ public class ReferencedAccessibilityTest { diagnostics = { @Diagnostic(type = SourceTargetMapperPrivate.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 35, + line = 22, messageRegExp = "Unmapped target property: \"bar\"\\. Mapping from property \"org\\.mapstruct\\.ap\\" + ".test\\.accessibility\\.referenced\\.ReferencedSource referencedSource\" to \"org\\.mapstruct\\" + ".ap\\.test\\.accessibility\\.referenced\\.ReferencedTarget referencedTarget\"") @@ -65,7 +65,7 @@ public class ReferencedAccessibilityTest { diagnostics = { @Diagnostic(type = SourceTargetMapperDefaultOther.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 37, + line = 24, messageRegExp = "Unmapped target property: \"bar\"\\. Mapping from property \"org\\.mapstruct\\.ap\\" + ".test\\.accessibility\\.referenced\\.ReferencedSource referencedSource\" to \"org\\.mapstruct\\" + ".ap\\.test\\.accessibility\\.referenced\\.ReferencedTarget referencedTarget\"") @@ -88,7 +88,7 @@ public class ReferencedAccessibilityTest { diagnostics = { @Diagnostic(type = AbstractSourceTargetMapperPrivate.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 36, + line = 23, messageRegExp = "Unmapped target property: \"bar\"\\. Mapping from property \"org\\.mapstruct\\.ap\\" + ".test\\.accessibility\\.referenced\\.ReferencedSource referencedSource\" to \"org\\.mapstruct\\" + ".ap\\.test\\.accessibility\\.referenced\\.ReferencedTarget referencedTarget\"") diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1005/Issue1005Test.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1005/Issue1005Test.java index 1e39739e2..b54479a8e 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1005/Issue1005Test.java +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1005/Issue1005Test.java @@ -34,7 +34,7 @@ public class Issue1005Test { diagnostics = { @Diagnostic(type = Issue1005ErroneousAbstractResultTypeMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 30, + line = 17, messageRegExp = "The result type .*\\.AbstractEntity may not be an abstract class nor interface.") }) public void shouldFailDueToAbstractResultType() throws Exception { @@ -46,7 +46,7 @@ public class Issue1005Test { diagnostics = { @Diagnostic(type = Issue1005ErroneousAbstractReturnTypeMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "The return type .*\\.AbstractEntity is an abstract class or interface. Provide a non" + " abstract / non interface result type or a factory method.") }) @@ -59,7 +59,7 @@ public class Issue1005Test { diagnostics = { @Diagnostic(type = Issue1005ErroneousInterfaceResultTypeMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 30, + line = 17, messageRegExp = "The result type .*\\.HasPrimaryKey may not be an abstract class nor interface.") }) public void shouldFailDueToInterfaceResultType() throws Exception { @@ -71,7 +71,7 @@ public class Issue1005Test { diagnostics = { @Diagnostic(type = Issue1005ErroneousInterfaceReturnTypeMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "The return type .*\\.HasKey is an abstract class or interface. Provide a non " + "abstract / non interface result type or a factory method.") }) diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1029/Issue1029Test.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1029/Issue1029Test.java index 02deaf3d3..86c55597d 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1029/Issue1029Test.java +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1029/Issue1029Test.java @@ -28,11 +28,11 @@ public class Issue1029Test { @Test @ExpectedCompilationOutcome(value = CompilationResult.FAILED, diagnostics = { - @Diagnostic(kind = Kind.WARNING, line = 39, type = ErroneousIssue1029Mapper.class, + @Diagnostic(kind = Kind.WARNING, line = 26, type = ErroneousIssue1029Mapper.class, messageRegExp = "Unmapped target properties: \"knownProp, lastUpdated, computedMapping\"\\."), - @Diagnostic(kind = Kind.WARNING, line = 50, type = ErroneousIssue1029Mapper.class, + @Diagnostic(kind = Kind.WARNING, line = 37, type = ErroneousIssue1029Mapper.class, messageRegExp = "Unmapped target property: \"lastUpdated\"\\."), - @Diagnostic(kind = Kind.ERROR, line = 55, type = ErroneousIssue1029Mapper.class, + @Diagnostic(kind = Kind.ERROR, line = 42, type = ErroneousIssue1029Mapper.class, messageRegExp = "Unknown property \"unknownProp\" in result type " + "org.mapstruct.ap.test.bugs._1029.ErroneousIssue1029Mapper.Deck\\. Did you mean \"knownProp\"?") }) diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1153/Issue1153Test.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1153/Issue1153Test.java index 22811d1ab..3ed3e20db 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1153/Issue1153Test.java +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1153/Issue1153Test.java @@ -26,17 +26,17 @@ public class Issue1153Test { diagnostics = { @Diagnostic(type = ErroneousIssue1153Mapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 32, + line = 19, messageRegExp = "Property \"readOnly\" has no write accessor in " + "org.mapstruct.ap.test.bugs._1153.ErroneousIssue1153Mapper.Target\\."), @Diagnostic(type = ErroneousIssue1153Mapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Property \"nestedTarget.readOnly\" has no write accessor in " + "org.mapstruct.ap.test.bugs._1153.ErroneousIssue1153Mapper.Target\\."), @Diagnostic(type = ErroneousIssue1153Mapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 36, + line = 23, messageRegExp = "Unknown property \"nestedTarget2.writable2\" in result type " + "org.mapstruct.ap.test.bugs._1153.ErroneousIssue1153Mapper.Target\\. " + "Did you mean \"nestedTarget2\\.writable\"") diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1180/Issue1180Test.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1180/Issue1180Test.java index 121353a90..80910e55a 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1180/Issue1180Test.java +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1180/Issue1180Test.java @@ -32,7 +32,7 @@ public class Issue1180Test { diagnostics = { @Diagnostic(type = SharedConfig.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 33, + line = 20, messageRegExp = "No property named \"sourceProperty\\.nonExistant\" exists.*") }) public void shouldCompileButNotGiveNullPointer() { diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1242/Issue1242Test.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1242/Issue1242Test.java index 4edeab667..94a7e3bba 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1242/Issue1242Test.java +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1242/Issue1242Test.java @@ -57,7 +57,7 @@ public class Issue1242Test { diagnostics = { @Diagnostic(type = ErroneousIssue1242MapperMultipleSources.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Ambiguous factory methods found for creating .*TargetB:" + " .*TargetB anotherTargetBCreator\\(.*SourceB source\\)," + " .*TargetB .*TargetFactories\\.createTargetB\\(.*SourceB source," @@ -66,7 +66,7 @@ public class Issue1242Test { + " .*TargetB .*TargetFactories\\.createTargetB\\(\\)."), @Diagnostic(type = ErroneousIssue1242MapperMultipleSources.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 33, + line = 20, messageRegExp = ".*TargetB does not have an accessible parameterless constructor\\.") }) public void ambiguousMethodErrorForTwoFactoryMethodsWithSourceParam() { diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1283/Issue1283Test.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1283/Issue1283Test.java index d70827ae8..9e33e2f07 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1283/Issue1283Test.java +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1283/Issue1283Test.java @@ -32,7 +32,7 @@ public class Issue1283Test { diagnostics = { @Diagnostic(type = ErroneousInverseTargetHasNoSuitableConstructorMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35L, + line = 22L, messageRegExp = ".*\\._1283\\.Source does not have an accessible parameterless constructor" ) } @@ -47,7 +47,7 @@ public class Issue1283Test { diagnostics = { @Diagnostic(type = ErroneousTargetHasNoSuitableConstructorMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 31L, + line = 18L, messageRegExp = ".*\\._1283\\.Source does not have an accessible parameterless constructor" ) } diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1353/Issue1353Test.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1353/Issue1353Test.java index d07b0532f..da8928801 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/bugs/_1353/Issue1353Test.java +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_1353/Issue1353Test.java @@ -34,13 +34,13 @@ public class Issue1353Test { diagnostics = { @Diagnostic (type = Issue1353Mapper.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 35, + line = 22, messageRegExp = "The property named \" source.string1\" has whitespaces," + " using trimmed property \"source.string1\" instead." ), @Diagnostic (type = Issue1353Mapper.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 35, + line = 22, messageRegExp = "The property named \"string2 \" has whitespaces," + " using trimmed property \"string2\" instead." ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_631/Issue631Test.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_631/Issue631Test.java index 00edd3680..5050c76ea 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/bugs/_631/Issue631Test.java +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_631/Issue631Test.java @@ -29,11 +29,11 @@ public class Issue631Test { diagnostics = { @Diagnostic(type = ErroneousSourceTargetMapper.class, kind = Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Can't generate mapping method for a generic type variable target."), @Diagnostic(type = ErroneousSourceTargetMapper.class, kind = Kind.ERROR, - line = 37, + line = 24, messageRegExp = "Can't generate mapping method for a generic type variable source.") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/bugs/_880/Issue880Test.java b/processor/src/test/java/org/mapstruct/ap/test/bugs/_880/Issue880Test.java index 9ad1352e2..6ff17597c 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/bugs/_880/Issue880Test.java +++ b/processor/src/test/java/org/mapstruct/ap/test/bugs/_880/Issue880Test.java @@ -40,7 +40,7 @@ public class Issue880Test { @ExpectedCompilationOutcome( value = CompilationResult.SUCCEEDED, diagnostics = @Diagnostic(kind = Kind.WARNING, - type = UsesConfigFromAnnotationMapper.class, line = 29, + type = UsesConfigFromAnnotationMapper.class, line = 16, messageRegExp = "Unmapped target property: \"core\"\\.")) public void compilationSucceedsAndAppliesCorrectComponentModel() { generatedSource.forMapper( UsesConfigFromAnnotationMapper.class ).containsNoImportFor( Component.class ); diff --git a/processor/src/test/java/org/mapstruct/ap/test/builder/multiple/MultipleBuilderMapperTest.java b/processor/src/test/java/org/mapstruct/ap/test/builder/multiple/MultipleBuilderMapperTest.java index 6bf212d29..2d0fe0f78 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/builder/multiple/MultipleBuilderMapperTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/builder/multiple/MultipleBuilderMapperTest.java @@ -39,7 +39,7 @@ public class MultipleBuilderMapperTest { @Diagnostic( type = ErroneousMoreThanOneBuildMethodMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 32, + line = 19, messageRegExp = "No build method \"build\" found in \".*\\.multiple\\.build\\.Process\\.Builder\" " + "for \".*\\.multiple\\.build\\.Process\"\\. " + "Found methods: " + @@ -50,7 +50,7 @@ public class MultipleBuilderMapperTest { @Diagnostic( type = ErroneousMoreThanOneBuildMethodMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 34, + line = 21, messageRegExp = "No build method \"missingBuild\" found " + "in \".*\\.multiple\\.build\\.Process\\.Builder\" " + "for \".*\\.multiple\\.build\\.Process\"\\. " + @@ -71,7 +71,7 @@ public class MultipleBuilderMapperTest { @Diagnostic( type = ErroneousMoreThanOneBuildMethodWithMapperDefinedMappingMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 31, + line = 18, messageRegExp = "No build method \"mapperBuild\" found in \".*\\.multiple\\.build\\.Process\\.Builder\" " + "for \".*\\.multiple\\.build\\.Process\"\\. " + @@ -118,7 +118,7 @@ public class MultipleBuilderMapperTest { @Diagnostic( type = Case.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 24, + line = 11, messageRegExp = "More than one builder creation method for \".*\\.multiple\\.builder.Case\"\\. " + "Found methods: " + "\".*wrongBuilder\\(\\) ?, " + @@ -128,7 +128,7 @@ public class MultipleBuilderMapperTest { @Diagnostic( type = Case.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 24, + line = 11, messageRegExp = "More than one builder creation method for \".*\\.multiple\\.builder.Case\"\\. " + "Found methods: " + "\".*wrongBuilder\\(\\) ?, " + diff --git a/processor/src/test/java/org/mapstruct/ap/test/builder/simple/SimpleImmutableBuilderTest.java b/processor/src/test/java/org/mapstruct/ap/test/builder/simple/SimpleImmutableBuilderTest.java index f35cee8f9..a7e579b29 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/builder/simple/SimpleImmutableBuilderTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/builder/simple/SimpleImmutableBuilderTest.java @@ -56,7 +56,7 @@ public class SimpleImmutableBuilderTest { diagnostics = @Diagnostic( kind = javax.tools.Diagnostic.Kind.ERROR, type = ErroneousSimpleBuilderMapper.class, - line = 34, + line = 21, messageRegExp = "Unmapped target property: \"name\"\\.")) public void testSimpleImmutableBuilderMissingPropertyFailsToCompile() { } diff --git a/processor/src/test/java/org/mapstruct/ap/test/collection/erroneous/ErroneousCollectionMappingTest.java b/processor/src/test/java/org/mapstruct/ap/test/collection/erroneous/ErroneousCollectionMappingTest.java index cf0aa78a3..8a1a138c4 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/collection/erroneous/ErroneousCollectionMappingTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/collection/erroneous/ErroneousCollectionMappingTest.java @@ -34,11 +34,11 @@ public class ErroneousCollectionMappingTest { diagnostics = { @Diagnostic(type = ErroneousCollectionToNonCollectionMapper.class, kind = Kind.ERROR, - line = 28, + line = 15, messageRegExp = "Can't generate mapping method from iterable type to non-iterable type"), @Diagnostic(type = ErroneousCollectionToNonCollectionMapper.class, kind = Kind.ERROR, - line = 30, + line = 17, messageRegExp = "Can't generate mapping method from non-iterable type to iterable type") } ) @@ -53,7 +53,7 @@ public class ErroneousCollectionMappingTest { diagnostics = { @Diagnostic(type = ErroneousCollectionToPrimitivePropertyMapper.class, kind = Kind.ERROR, - line = 26, + line = 13, messageRegExp = "Can't map property \"java.util.List strings\" to \"int strings\". " + "Consider to declare/implement a mapping method: \"int map\\(java.util.List" + " value\\)\"") @@ -70,7 +70,7 @@ public class ErroneousCollectionMappingTest { diagnostics = { @Diagnostic(type = EmptyItererableMappingMapper.class, kind = Kind.ERROR, - line = 35, + line = 22, messageRegExp = "'nullValueMappingStrategy','dateformat', 'qualifiedBy' and 'elementTargetType' are " + "undefined in @IterableMapping, define at least one of them.") } @@ -86,7 +86,7 @@ public class ErroneousCollectionMappingTest { diagnostics = { @Diagnostic(type = EmptyMapMappingMapper.class, kind = Kind.ERROR, - line = 35, + line = 22, messageRegExp = "'nullValueMappingStrategy', 'keyDateFormat', 'keyQualifiedBy', 'keyTargetType', " + "'valueDateFormat', 'valueQualfiedBy' and 'valueTargetType' are all undefined in @MapMapping, " + "define at least one of them.") @@ -103,7 +103,7 @@ public class ErroneousCollectionMappingTest { diagnostics = { @Diagnostic(type = ErroneousCollectionNoElementMappingFound.class, kind = Kind.ERROR, - line = 38, + line = 25, messageRegExp = "Can't map Collection element \".*WithProperties withProperties\" to \".*NoProperties" + " noProperties\". Consider to declare/implement a mapping method: \".*NoProperties map\\(" + ".*WithProperties value\\)") @@ -120,7 +120,7 @@ public class ErroneousCollectionMappingTest { diagnostics = { @Diagnostic(type = ErroneousCollectionNoElementMappingFoundDisabledAuto.class, kind = Kind.ERROR, - line = 32, + line = 19, messageRegExp = "Can't map collection element \".*AttributedString\" to \".*String \". " + "Consider to declare/implement a mapping method: \".*String map\\(.*AttributedString value\\)") @@ -137,7 +137,7 @@ public class ErroneousCollectionMappingTest { diagnostics = { @Diagnostic(type = ErroneousCollectionNoKeyMappingFound.class, kind = Kind.ERROR, - line = 38, + line = 25, messageRegExp = "Can't map Map key \".*WithProperties withProperties\" to \".*NoProperties " + "noProperties\". Consider to declare/implement a mapping method: \".*NoProperties map\\(" + ".*WithProperties value\\)") @@ -154,7 +154,7 @@ public class ErroneousCollectionMappingTest { diagnostics = { @Diagnostic(type = ErroneousCollectionNoKeyMappingFoundDisabledAuto.class, kind = Kind.ERROR, - line = 32, + line = 19, messageRegExp = "Can't map map key \".*AttributedString\" to \".*String \". " + "Consider to declare/implement a mapping method: \".*String map\\(.*AttributedString value\\)") } @@ -170,7 +170,7 @@ public class ErroneousCollectionMappingTest { diagnostics = { @Diagnostic(type = ErroneousCollectionNoValueMappingFound.class, kind = Kind.ERROR, - line = 38, + line = 25, messageRegExp = "Can't map Map value \".*WithProperties withProperties\" to \".*NoProperties " + "noProperties\". Consider to declare/implement a mapping method: \".*NoProperties map\\(" + ".*WithProperties value\\)") @@ -187,7 +187,7 @@ public class ErroneousCollectionMappingTest { diagnostics = { @Diagnostic(type = ErroneousCollectionNoValueMappingFoundDisabledAuto.class, kind = Kind.ERROR, - line = 32, + line = 19, messageRegExp = "Can't map map value \".*AttributedString\" to \".*String \". " + "Consider to declare/implement a mapping method: \".*String map(.*AttributedString value)") } diff --git a/processor/src/test/java/org/mapstruct/ap/test/collection/forged/CollectionMappingTest.java b/processor/src/test/java/org/mapstruct/ap/test/collection/forged/CollectionMappingTest.java index d157b3f02..0c4480b3b 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/collection/forged/CollectionMappingTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/collection/forged/CollectionMappingTest.java @@ -86,7 +86,7 @@ public class CollectionMappingTest { diagnostics = { @Diagnostic(type = ErroneousCollectionNonMappableSetMapper.class, kind = Kind.ERROR, - line = 30, + line = 17, messageRegExp = "Can't map Collection element \".* nonMappableSet\" to \".* nonMappableSet\". " + "Consider to declare/implement a mapping method: .*."), } @@ -106,12 +106,12 @@ public class CollectionMappingTest { diagnostics = { @Diagnostic(type = ErroneousCollectionNonMappableMapMapper.class, kind = Kind.ERROR, - line = 30, + line = 17, messageRegExp = "Can't map Map key \".* nonMappableMap\\{:key\\}\" to \".* nonMappableMap\\{:key\\}\". " + "Consider to declare/implement a mapping method: .*."), @Diagnostic(type = ErroneousCollectionNonMappableMapMapper.class, kind = Kind.ERROR, - line = 30, + line = 17, messageRegExp = "Can't map Map value \".* nonMappableMap\\{:value\\}\" to \".* " + "nonMappableMap\\{:value\\}\". Consider to declare/implement a mapping method: .*."), } diff --git a/processor/src/test/java/org/mapstruct/ap/test/collection/immutabletarget/ImmutableProductTest.java b/processor/src/test/java/org/mapstruct/ap/test/collection/immutabletarget/ImmutableProductTest.java index e83c7a705..f196a1ed9 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/collection/immutabletarget/ImmutableProductTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/collection/immutabletarget/ImmutableProductTest.java @@ -52,7 +52,7 @@ public class ImmutableProductTest { diagnostics = { @Diagnostic(type = ErroneousCupboardMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35, + line = 22, messageRegExp = "No write accessor found for property \"content\" in target type.") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/WildCardTest.java b/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/WildCardTest.java index 692723bcc..3e6da19cb 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/WildCardTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/WildCardTest.java @@ -86,7 +86,7 @@ public class WildCardTest { diagnostics = { @Diagnostic( type = ErroneousIterableSuperBoundSourceMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Can't generate mapping method for a wildcard super bound source." ) } ) @@ -100,7 +100,7 @@ public class WildCardTest { diagnostics = { @Diagnostic( type = ErroneousIterableExtendsBoundTargetMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Can't generate mapping method for a wildcard extends bound result." ) } ) @@ -114,7 +114,7 @@ public class WildCardTest { diagnostics = { @Diagnostic(type = ErroneousIterableTypeVarBoundMapperOnMethod.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Can't generate mapping method for a generic type variable target." ) } ) @@ -128,7 +128,7 @@ public class WildCardTest { diagnostics = { @Diagnostic( type = ErroneousIterableTypeVarBoundMapperOnMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Can't generate mapping method for a generic type variable source." ) } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/context/ContextParameterErroneousTest.java b/processor/src/test/java/org/mapstruct/ap/test/context/ContextParameterErroneousTest.java index 72cc8270c..db72521e9 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/context/ContextParameterErroneousTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/context/ContextParameterErroneousTest.java @@ -39,7 +39,7 @@ public class ContextParameterErroneousTest { @ExpectedCompilationOutcome(value = CompilationResult.FAILED, diagnostics = @Diagnostic( kind = Kind.ERROR, - line = 33, + line = 20, type = ErroneousNodeMapperWithNonUniqueContextTypes.class, messageRegExp = "The types of @Context parameters must be unique")) public void reportsNonUniqueContextParamType() { diff --git a/processor/src/test/java/org/mapstruct/ap/test/conversion/erroneous/InvalidDateFormatTest.java b/processor/src/test/java/org/mapstruct/ap/test/conversion/erroneous/InvalidDateFormatTest.java index 5a6bfd273..669b4cfda 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/conversion/erroneous/InvalidDateFormatTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/conversion/erroneous/InvalidDateFormatTest.java @@ -32,51 +32,51 @@ public class InvalidDateFormatTest { diagnostics = { @Diagnostic(type = ErroneousFormatMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 38, + line = 25, messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern character 'q'\""), @Diagnostic(type = ErroneousFormatMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 39, + line = 26, messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Unknown pattern letter: r\"\\."), + @Diagnostic(type = ErroneousFormatMapper.class, + kind = javax.tools.Diagnostic.Kind.ERROR, + line = 27, + messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Unknown pattern letter: r\"\\."), + @Diagnostic(type = ErroneousFormatMapper.class, + kind = javax.tools.Diagnostic.Kind.ERROR, + line = 28, + messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Unknown pattern letter: r\"\\."), + @Diagnostic(type = ErroneousFormatMapper.class, + kind = javax.tools.Diagnostic.Kind.ERROR, + line = 29, + messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Unknown pattern letter: r\"\\."), + @Diagnostic(type = ErroneousFormatMapper.class, + kind = javax.tools.Diagnostic.Kind.ERROR, + line = 30, + messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern component: q\""), + @Diagnostic(type = ErroneousFormatMapper.class, + kind = javax.tools.Diagnostic.Kind.ERROR, + line = 31, + messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern component: q\""), + @Diagnostic(type = ErroneousFormatMapper.class, + kind = javax.tools.Diagnostic.Kind.ERROR, + line = 32, + messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern component: q\""), + @Diagnostic(type = ErroneousFormatMapper.class, + kind = javax.tools.Diagnostic.Kind.ERROR, + line = 33, + messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern component: q\""), + @Diagnostic(type = ErroneousFormatMapper.class, + kind = javax.tools.Diagnostic.Kind.ERROR, + line = 37, + messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern character 'q'\""), @Diagnostic(type = ErroneousFormatMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, line = 40, - messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Unknown pattern letter: r\"\\."), - @Diagnostic(type = ErroneousFormatMapper.class, - kind = javax.tools.Diagnostic.Kind.ERROR, - line = 41, - messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Unknown pattern letter: r\"\\."), - @Diagnostic(type = ErroneousFormatMapper.class, - kind = javax.tools.Diagnostic.Kind.ERROR, - line = 42, - messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Unknown pattern letter: r\"\\."), + messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern character 'q'\""), @Diagnostic(type = ErroneousFormatMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, line = 43, - messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern component: q\""), - @Diagnostic(type = ErroneousFormatMapper.class, - kind = javax.tools.Diagnostic.Kind.ERROR, - line = 44, - messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern component: q\""), - @Diagnostic(type = ErroneousFormatMapper.class, - kind = javax.tools.Diagnostic.Kind.ERROR, - line = 45, - messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern component: q\""), - @Diagnostic(type = ErroneousFormatMapper.class, - kind = javax.tools.Diagnostic.Kind.ERROR, - line = 46, - messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern component: q\""), - @Diagnostic(type = ErroneousFormatMapper.class, - kind = javax.tools.Diagnostic.Kind.ERROR, - line = 50, - messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern character 'q'\""), - @Diagnostic(type = ErroneousFormatMapper.class, - kind = javax.tools.Diagnostic.Kind.ERROR, - line = 53, - messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern character 'q'\""), - @Diagnostic(type = ErroneousFormatMapper.class, - kind = javax.tools.Diagnostic.Kind.ERROR, - line = 56, messageRegExp = "Given date format \"qwertz\" is invalid. Message: \"Illegal pattern character 'q'\"") }) @Test diff --git a/processor/src/test/java/org/mapstruct/ap/test/decorator/DecoratorTest.java b/processor/src/test/java/org/mapstruct/ap/test/decorator/DecoratorTest.java index df013d533..08e71f836 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/decorator/DecoratorTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/decorator/DecoratorTest.java @@ -181,7 +181,7 @@ public class DecoratorTest { diagnostics = { @Diagnostic(type = ErroneousPersonMapper.class, kind = Kind.ERROR, - line = 27, + line = 14, messageRegExp = "Specified decorator type is no subtype of the annotated mapper type") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/defaultvalue/DefaultValueTest.java b/processor/src/test/java/org/mapstruct/ap/test/defaultvalue/DefaultValueTest.java index e02e00b55..9107b4eb2 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/defaultvalue/DefaultValueTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/defaultvalue/DefaultValueTest.java @@ -125,12 +125,12 @@ public class DefaultValueTest { diagnostics = { @Diagnostic( type = ErroneousMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 31, + line = 18, messageRegExp = "Constant and default value are both defined in @Mapping," + " either define a defaultValue or a constant." ), @Diagnostic(type = ErroneousMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Can't map property \".*Region region\" to \".*String region\"\\. Consider") } ) @@ -147,12 +147,12 @@ public class DefaultValueTest { diagnostics = { @Diagnostic( type = ErroneousMapper2.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 31, + line = 18, messageRegExp = "Expression and default value are both defined in @Mapping," + " either define a defaultValue or an expression." ), @Diagnostic(type = ErroneousMapper2.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Can't map property \".*Region region\" to \".*String region\"\\. Consider") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/dependency/OrderingTest.java b/processor/src/test/java/org/mapstruct/ap/test/dependency/OrderingTest.java index 9ba8a1fec..fd091d21a 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/dependency/OrderingTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/dependency/OrderingTest.java @@ -62,7 +62,7 @@ public class OrderingTest { diagnostics = { @Diagnostic(type = ErroneousAddressMapperWithCyclicDependency.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 37, + line = 24, messageRegExp = "Cycle\\(s\\) between properties given via dependsOn\\(\\): firstName -> lastName -> " + "middleName -> firstName" ) @@ -79,7 +79,7 @@ public class OrderingTest { diagnostics = { @Diagnostic(type = ErroneousAddressMapperWithUnknownPropertyInDependsOn.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 32, + line = 19, messageRegExp = "\"doesnotexist\" is no property of the method return type" ) } diff --git a/processor/src/test/java/org/mapstruct/ap/test/enums/EnumMappingTest.java b/processor/src/test/java/org/mapstruct/ap/test/enums/EnumMappingTest.java index d7bb8cedd..552fad686 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/enums/EnumMappingTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/enums/EnumMappingTest.java @@ -35,7 +35,7 @@ public class EnumMappingTest { diagnostics = { @Diagnostic(type = OrderMapper.class, kind = Kind.WARNING, - line = 41, + line = 28, messageRegExp = "Mapping of Enums via @Mapping is going to be removed in future versions of " + "MapStruct\\. Please use @ValueMapping instead!") } @@ -55,7 +55,7 @@ public class EnumMappingTest { diagnostics = { @Diagnostic(type = OrderMapper.class, kind = Kind.WARNING, - line = 41, + line = 28, messageRegExp = "Mapping of Enums via @Mapping is going to be removed in future versions of " + "MapStruct\\. Please use @ValueMapping instead!") } @@ -78,7 +78,7 @@ public class EnumMappingTest { diagnostics = { @Diagnostic(type = OrderMapper.class, kind = Kind.WARNING, - line = 41, + line = 28, messageRegExp = "Mapping of Enums via @Mapping is going to be removed in future versions of " + "MapStruct\\. Please use @ValueMapping instead!") } @@ -100,12 +100,12 @@ public class EnumMappingTest { @Diagnostic(type = ErroneousOrderMapperMappingSameConstantTwice.class, kind = Kind.ERROR, - line = 42, + line = 29, messageRegExp = "One enum constant must not be mapped to more than one target constant, but " + "constant EXTRA is mapped to SPECIAL, DEFAULT\\."), @Diagnostic(type = ErroneousOrderMapperMappingSameConstantTwice.class, kind = Kind.WARNING, - line = 42, + line = 29, messageRegExp = "Mapping of Enums via @Mapping is going to be removed in future versions of " + "MapStruct\\. Please use @ValueMapping instead!") } @@ -120,16 +120,16 @@ public class EnumMappingTest { diagnostics = { @Diagnostic(type = ErroneousOrderMapperUsingUnknownEnumConstants.class, kind = Kind.WARNING, - line = 40, + line = 27, messageRegExp = "Mapping of Enums via @Mapping is going to be removed in future versions of " + "MapStruct\\. Please use @ValueMapping instead!"), @Diagnostic(type = ErroneousOrderMapperUsingUnknownEnumConstants.class, kind = Kind.ERROR, - line = 37, + line = 24, messageRegExp = "Constant FOO doesn't exist in enum type org.mapstruct.ap.test.enums.OrderType\\."), @Diagnostic(type = ErroneousOrderMapperUsingUnknownEnumConstants.class, kind = Kind.ERROR, - line = 38, + line = 25, messageRegExp = "Constant BAR doesn't exist in enum type org.mapstruct.ap.test.enums." + "ExternalOrderType\\.") } @@ -144,7 +144,7 @@ public class EnumMappingTest { diagnostics = { @Diagnostic(type = ErroneousOrderMapperNotMappingConstantWithoutMatchInTargetType.class, kind = Kind.ERROR, - line = 34, + line = 21, messageRegExp = "The following constants from the source enum have no corresponding constant in the " + "target enum and must be be mapped via adding additional mappings: EXTRA, STANDARD, NORMAL") } diff --git a/processor/src/test/java/org/mapstruct/ap/test/erroneous/ambiguousannotatedfactorymethod/AmbiguousAnnotatedFactoryTest.java b/processor/src/test/java/org/mapstruct/ap/test/erroneous/ambiguousannotatedfactorymethod/AmbiguousAnnotatedFactoryTest.java index aa9d800b2..64191955c 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/erroneous/ambiguousannotatedfactorymethod/AmbiguousAnnotatedFactoryTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/erroneous/ambiguousannotatedfactorymethod/AmbiguousAnnotatedFactoryTest.java @@ -29,7 +29,7 @@ public class AmbiguousAnnotatedFactoryTest { diagnostics = { @Diagnostic(type = SourceTargetMapperAndBarFactory.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Ambiguous factory methods found for creating " + "org.mapstruct.ap.test.erroneous.ambiguousannotatedfactorymethod.Bar: " + "org.mapstruct.ap.test.erroneous.ambiguousannotatedfactorymethod.Bar " @@ -39,7 +39,7 @@ public class AmbiguousAnnotatedFactoryTest { + "ambiguousannotatedfactorymethod.Foo foo\\)."), @Diagnostic(type = SourceTargetMapperAndBarFactory.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35, + line = 22, messageRegExp = ".*\\.ambiguousannotatedfactorymethod.Bar does not have an accessible parameterless " + "constructor\\.") diff --git a/processor/src/test/java/org/mapstruct/ap/test/erroneous/ambiguousfactorymethod/FactoryTest.java b/processor/src/test/java/org/mapstruct/ap/test/erroneous/ambiguousfactorymethod/FactoryTest.java index bd09018c3..e54602b01 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/erroneous/ambiguousfactorymethod/FactoryTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/erroneous/ambiguousfactorymethod/FactoryTest.java @@ -33,14 +33,14 @@ public class FactoryTest { diagnostics = { @Diagnostic(type = SourceTargetMapperAndBarFactory.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Ambiguous factory methods found for creating " + "org.mapstruct.ap.test.erroneous.ambiguousfactorymethod.Bar: " + "org.mapstruct.ap.test.erroneous.ambiguousfactorymethod.Bar createBar\\(\\), " + "org.mapstruct.ap.test.erroneous.ambiguousfactorymethod.Bar .*BarFactory.createBar\\(\\)."), @Diagnostic(type = SourceTargetMapperAndBarFactory.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35, + line = 22, messageRegExp = ".*\\.ambiguousfactorymethod\\.Bar does not have an accessible parameterless " + "constructor\\.") diff --git a/processor/src/test/java/org/mapstruct/ap/test/erroneous/annotationnotfound/AnnotationNotFoundTest.java b/processor/src/test/java/org/mapstruct/ap/test/erroneous/annotationnotfound/AnnotationNotFoundTest.java index 787aad515..50d5b7c82 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/erroneous/annotationnotfound/AnnotationNotFoundTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/erroneous/annotationnotfound/AnnotationNotFoundTest.java @@ -32,7 +32,7 @@ public class AnnotationNotFoundTest { diagnostics = { @Diagnostic( type = ErroneousMapper.class, kind = Kind.ERROR, - line = 30, + line = 17, messageRegExp = "NotFoundAnnotation") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/erroneous/attributereference/ErroneousMappingsTest.java b/processor/src/test/java/org/mapstruct/ap/test/erroneous/attributereference/ErroneousMappingsTest.java index 4245d65f6..8031a7880 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/erroneous/attributereference/ErroneousMappingsTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/erroneous/attributereference/ErroneousMappingsTest.java @@ -33,26 +33,26 @@ public class ErroneousMappingsTest { diagnostics = { @Diagnostic(type = ErroneousMapper.class, kind = Kind.ERROR, - line = 29, + line = 16, messageRegExp = "No property named \"bar\" exists in source parameter\\(s\\)\\. " + "Did you mean \"foo\"?"), @Diagnostic(type = ErroneousMapper.class, kind = Kind.ERROR, - line = 30, + line = 17, messageRegExp = "No property named \"source1.foo\" exists in source parameter\\(s\\)\\. " + "Did you mean \"foo\"?"), @Diagnostic(type = ErroneousMapper.class, kind = Kind.ERROR, - line = 31, + line = 18, messageRegExp = "Unknown property \"bar\" in result type " + "org.mapstruct.ap.test.erroneous.attributereference.Target. Did you mean \"foo\"?"), @Diagnostic(type = ErroneousMapper.class, kind = Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Target property \"foo\" must not be mapped more than once"), @Diagnostic(type = ErroneousMapper.class, kind = Kind.WARNING, - line = 35, + line = 22, messageRegExp = "Unmapped target property: \"bar\"") } ) @@ -66,7 +66,7 @@ public class ErroneousMappingsTest { diagnostics = { @Diagnostic(type = ErroneousMapper1.class, kind = Kind.ERROR, - line = 29, + line = 16, messageRegExp = "The type of parameter \"source\" has no property named \"foobar\"") } ) @@ -80,7 +80,7 @@ public class ErroneousMappingsTest { diagnostics = { @Diagnostic(type = ErroneousMapper2.class, kind = Kind.ERROR, - line = 32, + line = 19, messageRegExp = "Target property \"foo\" must not be mapped more than once" ) } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/erroneous/typemismatch/ErroneousMappingsTest.java b/processor/src/test/java/org/mapstruct/ap/test/erroneous/typemismatch/ErroneousMappingsTest.java index 4b04b427e..4462bdffa 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/erroneous/typemismatch/ErroneousMappingsTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/erroneous/typemismatch/ErroneousMappingsTest.java @@ -32,25 +32,25 @@ public class ErroneousMappingsTest { diagnostics = { @Diagnostic(type = ErroneousMapper.class, kind = Kind.ERROR, - line = 27, + line = 14, messageRegExp = "Can't map property \"boolean foo\" to \"int foo\". Consider to declare/implement a " + "mapping method: \"int map\\(boolean value\\)\"."), @Diagnostic(type = ErroneousMapper.class, kind = Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \"int foo\" to \"boolean foo\". Consider to declare/implement a " + "mapping method: \"boolean map\\(int value\\)\"."), @Diagnostic(type = ErroneousMapper.class, kind = Kind.ERROR, - line = 31, + line = 18, messageRegExp = "Can't generate mapping method with primitive return type\\."), @Diagnostic(type = ErroneousMapper.class, kind = Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Can't generate mapping method with primitive parameter type\\."), @Diagnostic(type = ErroneousMapper.class, kind = Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Can't generate mapping method that has a parameter annotated with @TargetType\\.") } diff --git a/processor/src/test/java/org/mapstruct/ap/test/ignore/IgnorePropertyTest.java b/processor/src/test/java/org/mapstruct/ap/test/ignore/IgnorePropertyTest.java index dcc92d689..3b2496327 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/ignore/IgnorePropertyTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/ignore/IgnorePropertyTest.java @@ -81,7 +81,7 @@ public class IgnorePropertyTest { diagnostics = { @Diagnostic(type = ErroneousTargetHasNoWriteAccessorMapper.class, kind = Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Property \"hasClaws\" has no write accessor in " + "org.mapstruct.ap.test.ignore.PreditorDto\\.") } diff --git a/processor/src/test/java/org/mapstruct/ap/test/inheritance/attribute/AttributeInheritanceTest.java b/processor/src/test/java/org/mapstruct/ap/test/inheritance/attribute/AttributeInheritanceTest.java index ce30a10b2..839d0987f 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/inheritance/attribute/AttributeInheritanceTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/inheritance/attribute/AttributeInheritanceTest.java @@ -43,7 +43,7 @@ public class AttributeInheritanceTest { diagnostics = @Diagnostic( type = ErroneousTargetSourceMapper.class, kind = Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \"java.lang.CharSequence foo\" to \"java.lang.String foo\"" )) public void shouldReportErrorDueToUnmappableAttribute() { diff --git a/processor/src/test/java/org/mapstruct/ap/test/inheritance/complex/ComplexInheritanceTest.java b/processor/src/test/java/org/mapstruct/ap/test/inheritance/complex/ComplexInheritanceTest.java index c2eac938d..6168ecdf2 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/inheritance/complex/ComplexInheritanceTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/inheritance/complex/ComplexInheritanceTest.java @@ -68,7 +68,7 @@ public class ComplexInheritanceTest { diagnostics = @Diagnostic( kind = Kind.ERROR, type = ErroneousSourceCompositeTargetCompositeMapper.class, - line = 32, + line = 19, messageRegExp = "Ambiguous mapping methods found for mapping property " + "\"org.mapstruct.ap.test.inheritance.complex.SourceExt prop1\" to .*Reference: " diff --git a/processor/src/test/java/org/mapstruct/ap/test/inheritfromconfig/InheritFromConfigTest.java b/processor/src/test/java/org/mapstruct/ap/test/inheritfromconfig/InheritFromConfigTest.java index dd064e82a..29c01c0a6 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/inheritfromconfig/InheritFromConfigTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/inheritfromconfig/InheritFromConfigTest.java @@ -202,25 +202,25 @@ public class InheritFromConfigTest { diagnostics = { @Diagnostic(type = Erroneous1Mapper.class, kind = Kind.ERROR, - line = 36, + line = 23, messageRegExp = "More than one configuration prototype method is applicable. Use @InheritConfiguration" + " to select one of them explicitly:" + " .*BaseVehicleEntity baseDtoToEntity\\(.*BaseVehicleDto dto\\)," + " .*BaseVehicleEntity anythingToEntity\\(java.lang.Object anyting\\)\\."), @Diagnostic(type = Erroneous1Mapper.class, kind = Kind.WARNING, - line = 36, + line = 23, messageRegExp = "Unmapped target properties: \"primaryKey, auditTrail\"\\."), @Diagnostic(type = Erroneous1Mapper.class, kind = Kind.ERROR, - line = 42, + line = 29, messageRegExp = "More than one configuration prototype method is applicable. Use @InheritConfiguration" + " to select one of them explicitly:" + " .*BaseVehicleEntity baseDtoToEntity\\(.*BaseVehicleDto dto\\)," + " .*BaseVehicleEntity anythingToEntity\\(java.lang.Object anyting\\)\\."), @Diagnostic(type = Erroneous1Mapper.class, kind = Kind.WARNING, - line = 42, + line = 29, messageRegExp = "Unmapped target property: \"primaryKey\"\\.") } ) @@ -235,7 +235,7 @@ public class InheritFromConfigTest { diagnostics = { @Diagnostic(type = Erroneous2Mapper.class, kind = Kind.ERROR, - line = 38, + line = 25, messageRegExp = "Cycle detected while evaluating inherited configurations. Inheritance path:" + " .*CarEntity toCarEntity1\\(.*CarDto carDto\\)" + " -> .*CarEntity toCarEntity2\\(.*CarDto carDto\\)" @@ -255,7 +255,7 @@ public class InheritFromConfigTest { diagnostics = { @Diagnostic(type = ErroneousMapperAutoInheritance.class, kind = Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Unmapped target properties: \"primaryKey, auditTrail\"\\.") } ) @@ -269,7 +269,7 @@ public class InheritFromConfigTest { diagnostics = { @Diagnostic(type = ErroneousMapperReverseWithAutoInheritance.class, kind = Kind.ERROR, - line = 36, + line = 23, messageRegExp = "Unmapped target property: \"id\"\\.") } ) @@ -283,12 +283,12 @@ public class InheritFromConfigTest { diagnostics = { @Diagnostic(type = Erroneous3Mapper.class, kind = Kind.ERROR, - line = 35, + line = 22, messageRegExp = "More than one configuration prototype method is applicable. " + "Use @InheritInverseConfiguration.*"), @Diagnostic(type = Erroneous3Mapper.class, kind = Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Unmapped target property: \"id\"\\.") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/java8stream/erroneous/ErroneousStreamMappingTest.java b/processor/src/test/java/org/mapstruct/ap/test/java8stream/erroneous/ErroneousStreamMappingTest.java index 233830b80..e195b037e 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/java8stream/erroneous/ErroneousStreamMappingTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/java8stream/erroneous/ErroneousStreamMappingTest.java @@ -41,11 +41,11 @@ public class ErroneousStreamMappingTest { diagnostics = { @Diagnostic(type = ErroneousStreamToNonStreamMapper.class, kind = Kind.ERROR, - line = 28, + line = 15, messageRegExp = "Can't generate mapping method from iterable type to non-iterable type"), @Diagnostic(type = ErroneousStreamToNonStreamMapper.class, kind = Kind.ERROR, - line = 30, + line = 17, messageRegExp = "Can't generate mapping method from non-iterable type to iterable type") } ) @@ -59,7 +59,7 @@ public class ErroneousStreamMappingTest { diagnostics = { @Diagnostic(type = ErroneousStreamToPrimitivePropertyMapper.class, kind = Kind.ERROR, - line = 26, + line = 13, messageRegExp = "Can't map property \"java.util.stream.Stream strings\" to \"int strings\". " + @@ -78,17 +78,17 @@ public class ErroneousStreamMappingTest { diagnostics = { @Diagnostic(type = EmptyStreamMappingMapper.class, kind = Kind.ERROR, - line = 36, + line = 23, messageRegExp = "'nullValueMappingStrategy','dateformat', 'qualifiedBy' and 'elementTargetType' are " + "undefined in @IterableMapping, define at least one of them."), @Diagnostic(type = EmptyStreamMappingMapper.class, kind = Kind.ERROR, - line = 39, + line = 26, messageRegExp = "'nullValueMappingStrategy','dateformat', 'qualifiedBy' and 'elementTargetType' are " + "undefined in @IterableMapping, define at least one of them."), @Diagnostic(type = EmptyStreamMappingMapper.class, kind = Kind.ERROR, - line = 42, + line = 29, messageRegExp = "'nullValueMappingStrategy','dateformat', 'qualifiedBy' and 'elementTargetType' are " + "undefined in @IterableMapping, define at least one of them.") } @@ -103,7 +103,7 @@ public class ErroneousStreamMappingTest { diagnostics = { @Diagnostic(type = ErroneousStreamToStreamNoElementMappingFound.class, kind = Kind.ERROR, - line = 37, + line = 24, messageRegExp = "Can't map Stream element \".*WithProperties withProperties\" to \".*NoProperties " + "noProperties\". Consider to declare/implement a mapping method: \".*NoProperties map\\(" + ".*WithProperties value\\)") @@ -120,7 +120,7 @@ public class ErroneousStreamMappingTest { diagnostics = { @Diagnostic(type = ErroneousStreamToStreamNoElementMappingFoundDisabledAuto.class, kind = Kind.ERROR, - line = 32, + line = 19, messageRegExp = "Can't map stream element \".*AttributedString\" to \".*String \". Consider to " + "declare/implement a mapping method: \".*String map(.*AttributedString value)") } @@ -135,7 +135,7 @@ public class ErroneousStreamMappingTest { diagnostics = { @Diagnostic(type = ErroneousListToStreamNoElementMappingFound.class, kind = Kind.ERROR, - line = 38, + line = 25, messageRegExp = "Can't map Stream element \".*WithProperties withProperties\" to \".*NoProperties noProperties\"." + " Consider to declare/implement a mapping method: \".*NoProperties map\\(.*WithProperties " + @@ -153,7 +153,7 @@ public class ErroneousStreamMappingTest { diagnostics = { @Diagnostic(type = ErroneousListToStreamNoElementMappingFoundDisabledAuto.class, kind = Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Can't map stream element \".*AttributedString\" to \".*String \". Consider to " + "declare/implement a mapping method: \".*String map\\(.*AttributedString value\\)") } @@ -168,7 +168,7 @@ public class ErroneousStreamMappingTest { diagnostics = { @Diagnostic(type = ErroneousStreamToListNoElementMappingFound.class, kind = Kind.ERROR, - line = 38, + line = 25, messageRegExp = "Can't map Stream element \".*WithProperties withProperties\" to .*NoProperties noProperties\"." + " Consider to declare/implement a mapping method: \".*NoProperties map(.*WithProperties value)") @@ -185,7 +185,7 @@ public class ErroneousStreamMappingTest { diagnostics = { @Diagnostic(type = ErroneousStreamToListNoElementMappingFoundDisabledAuto.class, kind = Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Can't map stream element \".*AttributedString\" to .*String \". Consider to " + "declare/implement a mapping method: \".*String map(.*AttributedString value)") } diff --git a/processor/src/test/java/org/mapstruct/ap/test/java8stream/forged/ForgedStreamMappingTest.java b/processor/src/test/java/org/mapstruct/ap/test/java8stream/forged/ForgedStreamMappingTest.java index 524bfa956..3737584a8 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/java8stream/forged/ForgedStreamMappingTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/java8stream/forged/ForgedStreamMappingTest.java @@ -69,7 +69,7 @@ public class ForgedStreamMappingTest { diagnostics = { @Diagnostic(type = ErroneousStreamNonMappableStreamMapper.class, kind = Kind.ERROR, - line = 30, + line = 17, messageRegExp = "Can't map Stream element \".* nonMappableStream\" to \".* nonMappableStream\". " + "Consider to declare/implement a mapping method: .*."), } diff --git a/processor/src/test/java/org/mapstruct/ap/test/java8stream/wildcard/WildCardTest.java b/processor/src/test/java/org/mapstruct/ap/test/java8stream/wildcard/WildCardTest.java index db9197fcc..a24a9d8b5 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/java8stream/wildcard/WildCardTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/java8stream/wildcard/WildCardTest.java @@ -70,7 +70,7 @@ public class WildCardTest { diagnostics = { @Diagnostic(type = ErroneousIterableSuperBoundSourceMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 34, + line = 21, messageRegExp = "Can't generate mapping method for a wildcard super bound source.") } ) @@ -84,7 +84,7 @@ public class WildCardTest { diagnostics = { @Diagnostic(type = ErroneousIterableExtendsBoundTargetMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 34, + line = 21, messageRegExp = "Can't generate mapping method for a wildcard extends bound result.") } ) @@ -98,7 +98,7 @@ public class WildCardTest { diagnostics = { @Diagnostic(type = ErroneousIterableTypeVarBoundMapperOnMethod.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 34, + line = 21, messageRegExp = "Can't generate mapping method for a generic type variable target.") } ) @@ -112,7 +112,7 @@ public class WildCardTest { diagnostics = { @Diagnostic(type = ErroneousIterableTypeVarBoundMapperOnMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 34, + line = 21, messageRegExp = "Can't generate mapping method for a generic type variable source.") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/mapperconfig/ConfigTest.java b/processor/src/test/java/org/mapstruct/ap/test/mapperconfig/ConfigTest.java index c481f9f1c..cd7e56a93 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/mapperconfig/ConfigTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/mapperconfig/ConfigTest.java @@ -57,7 +57,7 @@ public class ConfigTest { @ExpectedCompilationOutcome(value = CompilationResult.SUCCEEDED, diagnostics = { @Diagnostic(type = SourceTargetMapperWarn.class, - kind = javax.tools.Diagnostic.Kind.WARNING, line = 37, + kind = javax.tools.Diagnostic.Kind.WARNING, line = 24, messageRegExp = "Unmapped target property: \"noFoo\"") }) public void shouldUseWARNViaMapper() { @@ -68,7 +68,7 @@ public class ConfigTest { @ExpectedCompilationOutcome(value = CompilationResult.FAILED, diagnostics = { @Diagnostic(type = SourceTargetMapperErroneous.class, - kind = javax.tools.Diagnostic.Kind.ERROR, line = 33, + kind = javax.tools.Diagnostic.Kind.ERROR, line = 20, messageRegExp = "Unmapped target property: \"noFoo\"") }) public void shouldUseERRORViaMapperConfig() { diff --git a/processor/src/test/java/org/mapstruct/ap/test/namesuggestion/SuggestMostSimilarNameTest.java b/processor/src/test/java/org/mapstruct/ap/test/namesuggestion/SuggestMostSimilarNameTest.java index 60a38740f..1c4c23bb9 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/namesuggestion/SuggestMostSimilarNameTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/namesuggestion/SuggestMostSimilarNameTest.java @@ -32,7 +32,7 @@ public class SuggestMostSimilarNameTest { diagnostics = { @Diagnostic(type = PersonAgeMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 32, + line = 19, messageRegExp = ".*Did you mean \"age\"\\?") } ) @@ -48,7 +48,7 @@ public class SuggestMostSimilarNameTest { diagnostics = { @Diagnostic(type = PersonNameMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 32, + line = 19, messageRegExp = ".*Did you mean \"fullName\"\\?") } ) @@ -64,11 +64,11 @@ public class SuggestMostSimilarNameTest { diagnostics = { @Diagnostic(type = PersonGarageWrongTargetMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 32, + line = 19, messageRegExp = "Unknown property \"garage\\.colour\\.rgb\".*Did you mean \"garage\\.color\"\\?"), @Diagnostic(type = PersonGarageWrongTargetMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Unknown property \"garage\\.colour\".*Did you mean \"garage\\.color\"\\?") } ) @@ -84,11 +84,11 @@ public class SuggestMostSimilarNameTest { diagnostics = { @Diagnostic(type = PersonGarageWrongSourceMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 32, + line = 19, messageRegExp = "No property named \"garage\\.colour\\.rgb\".*Did you mean \"garage\\.color\"\\?"), @Diagnostic(type = PersonGarageWrongSourceMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35, + line = 22, messageRegExp = "No property named \"garage\\.colour\".*Did you mean \"garage\\.color\"\\?") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/DisablingNestedSimpleBeansMappingTest.java b/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/DisablingNestedSimpleBeansMappingTest.java index 4b2de8f14..3236429fc 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/DisablingNestedSimpleBeansMappingTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/DisablingNestedSimpleBeansMappingTest.java @@ -32,7 +32,7 @@ public class DisablingNestedSimpleBeansMappingTest { diagnostics = { @Diagnostic(type = ErroneousDisabledHouseMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \".*\\.Roof roof\" to \".*\\.RoofDto roof\"\\. Consider to " + "declare/implement a mapping method: \".*\\.RoofDto map\\(.*\\.Roof value\\)\"\\." ) @@ -49,7 +49,7 @@ public class DisablingNestedSimpleBeansMappingTest { diagnostics = { @Diagnostic(type = ErroneousDisabledViaConfigHouseMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \".*\\.Roof roof\" to \".*\\.RoofDto roof\"\\. Consider to " + "declare/implement a mapping method: \".*\\.RoofDto map\\(.*\\.Roof value\\)\"\\." ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/DottedErrorMessageTest.java b/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/DottedErrorMessageTest.java index 371566a59..1d684ec50 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/DottedErrorMessageTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/DottedErrorMessageTest.java @@ -99,7 +99,7 @@ public class DottedErrorMessageTest { diagnostics = { @Diagnostic(type = BaseDeepNestingMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"rgb\"\\. Mapping from " + PROPERTY + " \".*Color house\\.roof\\.color\" to \".*ColorDto house\\.roof\\.color\"\\.") } @@ -116,7 +116,7 @@ public class DottedErrorMessageTest { diagnostics = { @Diagnostic(type = BaseDeepListMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"left\"\\. Mapping from " + COLLECTION_ELEMENT + " \".*Wheel car\\.wheels\" to \".*WheelDto car\\.wheels\"\\.") } @@ -133,7 +133,7 @@ public class DottedErrorMessageTest { diagnostics = { @Diagnostic(type = BaseDeepMapKeyMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"pronunciation\"\\. Mapping from " + MAP_KEY + " \".*Word dictionary\\.wordMap\\{:key\\}\" to \".*WordDto dictionary\\.wordMap\\{:key\\}\"\\.") } @@ -150,7 +150,7 @@ public class DottedErrorMessageTest { diagnostics = { @Diagnostic(type = BaseDeepMapValueMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"pronunciation\"\\. Mapping from " + MAP_VALUE + " \".*ForeignWord dictionary\\.wordMap\\{:value\\}\" " + "to \".*ForeignWordDto dictionary\\.wordMap\\{:value\\}\"\\.") @@ -168,7 +168,7 @@ public class DottedErrorMessageTest { diagnostics = { @Diagnostic(type = BaseCollectionElementPropertyMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"color\"\\. Mapping from " + PROPERTY + " \".*Info computers\\[\\].info\" to \".*InfoDto computers\\[\\].info\"\\.") } @@ -185,7 +185,7 @@ public class DottedErrorMessageTest { diagnostics = { @Diagnostic(type = BaseValuePropertyMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"color\"\\. Mapping from " + PROPERTY + " \".*Info catNameMap\\{:value\\}.info\" to \".*InfoDto catNameMap\\{:value\\}.info\"\\.") } @@ -202,7 +202,7 @@ public class DottedErrorMessageTest { diagnostics = { @Diagnostic(type = UnmappableEnumMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 38, + line = 25, messageRegExp = "The following constants from the property \".*RoofType house\\.roof\\.type\" enum " + "have no corresponding constant in the \".*ExternalRoofType house\\.roof\\.type\" enum and must " + "be be mapped via adding additional mappings: NORMAL\\." @@ -226,33 +226,33 @@ public class DottedErrorMessageTest { diagnostics = { @Diagnostic(type = BaseDeepNestingMapper.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"rgb\"\\. Mapping from " + PROPERTY + " \".*Color house\\.roof\\.color\" to \".*ColorDto house\\.roof\\.color\"\\."), @Diagnostic(type = BaseDeepListMapper.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"left\"\\. Mapping from " + COLLECTION_ELEMENT + " \".*Wheel car\\.wheels\" to \".*WheelDto car\\.wheels\"\\."), @Diagnostic(type = BaseDeepMapKeyMapper.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"pronunciation\"\\. Mapping from " + MAP_KEY + " \".*Word dictionary\\.wordMap\\{:key\\}\" to \".*WordDto dictionary\\.wordMap\\{:key\\}\"\\."), @Diagnostic(type = BaseDeepMapValueMapper.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"pronunciation\"\\. Mapping from " + MAP_VALUE + " \".*ForeignWord dictionary\\.wordMap\\{:value\\}\" " + "to \".*ForeignWordDto dictionary\\.wordMap\\{:value\\}\"\\."), @Diagnostic(type = BaseCollectionElementPropertyMapper.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"color\"\\. Mapping from " + PROPERTY + " \".*Info computers\\[\\].info\" to \".*InfoDto computers\\[\\].info\"\\."), @Diagnostic(type = BaseValuePropertyMapper.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 23, + line = 10, messageRegExp = "Unmapped target property: \"color\"\\. Mapping from " + PROPERTY + " \".*Info catNameMap\\{:value\\}.info\" to \".*InfoDto catNameMap\\{:value\\}.info\"\\.") } diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/exclusions/ErroneousJavaInternalTest.java b/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/exclusions/ErroneousJavaInternalTest.java index ef89bea84..cd05ad64b 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/exclusions/ErroneousJavaInternalTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/exclusions/ErroneousJavaInternalTest.java @@ -30,24 +30,24 @@ public class ErroneousJavaInternalTest { diagnostics = { @Diagnostic(type = ErroneousJavaInternalMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \".*MyType date\" to \"java\\.util\\.Date date\"\\. Consider to " + "declare/implement a mapping method: \"java\\.util\\.Date map\\(.*MyType value\\)\"\\."), @Diagnostic(type = ErroneousJavaInternalMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \".*MyType calendar\" to \"java\\.util\\.GregorianCalendar " + "calendar\"\\. Consider to declare/implement a mapping method: \"java\\.util\\.GregorianCalendar " + "map\\(.*MyType value\\)\"\\."), @Diagnostic(type = ErroneousJavaInternalMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \".*List<.*MyType> types\" to \".*List<.*String> types\"\\" + ". Consider to declare/implement a mapping method: \".*List<.*String> map\\(.*List<.*MyType> " + "value\\)\"\\."), @Diagnostic(type = ErroneousJavaInternalMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \".*List<.*MyType> nestedMyType\\.deepNestedType\\.types\" to \"" + ".*List<.*String> nestedMyType\\.deepNestedType\\.types\"\\. Consider to declare/implement a " + "mapping method: \".*List<.*String> map\\(.*List<.*MyType> value\\)\"\\.") diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/exclusions/custom/ErroneousCustomExclusionTest.java b/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/exclusions/custom/ErroneousCustomExclusionTest.java index a515d52f7..b34a8d451 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/exclusions/custom/ErroneousCustomExclusionTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedbeans/exclusions/custom/ErroneousCustomExclusionTest.java @@ -32,7 +32,7 @@ public class ErroneousCustomExclusionTest { diagnostics = { @Diagnostic(type = ErroneousCustomExclusionMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 30, + line = 17, messageRegExp = "Can't map property \".*NestedSource nested\" to \".*NestedTarget nested\"\\. " + "Consider to declare/implement a mapping method: \".*NestedTarget map\\(.*NestedSource value\\)" + "\"\\.") diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedsourceproperties/NestedSourcePropertiesTest.java b/processor/src/test/java/org/mapstruct/ap/test/nestedsourceproperties/NestedSourcePropertiesTest.java index ae5d45e40..6fab4df19 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/nestedsourceproperties/NestedSourcePropertiesTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedsourceproperties/NestedSourcePropertiesTest.java @@ -170,7 +170,7 @@ public class NestedSourcePropertiesTest { diagnostics = { @Diagnostic( type = ArtistToChartEntryErroneous.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 47, + line = 34, messageRegExp = "java.lang.Integer does not have an accessible parameterless constructor." ) } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/reverse/InheritInverseConfigurationTest.java b/processor/src/test/java/org/mapstruct/ap/test/reverse/InheritInverseConfigurationTest.java index 81f3b5390..fa7b4015c 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/reverse/InheritInverseConfigurationTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/reverse/InheritInverseConfigurationTest.java @@ -60,12 +60,12 @@ public class InheritInverseConfigurationTest { diagnostics = { @Diagnostic(type = SourceTargetMapperAmbiguous1.class, kind = Kind.ERROR, - line = 51, + line = 38, messageRegExp = "Several matching inverse methods exist: forward\\(\\), " + "forwardNotToReverse\\(\\). Specify a name explicitly."), @Diagnostic(type = SourceTargetMapperAmbiguous1.class, kind = Kind.WARNING, - line = 56, + line = 43, messageRegExp = "Unmapped target properties: \"stringPropX, integerPropX\"") } ) @@ -79,12 +79,12 @@ public class InheritInverseConfigurationTest { diagnostics = { @Diagnostic(type = SourceTargetMapperAmbiguous2.class, kind = Kind.ERROR, - line = 51, + line = 38, messageRegExp = "None of the candidates forward\\(\\), forwardNotToReverse\\(\\) matches given " + "name: \"blah\"."), @Diagnostic(type = SourceTargetMapperAmbiguous2.class, kind = Kind.WARNING, - line = 56, + line = 43, messageRegExp = "Unmapped target properties: \"stringPropX, integerPropX\"") } ) @@ -98,12 +98,12 @@ public class InheritInverseConfigurationTest { diagnostics = { @Diagnostic(type = SourceTargetMapperAmbiguous3.class, kind = Kind.ERROR, - line = 52, + line = 39, messageRegExp = "Given name \"forward\" matches several candidate methods: .*forward\\(.+\\), " + ".*forward\\(.+\\)"), @Diagnostic(type = SourceTargetMapperAmbiguous3.class, kind = Kind.WARNING, - line = 57, + line = 44, messageRegExp = "Unmapped target properties: \"stringPropX, integerPropX\"") } ) @@ -117,12 +117,12 @@ public class InheritInverseConfigurationTest { diagnostics = { @Diagnostic(type = SourceTargetMapperNonMatchingName.class, kind = Kind.ERROR, - line = 44, + line = 31, messageRegExp = "Given name \"blah\" does not match the only candidate. Did you mean: " + "\"forward\"."), @Diagnostic(type = SourceTargetMapperNonMatchingName.class, kind = Kind.WARNING, - line = 49, + line = 36, messageRegExp = "Unmapped target properties: \"stringPropX, integerPropX\"") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/selection/generics/ConversionTest.java b/processor/src/test/java/org/mapstruct/ap/test/selection/generics/ConversionTest.java index e5f17afa9..3d4df45bd 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/selection/generics/ConversionTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/selection/generics/ConversionTest.java @@ -84,7 +84,7 @@ public class ConversionTest { @ExpectedCompilationOutcome(value = CompilationResult.FAILED, diagnostics = { @Diagnostic(type = ErroneousSourceTargetMapper1.class, - kind = javax.tools.Diagnostic.Kind.ERROR, line = 29, + kind = javax.tools.Diagnostic.Kind.ERROR, line = 16, messageRegExp = "Can't map property \"org.mapstruct.ap.test.selection.generics.UpperBoundWrapper" + " fooUpperBoundFailure\" to " + "\"org.mapstruct.ap.test.selection.generics.TypeA fooUpperBoundFailure\"") @@ -98,7 +98,7 @@ public class ConversionTest { diagnostics = { @Diagnostic(type = ErroneousSourceTargetMapper2.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \"org.mapstruct.ap.test.selection.generics.WildCardExtendsWrapper" + " fooWildCardExtendsTypeAFailure\" to" + " \"org.mapstruct.ap.test.selection.generics.TypeA fooWildCardExtendsTypeAFailure\"") @@ -112,7 +112,7 @@ public class ConversionTest { diagnostics = { @Diagnostic(type = ErroneousSourceTargetMapper3.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \"org.mapstruct.ap.test.selection.generics." + "WildCardExtendsMBWrapper " + "fooWildCardExtendsMBTypeBFailure\" to \"org.mapstruct.ap.test.selection.generics.TypeB " @@ -127,7 +127,7 @@ public class ConversionTest { diagnostics = { @Diagnostic(type = ErroneousSourceTargetMapper4.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \"org.mapstruct.ap.test.selection.generics.WildCardSuperWrapper" + " fooWildCardSuperTypeAFailure\" to" + " \"org.mapstruct.ap.test.selection.generics.TypeA fooWildCardSuperTypeAFailure\"") @@ -141,7 +141,7 @@ public class ConversionTest { diagnostics = { @Diagnostic(type = ErroneousSourceTargetMapper5.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \"org.mapstruct.ap.test.selection.generics.WildCardSuperWrapper" + " fooWildCardSuperTypeCFailure\" to" + " \"org.mapstruct.ap.test.selection.generics.TypeC fooWildCardSuperTypeCFailure\"") @@ -160,14 +160,14 @@ public class ConversionTest { diagnostics = { @Diagnostic(type = ErroneousSourceTargetMapper6.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Can't map property \".*NoProperties " + "foo\\.wrapped\" to" + " \"org.mapstruct.ap.test.selection.generics.TypeA " + "foo\\.wrapped\""), @Diagnostic(type = ErroneousSourceTargetMapper6.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 29, + line = 16, messageRegExp = ".*\\.generics\\.WildCardSuperWrapper<.*\\.generics\\.TypeA> does not have an " + "accessible parameterless constructor\\.") diff --git a/processor/src/test/java/org/mapstruct/ap/test/selection/qualifier/QualifierTest.java b/processor/src/test/java/org/mapstruct/ap/test/selection/qualifier/QualifierTest.java index 7e9e9a64f..7454b36f8 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/selection/qualifier/QualifierTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/selection/qualifier/QualifierTest.java @@ -100,7 +100,7 @@ public class QualifierTest { diagnostics = { @Diagnostic( type = ErroneousMapper.class, kind = Kind.ERROR, - line = 42, + line = 29, messageRegExp = "Ambiguous mapping methods found for mapping property " + "\"java.lang.String title\" to java.lang.String.*" ) } @@ -173,12 +173,12 @@ public class QualifierTest { diagnostics = { @Diagnostic(type = ErroneousMovieFactoryMapper.class, kind = Kind.ERROR, - line = 37, + line = 24, messageRegExp = "'nullValueMappingStrategy', 'resultType' and 'qualifiedBy' are undefined in " + "@BeanMapping, define at least one of them."), @Diagnostic(type = ErroneousMovieFactoryMapper.class, kind = Kind.ERROR, - line = 37, + line = 24, messageRegExp = "The return type .*\\.AbstractEntry is an abstract class or interface. Provide a non " + "abstract / non interface result type or a factory method.") } diff --git a/processor/src/test/java/org/mapstruct/ap/test/selection/resulttype/InheritanceSelectionTest.java b/processor/src/test/java/org/mapstruct/ap/test/selection/resulttype/InheritanceSelectionTest.java index cdfc4024f..ed9f81348 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/selection/resulttype/InheritanceSelectionTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/selection/resulttype/InheritanceSelectionTest.java @@ -44,13 +44,13 @@ public class InheritanceSelectionTest { diagnostics = { @Diagnostic(type = ErroneousFruitMapper.class, kind = Kind.ERROR, - line = 36, + line = 23, messageRegExp = "Ambiguous factory methods found for creating .*Fruit: " + ".*Apple .*ConflictingFruitFactory\\.createApple\\(\\), " + ".*Banana .*ConflictingFruitFactory\\.createBanana\\(\\)\\."), @Diagnostic(type = ErroneousFruitMapper.class, kind = Kind.ERROR, - line = 36, + line = 23, messageRegExp = ".*Fruit does not have an accessible parameterless constructor\\.") } ) @@ -65,7 +65,7 @@ public class InheritanceSelectionTest { diagnostics = { @Diagnostic(type = ErroneousResultTypeNoEmptyConstructorMapper.class, kind = Kind.ERROR, - line = 31, + line = 18, messageRegExp = ".*\\.resulttype\\.Banana does not have an accessible parameterless constructor\\.") } ) @@ -111,7 +111,7 @@ public class InheritanceSelectionTest { diagnostics = { @Diagnostic(type = ResultTypeConstructingFruitInterfaceErroneousMapper.class, kind = Kind.ERROR, - line = 36, + line = 23, messageRegExp = "The return type .*\\.IsFruit is an abstract class or interface. Provide a non " + "abstract / non interface result type or a factory method." ) @@ -128,7 +128,7 @@ public class InheritanceSelectionTest { diagnostics = { @Diagnostic(type = ErroneousFruitMapper2.class, kind = Kind.ERROR, - line = 35, + line = 22, messageRegExp = ".*\\.Banana not assignable to: .*\\.Apple.") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/severalsources/SeveralSourceParametersTest.java b/processor/src/test/java/org/mapstruct/ap/test/severalsources/SeveralSourceParametersTest.java index 95d8095f4..4ac88be38 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/severalsources/SeveralSourceParametersTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/severalsources/SeveralSourceParametersTest.java @@ -142,15 +142,15 @@ public class SeveralSourceParametersTest { diagnostics = { @Diagnostic(type = ErroneousSourceTargetMapper.class, kind = Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Several possible source properties for target property \"street\"."), @Diagnostic(type = ErroneousSourceTargetMapper.class, kind = Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Several possible source properties for target property \"zipCode\"."), @Diagnostic(type = ErroneousSourceTargetMapper.class, kind = Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Several possible source properties for target property \"description\".") }) public void shouldFailToGenerateMappingsForAmbigiousSourceProperty() { @@ -169,7 +169,7 @@ public class SeveralSourceParametersTest { @Diagnostic( type = ErroneousSourceTargetMapper2.class, kind = Kind.ERROR, - line = 28, + line = 15, messageRegExp = "Method has no source parameter named \"houseNo\"\\." + " Method source parameters are: \"address, person\"\\." ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/source/constants/ConstantsTest.java b/processor/src/test/java/org/mapstruct/ap/test/source/constants/ConstantsTest.java index 7742f3c30..7182b6274 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/source/constants/ConstantsTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/source/constants/ConstantsTest.java @@ -69,31 +69,31 @@ public class ConstantsTest { diagnostics = { @Diagnostic(type = ErroneousConstantMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 39, + line = 25, messageRegExp = "^.*only 'true' or 'false' are supported\\.$"), @Diagnostic(type = ErroneousConstantMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 40, + line = 26, messageRegExp = "^.*invalid character literal\\.$"), @Diagnostic(type = ErroneousConstantMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 41, + line = 27, messageRegExp = "^.*Value out of range. Value:\"200\" Radix:10\\.$"), @Diagnostic(type = ErroneousConstantMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 42, + line = 28, messageRegExp = "^.*integer number too large.$"), @Diagnostic(type = ErroneousConstantMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 43, + line = 29, messageRegExp = "^.*L/l mandatory for long types.$"), @Diagnostic(type = ErroneousConstantMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 44, + line = 30, messageRegExp = "^.*improperly placed underscores.$"), @Diagnostic(type = ErroneousConstantMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 45, + line = 31, messageRegExp = "^.*floating point number too small.$") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/source/constants/SourceConstantsTest.java b/processor/src/test/java/org/mapstruct/ap/test/source/constants/SourceConstantsTest.java index b1929f4ea..b03b42b3e 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/source/constants/SourceConstantsTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/source/constants/SourceConstantsTest.java @@ -90,12 +90,12 @@ public class SourceConstantsTest { diagnostics = { @Diagnostic(type = ErroneousMapper1.class, kind = Kind.ERROR, - line = 37, + line = 24, messageRegExp = "Source and constant are both defined in @Mapping, either define a source or a " + "constant"), @Diagnostic(type = ErroneousMapper1.class, kind = Kind.WARNING, - line = 43, + line = 30, messageRegExp = "Unmapped target property: \"integerConstant\"") } ) @@ -116,13 +116,13 @@ public class SourceConstantsTest { diagnostics = { @Diagnostic(type = ErroneousMapper3.class, kind = Kind.ERROR, - line = 37, + line = 24, messageRegExp = "Expression and constant are both defined in @Mapping, either define an expression or a " + "constant"), @Diagnostic(type = ErroneousMapper3.class, kind = Kind.WARNING, - line = 43, + line = 30, messageRegExp = "Unmapped target property: \"integerConstant\"") } ) @@ -143,12 +143,12 @@ public class SourceConstantsTest { diagnostics = { @Diagnostic(type = ErroneousMapper4.class, kind = Kind.ERROR, - line = 37, + line = 24, messageRegExp = "Source and expression are both defined in @Mapping, either define a source or an " + "expression"), @Diagnostic(type = ErroneousMapper4.class, kind = Kind.WARNING, - line = 43, + line = 30, messageRegExp = "Unmapped target property: \"integerConstant\"") } ) @@ -191,12 +191,12 @@ public class SourceConstantsTest { diagnostics = { @Diagnostic(type = ErroneousMapper5.class, kind = Kind.ERROR, - line = 43, + line = 30, messageRegExp = "^Constant \"DENMARK\" doesn't exist in enum type org.mapstruct.ap.test.source." + "constants.CountryEnum for property \"country\".$"), @Diagnostic(type = ErroneousMapper5.class, kind = Kind.ERROR, - line = 41, + line = 28, messageRegExp = "^Can't map \"java.lang.String \"DENMARK\"\" to \"org.mapstruct.ap.test.source." + "constants.CountryEnum country\".$") } @@ -218,7 +218,7 @@ public class SourceConstantsTest { diagnostics = { @Diagnostic(type = ErroneousMapper6.class, kind = Kind.ERROR, - line = 38, + line = 25, messageRegExp = "^.*Can't map \"java.lang.String \"3001\"\" to \"java.lang.Long " + "longWrapperConstant\".*$") } diff --git a/processor/src/test/java/org/mapstruct/ap/test/source/defaultExpressions/java/JavaDefaultExpressionTest.java b/processor/src/test/java/org/mapstruct/ap/test/source/defaultExpressions/java/JavaDefaultExpressionTest.java index 660c00dd8..09343d597 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/source/defaultExpressions/java/JavaDefaultExpressionTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/source/defaultExpressions/java/JavaDefaultExpressionTest.java @@ -55,13 +55,13 @@ public class JavaDefaultExpressionTest { diagnostics = { @Diagnostic(type = ErroneousDefaultExpressionExpressionMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Expression and default expression are both defined in @Mapping," + " either define an expression or a default expression." ), @Diagnostic(type = ErroneousDefaultExpressionExpressionMapper.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 39, + line = 26, messageRegExp = "Unmapped target property: \"sourceId\"" ) } @@ -76,13 +76,13 @@ public class JavaDefaultExpressionTest { diagnostics = { @Diagnostic(type = ErroneousDefaultExpressionConstantMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Constant and default expression are both defined in @Mapping," + " either define a constant or a default expression." ), @Diagnostic(type = ErroneousDefaultExpressionConstantMapper.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 38, + line = 25, messageRegExp = "Unmapped target property: \"sourceId\"" ) } @@ -97,13 +97,13 @@ public class JavaDefaultExpressionTest { diagnostics = { @Diagnostic(type = ErroneousDefaultExpressionDefaultValueMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Default value and default expression are both defined in @Mapping," + " either define a default value or a default expression." ), @Diagnostic(type = ErroneousDefaultExpressionDefaultValueMapper.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 38, + line = 25, messageRegExp = "Unmapped target property: \"sourceId\"" ) } @@ -118,7 +118,7 @@ public class JavaDefaultExpressionTest { diagnostics = { @Diagnostic(type = ErroneousDefaultExpressionMapper.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Value for default expression must be given in the form \"java\\(\\)\"" ) } diff --git a/processor/src/test/java/org/mapstruct/ap/test/template/InheritConfigurationTest.java b/processor/src/test/java/org/mapstruct/ap/test/template/InheritConfigurationTest.java index c97efe428..1b5c9c9cc 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/template/InheritConfigurationTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/template/InheritConfigurationTest.java @@ -121,12 +121,12 @@ public class InheritConfigurationTest { diagnostics = { @Diagnostic(type = SourceTargetMapperAmbiguous1.class, kind = Kind.ERROR, - line = 56, + line = 43, messageRegExp = "Several matching methods exist: forwardCreate\\(\\), " + "forwardCreate1\\(\\). Specify a name explicitly."), @Diagnostic(type = SourceTargetMapperAmbiguous1.class, kind = Kind.WARNING, - line = 57, + line = 44, messageRegExp = "Unmapped target properties: \"stringPropY, integerPropY, constantProp, " + "expressionProp, nestedResultProp\"") } @@ -141,12 +141,12 @@ public class InheritConfigurationTest { diagnostics = { @Diagnostic(type = SourceTargetMapperAmbiguous2.class, kind = Kind.ERROR, - line = 56, + line = 43, messageRegExp = "None of the candidates forwardCreate\\(\\), forwardCreate1\\(\\) matches given " + "name: \"blah\"."), @Diagnostic(type = SourceTargetMapperAmbiguous2.class, kind = Kind.WARNING, - line = 57, + line = 44, messageRegExp = "Unmapped target properties: \"stringPropY, integerPropY, constantProp, " + "expressionProp, nestedResultProp\"") } @@ -161,12 +161,12 @@ public class InheritConfigurationTest { diagnostics = { @Diagnostic(type = SourceTargetMapperAmbiguous3.class, kind = Kind.ERROR, - line = 56, + line = 43, messageRegExp = "Given name \"forwardCreate\" matches several candidate methods: " + ".*forwardCreate.*, .*forwardCreate.*"), @Diagnostic(type = SourceTargetMapperAmbiguous3.class, kind = Kind.WARNING, - line = 57, + line = 44, messageRegExp = "Unmapped target properties: \"stringPropY, integerPropY, constantProp, " + "expressionProp, nestedResultProp\"") } ) @@ -180,12 +180,12 @@ public class InheritConfigurationTest { diagnostics = { @Diagnostic(type = SourceTargetMapperNonMatchingName.class, kind = Kind.ERROR, - line = 47, + line = 34, messageRegExp = "Given name \"blah\" does not match the only candidate. Did you mean: " + "\"forwardCreate\"."), @Diagnostic(type = SourceTargetMapperNonMatchingName.class, kind = Kind.WARNING, - line = 48, + line = 35, messageRegExp = "Unmapped target properties: \"stringPropY, integerPropY, constantProp, " + "expressionProp, nestedResultProp\"") } diff --git a/processor/src/test/java/org/mapstruct/ap/test/unmappedsource/UnmappedSourceTest.java b/processor/src/test/java/org/mapstruct/ap/test/unmappedsource/UnmappedSourceTest.java index 0f7e526db..999064237 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/unmappedsource/UnmappedSourceTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/unmappedsource/UnmappedSourceTest.java @@ -34,11 +34,11 @@ public class UnmappedSourceTest { diagnostics = { @Diagnostic(type = SourceTargetMapper.class, kind = Kind.WARNING, - line = 33, + line = 20, messageRegExp = "Unmapped source property: \"qux\""), @Diagnostic(type = SourceTargetMapper.class, kind = Kind.WARNING, - line = 35, + line = 22, messageRegExp = "Unmapped source property: \"bar\"") } ) @@ -60,11 +60,11 @@ public class UnmappedSourceTest { diagnostics = { @Diagnostic(type = ErroneousStrictSourceTargetMapper.class, kind = Kind.ERROR, - line = 33, + line = 20, messageRegExp = "Unmapped source property: \"qux\""), @Diagnostic(type = ErroneousStrictSourceTargetMapper.class, kind = Kind.ERROR, - line = 35, + line = 22, messageRegExp = "Unmapped source property: \"bar\"") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/unmappedtarget/UnmappedProductTest.java b/processor/src/test/java/org/mapstruct/ap/test/unmappedtarget/UnmappedProductTest.java index e1714f92f..b027202d9 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/unmappedtarget/UnmappedProductTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/unmappedtarget/UnmappedProductTest.java @@ -35,11 +35,11 @@ public class UnmappedProductTest { diagnostics = { @Diagnostic(type = SourceTargetMapper.class, kind = Kind.WARNING, - line = 29, + line = 16, messageRegExp = "Unmapped target property: \"bar\""), @Diagnostic(type = SourceTargetMapper.class, kind = Kind.WARNING, - line = 31, + line = 18, messageRegExp = "Unmapped target property: \"qux\"") } ) @@ -61,11 +61,11 @@ public class UnmappedProductTest { diagnostics = { @Diagnostic(type = ErroneousStrictSourceTargetMapper.class, kind = Kind.ERROR, - line = 30, + line = 17, messageRegExp = "Unmapped target property: \"bar\""), @Diagnostic(type = ErroneousStrictSourceTargetMapper.class, kind = Kind.ERROR, - line = 32, + line = 19, messageRegExp = "Unmapped target property: \"qux\"") } ) @@ -80,11 +80,11 @@ public class UnmappedProductTest { diagnostics = { @Diagnostic(type = SourceTargetMapper.class, kind = Kind.ERROR, - line = 29, + line = 16, messageRegExp = "Unmapped target property: \"bar\""), @Diagnostic(type = SourceTargetMapper.class, kind = Kind.ERROR, - line = 31, + line = 18, messageRegExp = "Unmapped target property: \"qux\"") } ) diff --git a/processor/src/test/java/org/mapstruct/ap/test/updatemethods/UpdateMethodsTest.java b/processor/src/test/java/org/mapstruct/ap/test/updatemethods/UpdateMethodsTest.java index cfa72e190..91db27719 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/updatemethods/UpdateMethodsTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/updatemethods/UpdateMethodsTest.java @@ -154,7 +154,7 @@ public class UpdateMethodsTest { diagnostics = { @Diagnostic(type = ErroneousOrganizationMapper1.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 37, + line = 24, messageRegExp = "No read accessor found for property \"company\" in target type.") } ) @@ -170,11 +170,11 @@ public class UpdateMethodsTest { diagnostics = { @Diagnostic(type = ErroneousOrganizationMapper2.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 37, + line = 24, messageRegExp = "No read accessor found for property \"type\" in target type."), @Diagnostic(type = ErroneousOrganizationMapper2.class, kind = javax.tools.Diagnostic.Kind.ERROR, - line = 48, + line = 35, messageRegExp = ".*\\.updatemethods\\.DepartmentEntity does not have an accessible parameterless " + "constructor\\.") @@ -194,7 +194,7 @@ public class UpdateMethodsTest { diagnostics = { @Diagnostic(type = CompanyMapper1.class, kind = javax.tools.Diagnostic.Kind.WARNING, - line = 36, + line = 23, messageRegExp = "Unmapped target property: \"employees\"\\. Mapping from property \"" + ".*UnmappableDepartmentDto department\" to \".*DepartmentEntity department.") } diff --git a/processor/src/test/java/org/mapstruct/ap/test/value/EnumToEnumMappingTest.java b/processor/src/test/java/org/mapstruct/ap/test/value/EnumToEnumMappingTest.java index b881532df..2403977d0 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/value/EnumToEnumMappingTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/value/EnumToEnumMappingTest.java @@ -214,7 +214,7 @@ public class EnumToEnumMappingTest { diagnostics = { @Diagnostic(type = ErroneousOrderMapperMappingSameConstantTwice.class, kind = Kind.ERROR, - line = 38, + line = 25, messageRegExp = "Source value mapping: \"EXTRA\" cannot be mapped more than once\\.") } ) @@ -228,11 +228,11 @@ public class EnumToEnumMappingTest { diagnostics = { @Diagnostic(type = ErroneousOrderMapperUsingUnknownEnumConstants.class, kind = Kind.ERROR, - line = 37, + line = 24, messageRegExp = "Constant FOO doesn't exist in enum type org.mapstruct.ap.test.value.OrderType\\."), @Diagnostic(type = ErroneousOrderMapperUsingUnknownEnumConstants.class, kind = Kind.ERROR, - line = 38, + line = 25, messageRegExp = "Constant BAR doesn't exist in enum type org.mapstruct.ap.test.value." + "ExternalOrderType\\.") } @@ -247,7 +247,7 @@ public class EnumToEnumMappingTest { diagnostics = { @Diagnostic(type = ErroneousOrderMapperNotMappingConstantWithoutMatchInTargetType.class, kind = Kind.ERROR, - line = 34, + line = 21, messageRegExp = "The following constants from the source enum have no corresponding constant in the " + "target enum and must be be mapped via adding additional mappings: EXTRA, STANDARD, NORMAL") } @@ -262,7 +262,7 @@ public class EnumToEnumMappingTest { diagnostics = { @Diagnostic(type = ErroneousOrderMapperDuplicateANY.class, kind = Kind.ERROR, - line = 39, + line = 26, messageRegExp = "Source = \"\" or \"\" can only be used once\\." ) } )