#1742 Add test case

This commit is contained in:
Filip Hrisafov 2019-09-26 22:25:59 +02:00
parent 81cd439343
commit 999d428ad8
6 changed files with 164 additions and 0 deletions

View File

@ -0,0 +1,18 @@
/*
* 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._1742;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
/**
* @author Filip Hrisafov
*/
@Mapper
public interface Issue1742Mapper {
void update(@MappingTarget Target target, Source source);
}

View File

@ -0,0 +1,32 @@
/*
* 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._1742;
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;
/**
* @author Filip Hrisafov
*/
@IssueKey("1742")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses( {
Issue1742Mapper.class,
NestedSource.class,
NestedTarget.class,
Source.class,
Target.class,
} )
public class Issue1742Test {
@Test
public void shouldCompile() {
}
}

View File

@ -0,0 +1,22 @@
/*
* 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._1742;
/**
* @author Filip Hrisafov
*/
public class NestedSource {
private String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -0,0 +1,48 @@
/*
* 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._1742;
/**
* @author Filip Hrisafov
*/
public class NestedTarget {
private String value;
public NestedTarget() {
}
public NestedTarget(Builder builder) {
this.value = getValue();
}
public static Builder builder() {
return new Builder();
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static class Builder {
private String value;
public Builder value(String value) {
this.value = value;
return this;
}
public NestedTarget create() {
return new NestedTarget(this);
}
}
}

View File

@ -0,0 +1,22 @@
/*
* 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._1742;
/**
* @author Filip Hrisafov
*/
public class Source {
private NestedSource nested;
public NestedSource getNested() {
return nested;
}
public void setNested(NestedSource nested) {
this.nested = nested;
}
}

View File

@ -0,0 +1,22 @@
/*
* 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._1742;
/**
* @author Filip Hrisafov
*/
public class Target {
private NestedTarget nested;
public NestedTarget getNested() {
return nested;
}
public void setNested(NestedTarget nested) {
this.nested = nested;
}
}