Skip to content

Commit

Permalink
mapstruct#1742 Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphr committed Sep 26, 2019
1 parent 318b30e commit 5656ae6
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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);
}
Original file line number Diff line number Diff line change
@@ -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() {

}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* 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);
}
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 5656ae6

Please sign in to comment.