diff --git a/src/test/java/org/mapstruct/intellij/bugs/_235/EnumImplementingInterfaceTest.java b/src/test/java/org/mapstruct/intellij/bugs/_235/EnumImplementingInterfaceTest.java new file mode 100644 index 0000000..b1bc8db --- /dev/null +++ b/src/test/java/org/mapstruct/intellij/bugs/_235/EnumImplementingInterfaceTest.java @@ -0,0 +1,31 @@ +/* + * Copyright MapStruct Authors. + * + * Licensed under the Apache License version 2.0, available at https://www.apache.org/licenses/LICENSE-2.0 + */ +package org.mapstruct.intellij.bugs._235; + +import org.jetbrains.annotations.NotNull; +import org.mapstruct.intellij.inspection.BaseInspectionTest; +import org.mapstruct.intellij.inspection.MapstructReferenceInspection; + +/** + * @author Oliver Erhart + */ +public class EnumImplementingInterfaceTest extends BaseInspectionTest { + + @Override + protected String getTestDataPath() { + return "testData/bugs/_235"; + } + + @NotNull + @Override + protected Class getInspection() { + return MapstructReferenceInspection.class; + } + + public void testEnumImplementingInterface() { + doTest(); + } +} diff --git a/testData/bugs/_235/EnumImplementingInterface.java b/testData/bugs/_235/EnumImplementingInterface.java new file mode 100644 index 0000000..9b2f1f7 --- /dev/null +++ b/testData/bugs/_235/EnumImplementingInterface.java @@ -0,0 +1,38 @@ +/* + * Copyright MapStruct Authors. + * + * Licensed under the Apache License version 2.0, available at https://www.apache.org/licenses/LICENSE-2.0 + */ + +import org.mapstruct.Mapper; + +interface DbEnum { + T getDbValue(); +} + +@Mapper +abstract class MyMapper { + + enum CheeseType implements DbEnum { + BRIE(1), + ROQUEFORT(2); + + private final Integer dbValue; + + CheeseType(Integer dbValue) { + this.dbValue = dbValue; + } + + @Override + public Integer getDbValue() { + return dbValue; + } + } + + public enum OtherCheeseType { + BRIE, + ROQUEFORT + } + + public abstract CheeseType map(OtherCheeseType cheese); +} \ No newline at end of file