mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#2117 Add extra test case
This commit is contained in:
parent
bdc58b9602
commit
92b4316abd
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright MapStruct Authors.
|
||||
*
|
||||
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
package org.mapstruct.ap.test.bugs._2117;
|
||||
|
||||
import java.nio.file.AccessMode;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* @author Filip Hrisafov
|
||||
*/
|
||||
@Mapper
|
||||
public interface Issue2117Mapper {
|
||||
|
||||
Issue2117Mapper INSTANCE = Mappers.getMapper( Issue2117Mapper.class );
|
||||
|
||||
@Mapping(target = "accessMode", source = "accessMode")
|
||||
Target toTarget(AccessMode accessMode, String otherSource);
|
||||
|
||||
class Target {
|
||||
// CHECKSTYLE:OFF
|
||||
public AccessMode accessMode;
|
||||
// CHECKSTYLE ON
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright MapStruct Authors.
|
||||
*
|
||||
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
package org.mapstruct.ap.test.bugs._2117;
|
||||
|
||||
import java.nio.file.AccessMode;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mapstruct.ap.testutil.IssueKey;
|
||||
import org.mapstruct.ap.testutil.WithClasses;
|
||||
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* @author Filip Hrisafov
|
||||
*/
|
||||
@IssueKey("2117")
|
||||
@RunWith(AnnotationProcessorTestRunner.class)
|
||||
@WithClasses({
|
||||
Issue2117Mapper.class
|
||||
})
|
||||
public class Issue2117Test {
|
||||
|
||||
@Test
|
||||
public void shouldCompile() {
|
||||
|
||||
Issue2117Mapper.Target target = Issue2117Mapper.INSTANCE.toTarget( AccessMode.READ, null );
|
||||
|
||||
assertThat( target ).isNotNull();
|
||||
assertThat( target.accessMode ).isEqualTo( AccessMode.READ );
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user