File tree Expand file tree Collapse file tree 2 files changed +69
-0
lines changed
src/test/java/org/mapstruct/intellij/bugs/_235 Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright MapStruct Authors.
3+ *
4+ * Licensed under the Apache License version 2.0, available at https://www.apache.org/licenses/LICENSE-2.0
5+ */
6+ package org .mapstruct .intellij .bugs ._235 ;
7+
8+ import org .jetbrains .annotations .NotNull ;
9+ import org .mapstruct .intellij .inspection .BaseInspectionTest ;
10+ import org .mapstruct .intellij .inspection .MapstructReferenceInspection ;
11+
12+ /**
13+ * @author Oliver Erhart
14+ */
15+ public class EnumImplementingInterfaceTest extends BaseInspectionTest {
16+
17+ @ Override
18+ protected String getTestDataPath () {
19+ return "testData/bugs/_235" ;
20+ }
21+
22+ @ NotNull
23+ @ Override
24+ protected Class <MapstructReferenceInspection > getInspection () {
25+ return MapstructReferenceInspection .class ;
26+ }
27+
28+ public void testEnumImplementingInterface () {
29+ doTest ();
30+ }
31+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright MapStruct Authors.
3+ *
4+ * Licensed under the Apache License version 2.0, available at https://www.apache.org/licenses/LICENSE-2.0
5+ */
6+
7+ import org .mapstruct .Mapper ;
8+
9+ interface DbEnum <T > {
10+ T getDbValue ();
11+ }
12+
13+ @ Mapper
14+ abstract class MyMapper {
15+
16+ enum CheeseType implements DbEnum <Integer > {
17+ BRIE (1 ),
18+ ROQUEFORT (2 );
19+
20+ private final Integer dbValue ;
21+
22+ CheeseType (Integer dbValue ) {
23+ this .dbValue = dbValue ;
24+ }
25+
26+ @ Override
27+ public Integer getDbValue () {
28+ return dbValue ;
29+ }
30+ }
31+
32+ public enum OtherCheeseType {
33+ BRIE ,
34+ ROQUEFORT
35+ }
36+
37+ public abstract CheeseType map (OtherCheeseType cheese );
38+ }
You can’t perform that action at this time.
0 commit comments