Migrate tests to use new JUnit Jupiter Infrastructure

Update test annotations to be JUnit Jupiter compatible

Replace all Test annotations from tests that are run with the AnnotationProcessorTestRunner with ProcessorTest.
Replace JUnit 4 Test#expected with assertThatThrownBy from AssertJ.
Replace Rule for GeneratedSource with RegisterExtension.
Fix some tests that were not reverting the changes to the default Locale and TimeZone.
Replace usage of org.junit.Assert with equivalent from org.junit.jupiter.api.Assertions or AssertJ.
This commit is contained in:
Filip Hrisafov 2020-02-09 15:59:18 +01:00
parent ff27b2f70d
commit d4268e87e5
292 changed files with 1922 additions and 2744 deletions

View File

@ -20,7 +20,7 @@ import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.TypeVisitor;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mapstruct.ap.internal.util.JodaTimeConstants;
import org.mapstruct.ap.testutil.IssueKey;

View File

@ -20,7 +20,7 @@ import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.TypeVisitor;
import javax.tools.Diagnostic;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mapstruct.ap.internal.util.FormattingMessager;
import org.mapstruct.ap.internal.util.Message;
import org.mapstruct.ap.testutil.IssueKey;

View File

@ -25,7 +25,7 @@ import javax.lang.model.type.TypeVisitor;
import javax.lang.model.type.WildcardType;
import javax.lang.model.util.Types;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@ -6,12 +6,13 @@
package org.mapstruct.ap.internal.util;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.jupiter.api.Test;
/**
* @author Ciaran Liedeman

View File

@ -11,9 +11,9 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* @author Filip Hrisafov
@ -23,12 +23,12 @@ public class StringsTest {
private static final Locale TURKEY_LOCALE = getTurkeyLocale();
private Locale defaultLocale;
@Before
@BeforeEach
public void before() {
defaultLocale = Locale.getDefault();
}
@After
@AfterEach
public void after() {
Locale.setDefault( defaultLocale );
}

View File

@ -5,9 +5,9 @@
*/
package org.mapstruct.ap.spi.util;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Saheb Preet Singh

View File

@ -5,13 +5,11 @@
*/
package org.mapstruct.ap.test.abstractclass;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Test for the generation of implementation of abstract base classes.
@ -31,10 +29,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
Measurable.class,
Holder.class
})
@RunWith(AnnotationProcessorTestRunner.class)
public class AbstractClassTest {
@Test
@ProcessorTest
@IssueKey("64")
public void shouldCreateImplementationOfAbstractMethod() {
Source source = new Source();
@ -42,7 +39,7 @@ public class AbstractClassTest {
assertResult( SourceTargetMapper.INSTANCE.sourceToTarget( source ) );
}
@Test
@ProcessorTest
@IssueKey("165")
public void shouldCreateImplementationOfMethodFromSuper() {
Source source = new Source();
@ -50,7 +47,7 @@ public class AbstractClassTest {
assertResult( SourceTargetMapper.INSTANCE.sourceToTargetFromBaseMapper( source ) );
}
@Test
@ProcessorTest
@IssueKey("165")
public void shouldCreateImplementationOfMethodFromInterface() {
Source source = new Source();

View File

@ -5,19 +5,16 @@
*/
package org.mapstruct.ap.test.abstractclass.generics;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Andreas Gudian
*
*/
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("644,687,688")
@WithClasses({
AbstractAnimal.class,
@ -33,7 +30,7 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
})
public class GenericsHierarchyTest {
@Test
@ProcessorTest
public void determinesAnimalKeyGetter() {
AbstractAnimal source = new Elephant();
@ -47,7 +44,7 @@ public class GenericsHierarchyTest {
assertThat( target.getAnimalKey().typeParameterIsResolvedToKeyOfAllBeings() ).isFalse();
}
@Test
@ProcessorTest
public void determinesKeyOfAllBeingsGetter() {
AbstractHuman source = new Child();
@ -60,7 +57,7 @@ public class GenericsHierarchyTest {
assertThat( target.getKeyOfAllBeings().typeParameterIsResolvedToKeyOfAllBeings() ).isTrue();
}
@Test
@ProcessorTest
public void determinesItemCSourceSetter() {
Target target = new Target();
@ -72,7 +69,7 @@ public class GenericsHierarchyTest {
assertThat( source.getKey().typeParameterIsResolvedToAnimalKey() ).isTrue();
}
@Test
@ProcessorTest
public void determinesItemBSourceSetter() {
Target target = new Target();

View File

@ -5,16 +5,14 @@
*/
package org.mapstruct.ap.test.accessibility;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import static java.lang.reflect.Modifier.isPrivate;
import static java.lang.reflect.Modifier.isProtected;
import static java.lang.reflect.Modifier.isPublic;
import static org.junit.Assert.assertTrue;
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.junit.jupiter.api.Assertions.assertTrue;
/**
* Test for different accessibility modifiers
@ -22,10 +20,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
* @author Andreas Gudian
*/
@WithClasses({ Source.class, Target.class, DefaultSourceTargetMapperAbstr.class, DefaultSourceTargetMapperIfc.class })
@RunWith( AnnotationProcessorTestRunner.class )
public class AccessibilityTest {
@Test
@ProcessorTest
@IssueKey("103")
public void testGeneratedModifiersFromAbstractClassAreCorrect() throws Exception {
Class<?> defaultFromAbstract = loadForMapper( DefaultSourceTargetMapperAbstr.class );
@ -37,7 +34,7 @@ public class AccessibilityTest {
assertTrue( isDefault( modifiersFor( defaultFromAbstract, "defaultSourceToTarget" ) ) );
}
@Test
@ProcessorTest
@IssueKey("103")
public void testGeneratedModifiersFromInterfaceAreCorrect() throws Exception {
Class<?> defaultFromIfc = loadForMapper( DefaultSourceTargetMapperIfc.class );

View File

@ -5,16 +5,14 @@
*/
package org.mapstruct.ap.test.accessibility.referenced;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.mapstruct.ap.test.accessibility.referenced.a.ReferencedMapperDefaultOther;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.compilation.annotation.CompilationResult;
import org.mapstruct.ap.testutil.compilation.annotation.Diagnostic;
import org.mapstruct.ap.testutil.compilation.annotation.ExpectedCompilationOutcome;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.ap.testutil.runner.GeneratedSource;
/**
@ -23,13 +21,12 @@ import org.mapstruct.ap.testutil.runner.GeneratedSource;
* @author Sjaak Derksen
*/
@WithClasses( { Source.class, Target.class, ReferencedSource.class, ReferencedTarget.class } )
@RunWith( AnnotationProcessorTestRunner.class )
public class ReferencedAccessibilityTest {
@Rule
public final GeneratedSource generatedSource = new GeneratedSource();
@RegisterExtension
final GeneratedSource generatedSource = new GeneratedSource();
@Test
@ProcessorTest
@IssueKey("206")
@WithClasses({ SourceTargetMapperPrivate.class, ReferencedMapperPrivate.class })
@ExpectedCompilationOutcome(
@ -47,17 +44,17 @@ public class ReferencedAccessibilityTest {
generatedSource.addComparisonToFixtureFor( SourceTargetMapperPrivate.class );
}
@Test
@ProcessorTest
@IssueKey( "206" )
@WithClasses( { SourceTargetMapperDefaultSame.class, ReferencedMapperDefaultSame.class } )
public void shouldBeAbleToAccessDefaultMethodInReferencedInSamePackage() { }
@Test
@ProcessorTest
@IssueKey( "206" )
@WithClasses( { SourceTargetMapperProtected.class, ReferencedMapperProtected.class } )
public void shouldBeAbleToAccessProtectedMethodInReferencedInSamePackage() { }
@Test
@ProcessorTest
@IssueKey("206")
@WithClasses({ SourceTargetMapperDefaultOther.class, ReferencedMapperDefaultOther.class })
@ExpectedCompilationOutcome(
@ -75,12 +72,12 @@ public class ReferencedAccessibilityTest {
generatedSource.addComparisonToFixtureFor( SourceTargetMapperDefaultOther.class );
}
@Test
@ProcessorTest
@IssueKey( "206" )
@WithClasses( { AbstractSourceTargetMapperProtected.class, SourceTargetmapperProtectedBase.class } )
public void shouldBeAbleToAccessProtectedMethodInBase() { }
@Test
@ProcessorTest
@IssueKey("206")
@WithClasses({ AbstractSourceTargetMapperPrivate.class, SourceTargetmapperPrivateBase.class })
@ExpectedCompilationOutcome(

View File

@ -5,31 +5,28 @@
*/
package org.mapstruct.ap.test.array;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Arrays;
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.mapstruct.ap.test.array._target.ScientistDto;
import org.mapstruct.ap.test.array.source.Scientist;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.ap.testutil.runner.GeneratedSource;
import static org.assertj.core.api.Assertions.assertThat;
@WithClasses( { Scientist.class, ScientistDto.class, ScienceMapper.class } )
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("108")
public class ArrayMappingTest {
@Rule
public final GeneratedSource generatedSource = new GeneratedSource()
@RegisterExtension
final GeneratedSource generatedSource = new GeneratedSource()
.addComparisonToFixtureFor( ScienceMapper.class );
@Test
@ProcessorTest
public void shouldCopyArraysInBean() {
Scientist source = new Scientist("Bob");
@ -44,7 +41,7 @@ public class ArrayMappingTest {
assertThat( dto.publicPublications ).containsOnly( "public the Lancet", "public Nature" );
}
@Test
@ProcessorTest
public void shouldForgeMappingForIntToString() {
Scientist source = new Scientist("Bob");
@ -58,7 +55,7 @@ public class ArrayMappingTest {
assertThat( dto.publicPublicationYears ).containsOnly( 1994, 1998 );
}
@Test
@ProcessorTest
public void shouldMapArrayToArray() {
ScientistDto[] dtos = ScienceMapper.INSTANCE
.scientistsToDtos( new Scientist[]{ new Scientist( "Bob" ), new Scientist( "Larry" ) } );
@ -67,7 +64,7 @@ public class ArrayMappingTest {
assertThat( dtos ).extracting( "name" ).containsOnly( "Bob", "Larry" );
}
@Test
@ProcessorTest
public void shouldMapListToArray() {
ScientistDto[] dtos = ScienceMapper.INSTANCE
.scientistsToDtos( Arrays.asList( new Scientist( "Bob" ), new Scientist( "Larry" ) ) );
@ -76,7 +73,7 @@ public class ArrayMappingTest {
assertThat( dtos ).extracting( "name" ).containsOnly( "Bob", "Larry" );
}
@Test
@ProcessorTest
public void shouldMapArrayToList() {
List<ScientistDto> dtos = ScienceMapper.INSTANCE
.scientistsToDtosAsList( new Scientist[]{ new Scientist( "Bob" ), new Scientist( "Larry" ) } );
@ -85,7 +82,7 @@ public class ArrayMappingTest {
assertThat( dtos ).extracting( "name" ).containsOnly( "Bob", "Larry" );
}
@Test
@ProcessorTest
public void shouldMapArrayToArrayExistingSmallerSizedTarget() {
ScientistDto[] existingTarget = new ScientistDto[]{ new ScientistDto( "Jim" ) };
@ -98,7 +95,7 @@ public class ArrayMappingTest {
assertThat( target ).extracting( "name" ).containsOnly( "Bob" );
}
@Test
@ProcessorTest
public void shouldMapArrayToArrayExistingEqualSizedTarget() {
ScientistDto[] existingTarget = new ScientistDto[]{ new ScientistDto( "Jim" ), new ScientistDto( "Bart" ) };
@ -111,7 +108,7 @@ public class ArrayMappingTest {
assertThat( target ).extracting( "name" ).containsOnly( "Bob", "Larry" );
}
@Test
@ProcessorTest
public void shouldMapArrayToArrayExistingLargerSizedTarget() {
ScientistDto[] existingTarget =
@ -125,7 +122,7 @@ public class ArrayMappingTest {
assertThat( target ).extracting( "name" ).containsOnly( "Bob", "Larry", "John" );
}
@Test
@ProcessorTest
public void shouldMapTargetToNullWhenNullSource() {
// TODO: What about existing target?
@ -139,7 +136,7 @@ public class ArrayMappingTest {
}
@IssueKey("534")
@Test
@ProcessorTest
public void shouldMapBooleanWhenReturnDefault() {
boolean[] existingTarget = new boolean[]{true};
@ -151,7 +148,7 @@ public class ArrayMappingTest {
assertThat( ScienceMapper.INSTANCE.nvmMapping( null ) ).isEmpty();
}
@Test
@ProcessorTest
public void shouldMapShortWhenReturnDefault() {
short[] existingTarget = new short[]{ 5 };
short[] target = ScienceMapper.INSTANCE.nvmMapping( null, existingTarget );
@ -160,7 +157,7 @@ public class ArrayMappingTest {
assertThat( existingTarget ).containsOnly( new short[] { 0 } );
}
@Test
@ProcessorTest
public void shouldMapCharWhenReturnDefault() {
char[] existingTarget = new char[]{ 'a' };
char[] target = ScienceMapper.INSTANCE.nvmMapping( null, existingTarget );
@ -169,7 +166,7 @@ public class ArrayMappingTest {
assertThat( existingTarget ).containsOnly( new char[] { 0 } );
}
@Test
@ProcessorTest
public void shouldMapIntWhenReturnDefault() {
int[] existingTarget = new int[]{ 5 };
int[] target = ScienceMapper.INSTANCE.nvmMapping( null, existingTarget );
@ -178,7 +175,7 @@ public class ArrayMappingTest {
assertThat( existingTarget ).containsOnly( 0 );
}
@Test
@ProcessorTest
public void shouldMapLongWhenReturnDefault() {
long[] existingTarget = new long[]{ 5L };
long[] target = ScienceMapper.INSTANCE.nvmMapping( null, existingTarget );
@ -187,7 +184,7 @@ public class ArrayMappingTest {
assertThat( existingTarget ).containsOnly( 0L );
}
@Test
@ProcessorTest
public void shouldMapFloatWhenReturnDefault() {
float[] existingTarget = new float[]{ 3.1f };
float[] target = ScienceMapper.INSTANCE.nvmMapping( null, existingTarget );
@ -196,7 +193,7 @@ public class ArrayMappingTest {
assertThat( existingTarget ).containsOnly( 0.0f );
}
@Test
@ProcessorTest
public void shouldMapDoubleWhenReturnDefault() {
double[] existingTarget = new double[]{ 5.0d };
double[] target = ScienceMapper.INSTANCE.nvmMapping( null, existingTarget );
@ -205,21 +202,21 @@ public class ArrayMappingTest {
assertThat( existingTarget ).containsOnly( 0.0d );
}
@Test
@ProcessorTest
public void shouldVoidMapIntWhenReturnNull() {
long[] existingTarget = new long[]{ 5L };
ScienceMapper.INSTANCE.nvmMappingVoidReturnNull( null, existingTarget );
assertThat( existingTarget ).containsOnly( 5L );
}
@Test
@ProcessorTest
public void shouldVoidMapIntWhenReturnDefault() {
long[] existingTarget = new long[]{ 5L };
ScienceMapper.INSTANCE.nvmMappingVoidReturnDefault( null, existingTarget );
assertThat( existingTarget ).containsOnly( 0L );
}
@Test
@ProcessorTest
@IssueKey( "999" )
public void shouldNotContainFQNForStringArray() {
generatedSource.forMapper( ScienceMapper.class ).content().doesNotContain( "java.lang.String[]" );

View File

@ -5,12 +5,10 @@
*/
package org.mapstruct.ap.test.bool;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@WithClasses({
Person.class,
@ -19,10 +17,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
PersonMapper.class,
YesNoMapper.class
})
@RunWith(AnnotationProcessorTestRunner.class)
public class BooleanMappingTest {
@Test
@ProcessorTest
public void shouldMapBooleanPropertyWithIsPrefixedGetter() {
//given
Person person = new Person();
@ -35,7 +32,7 @@ public class BooleanMappingTest {
assertThat( personDto.getMarried() ).isEqualTo( "true" );
}
@Test
@ProcessorTest
public void shouldMapBooleanPropertyPreferringGetPrefixedGetterOverIsPrefixedGetter() {
//given
Person person = new Person();
@ -48,7 +45,7 @@ public class BooleanMappingTest {
assertThat( personDto.getEngaged() ).isEqualTo( "true" );
}
@Test
@ProcessorTest
public void shouldMapBooleanPropertyWithPropertyMappingMethod() {
// given
Person person = new Person();

View File

@ -5,20 +5,17 @@
*/
package org.mapstruct.ap.test.bugs._1005;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.compilation.annotation.CompilationResult;
import org.mapstruct.ap.testutil.compilation.annotation.Diagnostic;
import org.mapstruct.ap.testutil.compilation.annotation.ExpectedCompilationOutcome;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Filip Hrisafov
*/
@IssueKey("1005")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
AbstractEntity.class,
HasKey.class,
@ -29,7 +26,7 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
public class Issue1005Test {
@WithClasses(Issue1005ErroneousAbstractResultTypeMapper.class)
@Test
@ProcessorTest
@ExpectedCompilationOutcome(value = CompilationResult.FAILED,
diagnostics = {
@Diagnostic(type = Issue1005ErroneousAbstractResultTypeMapper.class,
@ -41,7 +38,7 @@ public class Issue1005Test {
}
@WithClasses(Issue1005ErroneousAbstractReturnTypeMapper.class)
@Test
@ProcessorTest
@ExpectedCompilationOutcome(value = CompilationResult.FAILED,
diagnostics = {
@Diagnostic(type = Issue1005ErroneousAbstractReturnTypeMapper.class,
@ -54,7 +51,7 @@ public class Issue1005Test {
}
@WithClasses(Issue1005ErroneousInterfaceResultTypeMapper.class)
@Test
@ProcessorTest
@ExpectedCompilationOutcome(value = CompilationResult.FAILED,
diagnostics = {
@Diagnostic(type = Issue1005ErroneousInterfaceResultTypeMapper.class,
@ -66,7 +63,7 @@ public class Issue1005Test {
}
@WithClasses(Issue1005ErroneousInterfaceReturnTypeMapper.class)
@Test
@ProcessorTest
@ExpectedCompilationOutcome(value = CompilationResult.FAILED,
diagnostics = {
@Diagnostic(type = Issue1005ErroneousInterfaceReturnTypeMapper.class,

View File

@ -7,26 +7,23 @@ package org.mapstruct.ap.test.bugs._1029;
import javax.tools.Diagnostic.Kind;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.compilation.annotation.CompilationResult;
import org.mapstruct.ap.testutil.compilation.annotation.Diagnostic;
import org.mapstruct.ap.testutil.compilation.annotation.ExpectedCompilationOutcome;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* Verifies that read-only properties can be explicitly mentioned as {@code ignored=true} without raising an error.
*
* @author Andreas Gudian
*/
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses(ErroneousIssue1029Mapper.class)
@IssueKey("1029")
public class Issue1029Test {
@Test
@ProcessorTest
@ExpectedCompilationOutcome(value = CompilationResult.FAILED, diagnostics = {
@Diagnostic(kind = Kind.WARNING, line = 26, type = ErroneousIssue1029Mapper.class,
messageRegExp = "Unmapped target properties: \"knownProp, lastUpdated, computedMapping\"\\."),

View File

@ -5,21 +5,18 @@
*/
package org.mapstruct.ap.test.bugs._1061;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Filip Hrisafov
*/
@IssueKey("1061")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses(SourceTargetMapper.class)
public class Issue1061Test {
@Test
@ProcessorTest
public void shouldCompile() {
}

View File

@ -5,17 +5,16 @@
*/
package org.mapstruct.ap.test.bugs._1111;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.test.bugs._1111.Issue1111Mapper.Source;
import org.mapstruct.ap.test.bugs._1111.Issue1111Mapper.Target;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
*
@ -23,10 +22,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
*/
@IssueKey( "1111")
@WithClasses({Issue1111Mapper.class})
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue1111Test {
@Test
@ProcessorTest
public void shouldCompile() {
List<List<Source>> source = Arrays.asList( Arrays.asList( new Source() ) );

View File

@ -5,26 +5,23 @@
*/
package org.mapstruct.ap.test.bugs._1124;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.test.bugs._1124.Issue1124Mapper.DTO;
import org.mapstruct.ap.test.bugs._1124.Issue1124Mapper.Entity;
import org.mapstruct.ap.test.bugs._1124.Issue1124Mapper.MappingContext;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.factory.Mappers;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Andreas Gudian
*/
@IssueKey("1124")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses(Issue1124Mapper.class)
public class Issue1124Test {
@Test
@ProcessorTest
public void nestedPropertyWithContextCompiles() {
Entity entity = new Entity();

View File

@ -5,19 +5,17 @@
*/
package org.mapstruct.ap.test.bugs._1130;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.TargetType;
import org.mapstruct.ap.test.bugs._1130.Issue1130Mapper.ADto;
import org.mapstruct.ap.test.bugs._1130.Issue1130Mapper.AEntity;
import org.mapstruct.ap.test.bugs._1130.Issue1130Mapper.BEntity;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.factory.Mappers;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests that when calling an update method for a previously null property, the factory method is called even if that
* factory method has a {@link TargetType} annotation.
@ -25,10 +23,9 @@ import org.mapstruct.factory.Mappers;
* @author Andreas Gudian
*/
@IssueKey("1130")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses(Issue1130Mapper.class)
public class Issue1130Test {
@Test
@ProcessorTest
public void factoryMethodWithTargetTypeInUpdateMethods() {
AEntity aEntity = new AEntity();
aEntity.setB( new BEntity() );

View File

@ -7,18 +7,15 @@ package org.mapstruct.ap.test.bugs._1131;
import java.util.ArrayList;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Filip Hrisafov
*/
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1131")
@WithClasses({
Issue1131Mapper.class,
@ -28,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1131Test {
@Test
@ProcessorTest
public void shouldUseCreateWithSourceNested() {
Source source = new Source();
@ -49,7 +46,7 @@ public class Issue1131Test {
);
}
@Test
@ProcessorTest
public void shouldUseContextObjectFactory() {
Source source = new Source();

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1148;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -20,11 +18,10 @@ import static org.assertj.core.api.Assertions.assertThat;
Entity.class,
Issue1148Mapper.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1148")
public class Issue1148Test {
@Test
@ProcessorTest
public void shouldNotUseSameMethodForDifferentMappingsNestedSource() {
Entity.Dto dto = new Entity.Dto();
dto.nestedDto = new Entity.NestedDto( 30 );
@ -35,7 +32,7 @@ public class Issue1148Test {
assertThat( entity.getId2() ).isEqualTo( 40 );
}
@Test
@ProcessorTest
public void shouldNotUseSameMethodForDifferentMappingsNestedTarget() {
Entity.Dto dto = new Entity.Dto();
dto.recipientId = 10;
@ -51,7 +48,7 @@ public class Issue1148Test {
assertThat( entity.getSender().nestedClient.id ).isEqualTo( 20 );
}
@Test
@ProcessorTest
public void shouldNotUseSameMethodForDifferentMappingsSymmetric() {
Entity.Dto dto = new Entity.Dto();
dto.sameLevel = new Entity.ClientDto(new Entity.NestedDto( 30 ));
@ -67,7 +64,7 @@ public class Issue1148Test {
assertThat( entity.client2.nestedClient.id ).isEqualTo( 40 );
}
@Test
@ProcessorTest
public void shouldNotUseSameMethodForDifferentMappingsHalfSymmetric() {
Entity.Dto dto = new Entity.Dto();
dto.level = new Entity.ClientDto(new Entity.NestedDto( 80 ));
@ -81,7 +78,7 @@ public class Issue1148Test {
assertThat( entity.nested2.id ).isEqualTo( 90 );
}
@Test
@ProcessorTest
public void shouldNotUseSameMethodForDifferentMappingsNestedSourceMultiple() {
Entity.Dto dto1 = new Entity.Dto();
dto1.nestedDto = new Entity.NestedDto( 30 );
@ -93,7 +90,7 @@ public class Issue1148Test {
assertThat( entity.getId2() ).isEqualTo( 40 );
}
@Test
@ProcessorTest
public void shouldNotUseSameMethodForDifferentMappingsNestedTargetMultiple() {
Entity.Dto dto1 = new Entity.Dto();
dto1.recipientId = 10;
@ -110,7 +107,7 @@ public class Issue1148Test {
assertThat( entity.getSender().nestedClient.id ).isEqualTo( 20 );
}
@Test
@ProcessorTest
public void shouldNotUseSameMethodForDifferentMappingsSymmetricMultiple() {
Entity.Dto dto1 = new Entity.Dto();
dto1.sameLevel = new Entity.ClientDto(new Entity.NestedDto( 30 ));
@ -127,7 +124,7 @@ public class Issue1148Test {
assertThat( entity.client2.nestedClient.id ).isEqualTo( 40 );
}
@Test
@ProcessorTest
public void shouldNotUseSameMethodForDifferentMappingsHalfSymmetricMultiple() {
Entity.Dto dto1 = new Entity.Dto();
dto1.level = new Entity.ClientDto(new Entity.NestedDto( 80 ));

View File

@ -5,19 +5,16 @@
*/
package org.mapstruct.ap.test.bugs._1153;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.compilation.annotation.CompilationResult;
import org.mapstruct.ap.testutil.compilation.annotation.Diagnostic;
import org.mapstruct.ap.testutil.compilation.annotation.ExpectedCompilationOutcome;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Filip Hrisafov
*/
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses(ErroneousIssue1153Mapper.class)
@IssueKey("1153")
public class Issue1153Test {
@ -41,7 +38,7 @@ public class Issue1153Test {
"org.mapstruct.ap.test.bugs._1153.ErroneousIssue1153Mapper.Target\\. " +
"Did you mean \"nestedTarget2\\.writable\"")
})
@Test
@ProcessorTest
public void shouldReportErrorsCorrectly() {
}
}

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1155;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -20,11 +18,10 @@ import static org.assertj.core.api.Assertions.assertThat;
Entity.class,
Issue1155Mapper.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1155")
public class Issue1155Test {
@Test
@ProcessorTest
public void shouldCompile() {
Entity.Dto dto = new Entity.Dto();

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1164;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Filip Hrisafov
@ -20,11 +18,10 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
GenericHolder.class,
SourceTargetMapper.class
} )
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey( "1164" )
public class Issue1164Test {
@Test
@ProcessorTest
public void shouldCompile() {
}
}

View File

@ -5,18 +5,16 @@
*/
package org.mapstruct.ap.test.bugs._1170;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Arrays;
import org.assertj.core.api.ListAssert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.test.bugs._1170._target.Target;
import org.mapstruct.ap.test.bugs._1170.source.Source;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Cornelius Dirmeier
@ -27,11 +25,10 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
AdderSourceTargetMapper.class,
PetMapper.class
})
@RunWith(AnnotationProcessorTestRunner.class)
public class AdderTest {
@IssueKey("1170")
@Test
@ProcessorTest
public void testWildcardAdder() {
Source source = new Source();
source.addWithoutWildcard( "mouse" );
@ -51,7 +48,7 @@ public class AdderTest {
}
@IssueKey("1170")
@Test
@ProcessorTest
public void testWildcardAdderTargetToSource() {
Target target = new Target();
target.addWithoutWildcard( 2L );

View File

@ -5,14 +5,12 @@
*/
package org.mapstruct.ap.test.bugs._1180;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.compilation.annotation.CompilationResult;
import org.mapstruct.ap.testutil.compilation.annotation.Diagnostic;
import org.mapstruct.ap.testutil.compilation.annotation.ExpectedCompilationOutcome;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Sjaak Derksen
@ -23,11 +21,10 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
SharedConfig.class,
ErroneousIssue1180Mapper.class
} )
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey( "1180" )
public class Issue1180Test {
@Test
@ProcessorTest
@ExpectedCompilationOutcome(value = CompilationResult.FAILED,
diagnostics = {
@Diagnostic(type = ErroneousIssue1180Mapper.class,

View File

@ -5,16 +5,14 @@
*/
package org.mapstruct.ap.test.bugs._1215;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.test.bugs._1215.dto.EntityDTO;
import org.mapstruct.ap.test.bugs._1215.entity.AnotherTag;
import org.mapstruct.ap.test.bugs._1215.entity.Entity;
import org.mapstruct.ap.test.bugs._1215.entity.Tag;
import org.mapstruct.ap.test.bugs._1215.mapper.Issue1215Mapper;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Filip Hrisafov
@ -27,10 +25,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
Issue1215Mapper.class
} )
@IssueKey( "1215" )
@RunWith( AnnotationProcessorTestRunner.class )
public class Issue1215Test {
@Test
@ProcessorTest
public void shouldCompile() {
}
}

View File

@ -5,24 +5,21 @@
*/
package org.mapstruct.ap.test.bugs._1227;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Filip Hrisafov
*/
@IssueKey("1227")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Issue1227Mapper.class,
ThreadDto.class
})
public class Issue1227Test {
@Test
@ProcessorTest
public void shouldCompile() {
}
}

View File

@ -5,18 +5,16 @@
*/
package org.mapstruct.ap.test.bugs._1242;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.compilation.annotation.CompilationResult;
import org.mapstruct.ap.testutil.compilation.annotation.Diagnostic;
import org.mapstruct.ap.testutil.compilation.annotation.ExpectedCompilationOutcome;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.factory.Mappers;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests that if multiple factory methods are applicable but only one of them has a source parameter, the one with the
* source param is chosen.
@ -24,7 +22,6 @@ import org.mapstruct.factory.Mappers;
* @author Andreas Gudian
*/
@IssueKey("1242")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Issue1242Mapper.class,
SourceA.class,
@ -34,7 +31,7 @@ import org.mapstruct.factory.Mappers;
TargetFactories.class
})
public class Issue1242Test {
@Test
@ProcessorTest
public void factoryMethodWithSourceParamIsChosen() {
SourceA sourceA = new SourceA();
sourceA.setB( new SourceB() );
@ -51,7 +48,7 @@ public class Issue1242Test {
assertThat( targetA.getB().getPassedViaConstructor() ).isEqualTo( "created by factory" );
}
@Test
@ProcessorTest
@WithClasses(ErroneousIssue1242MapperMultipleSources.class)
@ExpectedCompilationOutcome(value = CompilationResult.FAILED,
diagnostics = {

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1244;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.factory.Mappers;
import static org.assertj.core.api.Assertions.assertThat;
@ -18,11 +16,10 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Filip Hrisafov
*/
@IssueKey("1244")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses( SizeMapper.class )
public class Issue1244Test {
@Test
@ProcessorTest
public void properlyCreatesMapperWithSizeAsParameterName() {
SizeMapper.SizeHolder sizeHolder = new SizeMapper.SizeHolder();
sizeHolder.setSize( "size" );

View File

@ -8,11 +8,9 @@ package org.mapstruct.ap.test.bugs._1247;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -20,7 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Filip Hrisafov
*/
@IssueKey("1247")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Issue1247Mapper.class,
DtoIn.class,
@ -33,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1247Test {
@Test
@ProcessorTest
public void shouldCorrectlyUseMappings() {
DtoIn in = new DtoIn( "data", "data2" );
@ -48,7 +45,7 @@ public class Issue1247Test {
assertThat( out.getInternal().getInternalData().getList() ).containsExactly( "first", "second" );
}
@Test
@ProcessorTest
public void shouldCorrectlyUseMappingsWithConstantsExpressionsAndDefaults() {
DtoIn in = new DtoIn( "data", "data2" );
@ -68,7 +65,7 @@ public class Issue1247Test {
assertThat( out.getInternal().getInternalData().getDefaultValue() ).isEqualTo( "data2" );
}
@Test
@ProcessorTest
public void shouldCorrectlyUseMappingsWithConstantsExpressionsAndUseDefault() {
DtoIn in = new DtoIn( "data", null );

View File

@ -5,19 +5,17 @@
*/
package org.mapstruct.ap.test.bugs._1255;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
*
* @author Sjaak Derksen
*/
@IssueKey("1255")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
AbstractA.class,
SomeA.class,
@ -26,7 +24,7 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
SomeMapperConfig.class})
public class Issue1255Test {
@Test
@ProcessorTest
public void shouldMapSomeBToSomeAWithoutField1() {
SomeB someB = new SomeB();
someB.setField1( "value1" );
@ -40,7 +38,7 @@ public class Issue1255Test {
assertThat( someA.getField2() ).isEqualTo( someB.getField2() );
}
@Test
@ProcessorTest
public void shouldMapSomeAToSomeB() {
SomeA someA = new SomeA();
someA.setField1( "value1" );

View File

@ -8,8 +8,6 @@ package org.mapstruct.ap.test.bugs._1269;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.test.bugs._1269.dto.VehicleDto;
import org.mapstruct.ap.test.bugs._1269.dto.VehicleImageDto;
import org.mapstruct.ap.test.bugs._1269.dto.VehicleInfoDto;
@ -18,8 +16,8 @@ import org.mapstruct.ap.test.bugs._1269.model.Vehicle;
import org.mapstruct.ap.test.bugs._1269.model.VehicleImage;
import org.mapstruct.ap.test.bugs._1269.model.VehicleTypeInfo;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -27,7 +25,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Filip Hrisafov
*/
@IssueKey( "1269" )
@RunWith( AnnotationProcessorTestRunner.class )
@WithClasses( {
VehicleDto.class,
VehicleImageDto.class,
@ -39,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
} )
public class Issue1269Test {
@Test
@ProcessorTest
public void shouldMapNestedPropertiesCorrectly() {
VehicleTypeInfo sourceTypeInfo = new VehicleTypeInfo( "Opel", "Corsa", 3 );

View File

@ -5,21 +5,18 @@
*/
package org.mapstruct.ap.test.bugs._1273;
import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.factory.Mappers;
import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
@IssueKey( "1273" )
@RunWith( AnnotationProcessorTestRunner.class )
@WithClasses( { EntityMapperReturnDefault.class, EntityMapperReturnNull.class, Dto.class, Entity.class } )
public class Issue1273Test {
@Test
@ProcessorTest
public void shouldCorrectlyMapCollectionWithNullValueMappingStrategyReturnDefault() {
EntityMapperReturnDefault entityMapper = Mappers.getMapper( EntityMapperReturnDefault.class );
@ -29,7 +26,7 @@ public class Issue1273Test {
assertThat( dto.getLongs() ).isNotNull();
}
@Test
@ProcessorTest
public void shouldCorrectlyMapCollectionWithNullValueMappingStrategyReturnNull() {
EntityMapperReturnNull entityMapper = Mappers.getMapper( EntityMapperReturnNull.class );

View File

@ -5,27 +5,24 @@
*/
package org.mapstruct.ap.test.bugs._1283;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.compilation.annotation.CompilationResult;
import org.mapstruct.ap.testutil.compilation.annotation.Diagnostic;
import org.mapstruct.ap.testutil.compilation.annotation.ExpectedCompilationOutcome;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Filip Hrisafov
*/
@IssueKey("1283")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Source.class,
Target.class
})
public class Issue1283Test {
@Test
@ProcessorTest
@WithClasses(ErroneousInverseTargetHasNoSuitableConstructorMapper.class)
@ExpectedCompilationOutcome(
value = CompilationResult.FAILED,
@ -40,7 +37,7 @@ public class Issue1283Test {
public void inheritInverseConfigurationReturnTypeHasNoSuitableConstructor() {
}
@Test
@ProcessorTest
@WithClasses(ErroneousTargetHasNoSuitableConstructorMapper.class)
@ExpectedCompilationOutcome(
value = CompilationResult.FAILED,

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1320;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -17,14 +15,13 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Filip Hrisafov
*/
@IssueKey("1320")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Issue1320Mapper.class,
Target.class
})
public class Issue1320Test {
@Test
@ProcessorTest
public void shouldCreateDeepNestedConstantsCorrectly() {
Target target = Issue1320Mapper.INSTANCE.map( 10 );

View File

@ -7,11 +7,9 @@ package org.mapstruct.ap.test.bugs._1338;
import java.util.Arrays;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.atIndex;
@ -19,7 +17,6 @@ import static org.assertj.core.api.Assertions.atIndex;
/**
* @author Filip Hrisafov
*/
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1338")
@WithClasses({
Issue1338Mapper.class,
@ -28,7 +25,7 @@ import static org.assertj.core.api.Assertions.atIndex;
})
public class Issue1338Test {
@Test
@ProcessorTest
public void shouldCorrectlyUseAdder() {
Source source = new Source();
source.setProperties( Arrays.asList( "first", "second" ) );

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1339;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -20,11 +18,10 @@ import static org.assertj.core.api.Assertions.assertThat;
Issue1339Mapper.class,
Callback.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1339")
public class Issue1339Test {
@Test
@ProcessorTest
public void shouldCompile() {
Issue1339Mapper.Source source = new Issue1339Mapper.Source();
source.field = "test";

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1340;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Filip Hrisafov
@ -18,10 +16,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
Issue1340Mapper.class
})
@IssueKey("1340")
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue1340Test {
@Test
@ProcessorTest
public void shouldCompile() {
}
}

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1345;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Sjaak Derksen
@ -18,10 +16,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
Issue1345Mapper.class
})
@IssueKey("1345")
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue1345Test {
@Test
@ProcessorTest
public void shouldCompile() {
}
}

View File

@ -5,14 +5,12 @@
*/
package org.mapstruct.ap.test.bugs._1353;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.compilation.annotation.CompilationResult;
import org.mapstruct.ap.testutil.compilation.annotation.Diagnostic;
import org.mapstruct.ap.testutil.compilation.annotation.ExpectedCompilationOutcome;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -20,7 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Jeffrey Smyth
*/
@IssueKey ("1353")
@RunWith (AnnotationProcessorTestRunner.class)
@WithClasses ({
Issue1353Mapper.class,
Source.class,
@ -28,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1353Test {
@Test
@ProcessorTest
@ExpectedCompilationOutcome (
value = CompilationResult.SUCCEEDED,
diagnostics = {

View File

@ -8,11 +8,9 @@ package org.mapstruct.ap.test.bugs._1359;
import java.util.HashSet;
import java.util.Set;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.atIndex;
@ -25,11 +23,10 @@ import static org.assertj.core.api.Assertions.atIndex;
Source.class,
Target.class
} )
@RunWith( AnnotationProcessorTestRunner.class )
@IssueKey( "1359" )
public class Issue1359Test {
@Test
@ProcessorTest
public void shouldCompile() {
Target target = new Target();

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1375;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -21,11 +19,10 @@ import static org.assertj.core.api.Assertions.assertThat;
Source.class,
Issue1375Mapper.class
} )
@RunWith( AnnotationProcessorTestRunner.class )
@IssueKey( "1375" )
public class Issue1375Test {
@Test
@ProcessorTest
public void shouldGenerateCorrectMapperWhenIntermediaryReadAccessorIsMissing() {
Target target = Issue1375Mapper.INSTANCE.map( new Source( "test value" ) );

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1395;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Filip Hrisafov
@ -20,11 +18,10 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
Source.class,
Target.class
} )
@RunWith( AnnotationProcessorTestRunner.class )
@IssueKey( "1395" )
public class Issue1395Test {
@Test
@ProcessorTest
public void shouldGenerateValidCode() {
}

View File

@ -6,11 +6,9 @@
package org.mapstruct.ap.test.bugs._1425;
import org.joda.time.LocalDate;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -22,11 +20,10 @@ import static org.assertj.core.api.Assertions.assertThat;
Source.class,
Target.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1425")
public class Issue1425Test {
@Test
@ProcessorTest
public void shouldTestMappingLocalDates() {
Source source = new Source();
source.setValue( LocalDate.parse( "2018-04-18" ) );

View File

@ -5,15 +5,12 @@
*/
package org.mapstruct.ap.test.bugs._1435;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1435")
@WithClasses({
Config.class,
@ -22,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThat;
OutObject.class,
})
public class Issue1435Test {
@Test
@ProcessorTest
public void mustNotSetListToNull() {
InObject source = new InObject( "Rainbow Dash" );

View File

@ -7,12 +7,10 @@ package org.mapstruct.ap.test.bugs._1453;
import java.util.Arrays;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.ap.testutil.runner.GeneratedSource;
import static org.assertj.core.api.Assertions.assertThat;
@ -21,7 +19,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Filip Hrisafov
*/
@IssueKey("1453")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Auction.class,
AuctionDto.class,
@ -31,10 +28,10 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1453Test {
@Rule
public GeneratedSource source = new GeneratedSource().addComparisonToFixtureFor( Issue1453Mapper.class );
@RegisterExtension
final GeneratedSource source = new GeneratedSource().addComparisonToFixtureFor( Issue1453Mapper.class );
@Test
@ProcessorTest
public void shouldGenerateCorrectCode() {
AuctionDto target = Issue1453Mapper.INSTANCE.map( new Auction(

View File

@ -5,15 +5,13 @@
*/
package org.mapstruct.ap.test.bugs._1457;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.BeforeEach;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.compilation.annotation.CompilationResult;
import org.mapstruct.ap.testutil.compilation.annotation.Diagnostic;
import org.mapstruct.ap.testutil.compilation.annotation.ExpectedCompilationOutcome;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -21,7 +19,6 @@ import static org.assertj.core.api.Assertions.assertThat;
SourceBook.class,
TargetBook.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1457")
public class Issue1457Test {
@ -29,7 +26,7 @@ public class Issue1457Test {
private String authorFirstName;
private String authorLastName;
@Before
@BeforeEach
public void setup() {
sourceBook = new SourceBook();
sourceBook.setIsbn( "3453146972" );
@ -39,7 +36,7 @@ public class Issue1457Test {
authorLastName = "Adams";
}
@Test
@ProcessorTest
@WithClasses({
BookMapper.class
})
@ -66,7 +63,7 @@ public class Issue1457Test {
assertThat( targetBook.isAfterMappingWithDifferentVariableName() ).isFalse();
}
@Test
@ProcessorTest
@WithClasses({
DifferentOrderingBookMapper.class
})
@ -80,7 +77,7 @@ public class Issue1457Test {
assertTargetBookMatchesSourceBook( targetBook );
}
@Test
@ProcessorTest
@WithClasses({
ObjectFactoryBookMapper.class
})
@ -101,7 +98,7 @@ public class Issue1457Test {
assertThat( authorLastName ).isEqualTo( targetBook.getAuthorLastName() );
}
@Test
@ProcessorTest
@WithClasses({
ErroneousBookMapper.class
})

View File

@ -9,11 +9,9 @@ import java.util.Date;
import java.util.Locale;
import org.joda.time.DateTime;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -25,11 +23,10 @@ import static org.assertj.core.api.Assertions.assertThat;
Source.class,
Target.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1460")
public class Issue1460Test {
@Test
@ProcessorTest
public void shouldTestMappingLocalDates() {
long dateInMs = 1524693600000L;
String dateAsString = "2018-04-26";

View File

@ -7,11 +7,9 @@ package org.mapstruct.ap.test.bugs._1460.java8;
import java.time.LocalDate;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -23,11 +21,10 @@ import static org.assertj.core.api.Assertions.assertThat;
Source.class,
Target.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1460")
public class Issue1460JavaTimeTest {
@Test
@ProcessorTest
public void shouldTestMappingLocalDates() {
String dateAsString = "2018-04-26";

View File

@ -7,11 +7,9 @@ package org.mapstruct.ap.test.bugs._1482;
import java.math.BigDecimal;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -26,10 +24,9 @@ import static org.assertj.core.api.Assertions.assertThat;
ValueWrapper.class
})
@IssueKey(value = "1482")
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue1482Test {
@Test
@ProcessorTest
public void testForward() {
Source source = new Source();
@ -44,7 +41,7 @@ public class Issue1482Test {
}
@Test
@ProcessorTest
public void testReverse() {
Target target = new Target();

View File

@ -9,13 +9,11 @@ import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.TimeZone;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -32,13 +30,12 @@ import static org.assertj.core.api.Assertions.assertThat;
Source.class,
Target.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1523")
public class Issue1523Test {
private static final TimeZone DEFAULT_TIMEZONE = TimeZone.getDefault();
@BeforeClass
@BeforeAll
public static void before() {
// we want to test that the timezone will correctly be used in mapped XMLGregorianCalendar and not the
// default one, so we must ensure that we use a different timezone than the default one -> set the default
@ -46,13 +43,13 @@ public class Issue1523Test {
TimeZone.setDefault( TimeZone.getTimeZone( "UTC" ) );
}
@AfterClass
@AfterAll
public static void after() {
// revert the changed default TZ
TimeZone.setDefault( DEFAULT_TIMEZONE );
}
@Test
@ProcessorTest
public void testThatCorrectTimeZoneWillBeUsedInTarget() {
Source source = new Source();
// default one was explicitly set to UTC, thus +01:00 is a different one

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1541;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -21,11 +19,10 @@ import static org.assertj.core.api.Assertions.assertThat;
Issue1541Mapper.class,
Target.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1541")
public class Issue1541Test {
@Test
@ProcessorTest
public void testMappingWithVarArgs() {
Target target = Issue1541Mapper.INSTANCE.mapWithVarArgs( "code", "1", "2" );
@ -38,7 +35,7 @@ public class Issue1541Test {
assertThat( target.isAfterMappingContextWithVarArgsAsArrayCalled() ).isFalse();
}
@Test
@ProcessorTest
public void testMappingWithArray() {
Target target = Issue1541Mapper.INSTANCE.mapWithArray( "code", new String[] { "1", "2" } );
@ -52,7 +49,7 @@ public class Issue1541Test {
assertThat( target.isAfterMappingContextWithVarArgsAsArrayCalled() ).isFalse();
}
@Test
@ProcessorTest
public void testMappingWithVarArgsReassignment() {
Target target = Issue1541Mapper.INSTANCE.mapWithReassigningVarArgs( "code", "1", "2" );
@ -66,7 +63,7 @@ public class Issue1541Test {
assertThat( target.isAfterMappingContextWithVarArgsAsArrayCalled() ).isFalse();
}
@Test
@ProcessorTest
public void testMappingWithArrayAndVarArgs() {
Target target = Issue1541Mapper.INSTANCE.mapWithArrayAndVarArgs( "code", new String[] { "1", "2" }, "3", "4" );
@ -80,7 +77,7 @@ public class Issue1541Test {
assertThat( target.isAfterMappingContextWithVarArgsAsArrayCalled() ).isFalse();
}
@Test
@ProcessorTest
public void testVarArgsInAfterMappingAsArray() {
Target target = Issue1541Mapper.INSTANCE.mapParametersAsArrayInAfterMapping( "code", "1", "2" );
@ -94,7 +91,7 @@ public class Issue1541Test {
assertThat( target.isAfterMappingContextWithVarArgsAsArrayCalled() ).isFalse();
}
@Test
@ProcessorTest
public void testVarArgsInAfterMappingAsVarArgs() {
Target target = Issue1541Mapper.INSTANCE.mapParametersAsVarArgsInAfterMapping( "code", "1", "2" );
@ -108,7 +105,7 @@ public class Issue1541Test {
assertThat( target.isAfterMappingContextWithVarArgsAsArrayCalled() ).isFalse();
}
@Test
@ProcessorTest
public void testVarArgsInContextWithVarArgsAfterMapping() {
Target target = Issue1541Mapper.INSTANCE.mapContextWithVarArgsInAfterMappingWithVarArgs(
"code",
@ -127,7 +124,7 @@ public class Issue1541Test {
assertThat( target.isAfterMappingContextWithVarArgsAsArrayCalled() ).isFalse();
}
@Test
@ProcessorTest
public void testVarArgsInContextWithArrayAfterMapping() {
Target target = Issue1541Mapper.INSTANCE.mapContextWithVarArgsInAfterMappingWithArray(
"code",

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1552;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -20,11 +18,10 @@ import static org.assertj.core.api.Assertions.assertThat;
Issue1552Mapper.class,
Target.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1552")
public class Issue1552Test {
@Test
@ProcessorTest
public void shouldCompile() {
Target target = Issue1552Mapper.INSTANCE.twoArgsWithConstant( "first", "second" );

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1558.java8;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Sjaak Derksen
@ -20,11 +18,10 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
Car.class,
Car2.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1558")
public class Issue1558Test {
@Test
@ProcessorTest
public void testShouldCompile() {
Car2 car = new Car2();
Car target = CarMapper.INSTANCE.toCar( car );

View File

@ -5,12 +5,10 @@
*/
package org.mapstruct.ap.test.bugs._1561;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.ap.testutil.runner.GeneratedSource;
import static org.assertj.core.api.Assertions.assertThat;
@ -18,7 +16,6 @@ import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Sebastian Haberey
*/
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1561")
@WithClasses({
Issue1561Mapper.class,
@ -28,12 +25,12 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1561Test {
@Rule
public final GeneratedSource generatedSource = new GeneratedSource().addComparisonToFixtureFor(
@RegisterExtension
final GeneratedSource generatedSource = new GeneratedSource().addComparisonToFixtureFor(
Issue1561Mapper.class
);
@Test
@ProcessorTest
public void shouldCorrectlyUseAdder() {
Source source = new Source();

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1566;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -23,10 +21,9 @@ import static org.assertj.core.api.Assertions.assertThat;
Target.class
})
@IssueKey("1566")
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue1566Test {
@Test
@ProcessorTest
public void genericMapperIsCorrectlyUsed() {
Source source = new Source();
source.setId( "id-123" );

View File

@ -10,11 +10,9 @@ import java.time.Month;
import java.time.ZoneOffset;
import java.util.Date;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -26,11 +24,10 @@ import static org.assertj.core.api.Assertions.assertThat;
Source.class,
Target.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1569")
public class Issue1569Test {
@Test
@ProcessorTest
public void shouldGenerateCorrectMapping() {
Source source = new Source();
Date date = Date.from( LocalDate.of( 2018, Month.AUGUST, 5 ).atTime( 20, 30 ).toInstant( ZoneOffset.UTC ) );

View File

@ -5,25 +5,22 @@
*/
package org.mapstruct.ap.test.bugs._1576.java8;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.ap.testutil.runner.GeneratedSource;
@IssueKey("1576")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses( { Issue1576Mapper.class, Source.class, Target.class })
public class Issue1576Test {
@Rule
public final GeneratedSource generatedSource = new GeneratedSource().addComparisonToFixtureFor(
@RegisterExtension
final GeneratedSource generatedSource = new GeneratedSource().addComparisonToFixtureFor(
Issue1576Mapper.class
);
@Test
@ProcessorTest
public void testLocalDateTimeIsImported() {
Issue1576Mapper.INSTANCE.map( new Source() );

View File

@ -7,11 +7,9 @@ package org.mapstruct.ap.test.bugs._1590;
import java.util.Arrays;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -24,11 +22,10 @@ import static org.assertj.core.api.Assertions.assertThat;
Book.class,
BookShelf.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1590")
public class Issue1590Test {
@Test
@ProcessorTest
public void shouldTestMappingLocalDates() {
BookShelf source = new BookShelf();
source.setBooks( Arrays.asList( new Book() ) );

View File

@ -5,25 +5,22 @@
*/
package org.mapstruct.ap.test.bugs._1594;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Filip Hrisafov
*/
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1594")
@WithClasses({
Issue1594Mapper.class
})
public class Issue1594Test {
@Test
@ProcessorTest
public void shouldGenerateCorrectMapping() {
Issue1594Mapper.Dto dto = new Issue1594Mapper.Dto();
dto.setFullAddress( "Switzerland-Zurich" );

View File

@ -5,8 +5,6 @@
*/
package org.mapstruct.ap.test.bugs._1596;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.spi.AccessorNamingStrategy;
import org.mapstruct.ap.spi.BuilderProvider;
import org.mapstruct.ap.spi.ImmutablesAccessorNamingStrategy;
@ -15,10 +13,10 @@ import org.mapstruct.ap.test.bugs._1596.domain.Item;
import org.mapstruct.ap.test.bugs._1596.dto.ImmutableItemDTO;
import org.mapstruct.ap.test.bugs._1596.dto.ItemDTO;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.WithServiceImplementation;
import org.mapstruct.ap.testutil.WithServiceImplementations;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -32,7 +30,6 @@ import static org.assertj.core.api.Assertions.assertThat;
ItemDTO.class,
ImmutableItemDTO.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1596")
@WithServiceImplementations( {
@WithServiceImplementation( provides = BuilderProvider.class, value = Issue1569BuilderProvider.class),
@ -40,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1596Test {
@Test
@ProcessorTest
public void shouldIncludeBuildType() {
ItemDTO item = ImmutableItemDTO.builder().id( "test" ).build();

View File

@ -5,18 +5,15 @@
*/
package org.mapstruct.ap.test.bugs._1608;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Filip Hrisafov
*/
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1608")
@WithClasses({
Issue1608Mapper.class,
@ -25,7 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1608Test {
@Test
@ProcessorTest
public void shouldCorrectlyUseFluentSettersStartingWithIs() {
Book book = new Book();

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1648;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -17,7 +15,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Filip Hrisafov
*/
@IssueKey("1648")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Issue1648Mapper.class,
Source.class,
@ -25,7 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1648Test {
@Test
@ProcessorTest
public void shouldCorrectlyMarkSourceAsUsed() {
Source source = new Source();
source.setSourceValue( "value" );

View File

@ -5,16 +5,13 @@
*/
package org.mapstruct.ap.test.bugs._1650;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@IssueKey("1650")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
AMapper.class,
A.class,
@ -25,7 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1650Test {
@Test
@ProcessorTest
public void shouldCompile() {
A a = new A();

View File

@ -5,18 +5,15 @@
*/
package org.mapstruct.ap.test.bugs._1660;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Filip Hrisafov
*/
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1660")
@WithClasses({
Issue1660Mapper.class,
@ -25,7 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1660Test {
@Test
@ProcessorTest
public void shouldNotUseStaticMethods() {
Source source = new Source();
source.setValue( "source" );

View File

@ -5,21 +5,18 @@
*/
package org.mapstruct.ap.test.bugs._1665;
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;
import java.util.ArrayList;
import java.util.List;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Arne Seime
*/
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1665")
@WithClasses({
Issue1665Mapper.class,
@ -28,7 +25,7 @@ import java.util.List;
})
public class Issue1665Test {
@Test
@ProcessorTest
public void shouldBoxIntPrimitive() {
Source source = new Source();
List<Integer> values = new ArrayList<>();

View File

@ -5,18 +5,15 @@
*/
package org.mapstruct.ap.test.bugs._1681;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Filip Hrisafov
*/
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1681")
@WithClasses({
Issue1681Mapper.class,
@ -25,7 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1681Test {
@Test
@ProcessorTest
public void shouldCompile() {
Target target = new Target( "before" );
Source source = new Source();
@ -37,7 +34,7 @@ public class Issue1681Test {
assertThat( updatedTarget.getValue() ).isEqualTo( "after" );
}
@Test
@ProcessorTest
public void shouldCompileWithBuilder() {
Target.Builder targetBuilder = Target.builder();
targetBuilder.builderValue( "before" );

View File

@ -5,17 +5,14 @@
*/
package org.mapstruct.ap.test.bugs._1685;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.ap.testutil.runner.GeneratedSource;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1685")
@WithClasses({
User.class,
@ -25,12 +22,12 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1685Test {
@Rule
public final GeneratedSource generatedSource = new GeneratedSource().addComparisonToFixtureFor(
@RegisterExtension
final GeneratedSource generatedSource = new GeneratedSource().addComparisonToFixtureFor(
UserMapper.class
);
@Test
@ProcessorTest
public void testSetToNullWhenNVPMSSetToNull() {
User target = new User();
@ -58,7 +55,7 @@ public class Issue1685Test {
assertThat( target.getSettings() ).isNull();
}
@Test
@ProcessorTest
public void testIgnoreWhenNVPMSIgnore() {
User target = new User();
@ -86,7 +83,7 @@ public class Issue1685Test {
assertThat( target.getSettings() ).containsExactly( "test" );
}
@Test
@ProcessorTest
public void testSetToDefaultWhenNVPMSSetToDefault() {
User target = new User();

View File

@ -5,21 +5,18 @@
*/
package org.mapstruct.ap.test.bugs._1698;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.compilation.annotation.CompilationResult;
import org.mapstruct.ap.testutil.compilation.annotation.Diagnostic;
import org.mapstruct.ap.testutil.compilation.annotation.ExpectedCompilationOutcome;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1698")
@WithClasses(Erroneous1698Mapper.class)
public class Issue1698Test {
@Test
@ProcessorTest
@ExpectedCompilationOutcome(value = CompilationResult.FAILED,
diagnostics = {
@Diagnostic(type = Erroneous1698Mapper.class,

View File

@ -5,27 +5,24 @@
*/
package org.mapstruct.ap.test.bugs._1707;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import org.mapstruct.ap.testutil.runner.GeneratedSource;
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1707")
@WithClasses({
Converter.class
})
public class Issue1707Test {
@Rule
public final GeneratedSource generatedSource = new GeneratedSource().addComparisonToFixtureFor(
@RegisterExtension
final GeneratedSource generatedSource = new GeneratedSource().addComparisonToFixtureFor(
Converter.class
);
@Test
@ProcessorTest
public void codeShouldBeGeneratedCorrectly() {
}

View File

@ -5,22 +5,19 @@
*/
package org.mapstruct.ap.test.bugs._1714;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1714")
@WithClasses({
Issue1714Mapper.class
})
public class Issue1714Test {
@Test
@ProcessorTest
public void codeShouldBeGeneratedCorrectly() {
Issue1714Mapper.OnDemand source = new Issue1714Mapper.OnDemand();

View File

@ -5,16 +5,13 @@
*/
package org.mapstruct.ap.test.bugs._1719;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1719")
@WithClasses({
Source.class,
@ -29,7 +26,7 @@ public class Issue1719Test {
* from the child-parent relation. It cannot even assume that the the collection can be cleared at forehand.
* Therefore the only sensible choice is for MapStruct to create a create method for the target elements.
*/
@Test
@ProcessorTest
@WithClasses(Issue1719Mapper.class)
public void testShouldGiveNoErrorMessage() {
Source source = new Source();

View File

@ -5,18 +5,15 @@
*/
package org.mapstruct.ap.test.bugs._1738;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Filip Hrisafov
*/
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1738")
@WithClasses({
Issue1738Mapper.class,
@ -25,7 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1738Test {
@Test
@ProcessorTest
public void shouldGenerateCorrectSourceNestedMapping() {
Source source = new Source();
Source.Nested<Number> nested = new Source.Nested<>();

View File

@ -5,17 +5,14 @@
*/
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.ProcessorTest;
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,
@ -25,7 +22,7 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
} )
public class Issue1742Test {
@Test
@ProcessorTest
public void shouldCompile() {
}

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1751;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -17,7 +15,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Filip Hrisafov
*/
@IssueKey("1772")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Holder.class,
Issue1751Mapper.class,
@ -26,7 +23,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1751Test {
@Test
@ProcessorTest
public void name() {
Source source = new Source();
source.setValue( "some value" );

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1772;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -17,7 +15,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Sjaak Derksen
*/
@IssueKey("1772")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Issue1772Mapper.class,
Source.class,
@ -25,7 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1772Test {
@Test
@ProcessorTest
public void shouldCorrectlyMarkSourceAsUsed() {
Source source = new Source();

View File

@ -5,20 +5,17 @@
*/
package org.mapstruct.ap.test.bugs._1788;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
@IssueKey( "1788" )
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses(
Issue1788Mapper.class
)
public class Issue1788Test {
@Test
@ProcessorTest
public void shouldCompile() {
}
}

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1790;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -17,7 +15,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Filip Hrisafov
*/
@IssueKey("1790")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Issue1790Config.class,
Issue1790Mapper.class,
@ -26,7 +23,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1790Test {
@Test
@ProcessorTest
public void shouldProperlyApplyNullValuePropertyMappingStrategyWhenInheriting() {
Target target = new Target();
target.setName( "My name is set" );

View File

@ -7,11 +7,9 @@ package org.mapstruct.ap.test.bugs._1797;
import java.util.EnumSet;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -19,7 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Filip Hrisafov
*/
@IssueKey("1797")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Customer.class,
CustomerDto.class,
@ -27,7 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1797Test {
@Test
@ProcessorTest
public void shouldCorrectlyMapEnumSetToEnumSet() {
Customer customer = new Customer( EnumSet.of( Customer.Type.ONE ) );

View File

@ -7,11 +7,9 @@ package org.mapstruct.ap.test.bugs._1799;
import java.util.Date;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -24,10 +22,9 @@ import static org.assertj.core.api.Assertions.assertThat;
Target.class,
})
@IssueKey("1799")
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue1799Test {
@Test
@ProcessorTest
public void fluentJavaBeanStyleSettersShouldWork() {
Target target = Issue1799Mapper.INSTANCE.map( new Source( new Date( 150 ), "Switzerland" ) );

View File

@ -5,8 +5,6 @@
*/
package org.mapstruct.ap.test.bugs._1801;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.spi.AccessorNamingStrategy;
import org.mapstruct.ap.spi.BuilderProvider;
import org.mapstruct.ap.spi.ImmutablesAccessorNamingStrategy;
@ -15,10 +13,10 @@ import org.mapstruct.ap.test.bugs._1801.domain.Item;
import org.mapstruct.ap.test.bugs._1801.dto.ImmutableItemDTO;
import org.mapstruct.ap.test.bugs._1801.dto.ItemDTO;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.WithServiceImplementation;
import org.mapstruct.ap.testutil.WithServiceImplementations;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -32,7 +30,6 @@ import static org.assertj.core.api.Assertions.assertThat;
ItemDTO.class,
ImmutableItemDTO.class
})
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1801")
@WithServiceImplementations( {
@WithServiceImplementation( provides = BuilderProvider.class, value = Issue1801BuilderProvider.class),
@ -40,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1801Test {
@Test
@ProcessorTest
public void shouldIncludeBuildeType() {
ItemDTO item = ImmutableItemDTO.builder().id( "test" ).build();

View File

@ -5,18 +5,15 @@
*/
package org.mapstruct.ap.test.bugs._1821;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
@IssueKey("1797")
@RunWith( AnnotationProcessorTestRunner.class)
@WithClasses( Issue1821Mapper.class )
public class Issue1821Test {
@Test
@ProcessorTest
public void shouldNotGiveNullPtr() {
Issue1821Mapper.INSTANCE.map( new Issue1821Mapper.Source() );
}

View File

@ -5,15 +5,12 @@
*/
package org.mapstruct.ap.test.bugs._1826;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("1826")
@WithClasses({
SourceParent.class,
@ -23,7 +20,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1826Test {
@Test
@ProcessorTest
public void testNestedPropertyMappingChecksForNull() {
SourceParent sourceParent = new SourceParent();
sourceParent.setSourceChild( null );

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1828;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -17,7 +15,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Filip Hrisafov
*/
@IssueKey("1828")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
CompleteAddress.class,
Employee.class,
@ -28,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue1828Test {
@Test
@ProcessorTest
public void testMapSpecialAndGeneralAddressSet() {
Employee employee = new Employee();
@ -55,7 +52,7 @@ public class Issue1828Test {
assertThat( completeAddress.getCountry() ).isEqualTo( "Seven Kingdom" );
}
@Test
@ProcessorTest
public void testMapGeneralAddressNull() {
Employee employee = new Employee();
@ -77,7 +74,7 @@ public class Issue1828Test {
assertThat( completeAddress.getCountry() ).isNull();
}
@Test
@ProcessorTest
public void testMapSpecialAddressNull() {
Employee employee = new Employee();

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1881;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -17,13 +15,12 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Filip Hrisafov
*/
@IssueKey("1881")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
VehicleDtoMapper.class,
})
public class Issue1881Test {
@Test
@ProcessorTest
public void shouldCompileCorrectly() {
VehicleDtoMapper.VehicleDto vehicle = VehicleDtoMapper.INSTANCE.map( new VehicleDtoMapper.Vehicle(
"Test",

View File

@ -5,22 +5,19 @@
*/
package org.mapstruct.ap.test.bugs._1904;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.spi.AstModifyingAnnotationProcessor;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.WithServiceImplementation;
import org.mapstruct.ap.testutil.compilation.annotation.CompilationResult;
import org.mapstruct.ap.testutil.compilation.annotation.Diagnostic;
import org.mapstruct.ap.testutil.compilation.annotation.ExpectedCompilationOutcome;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Filip Hrisafov
*/
@IssueKey("1904")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Issue1904Mapper.class,
})
@ -30,7 +27,7 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
)
public class Issue1904Test {
@Test
@ProcessorTest
@ExpectedCompilationOutcome(value = CompilationResult.FAILED, diagnostics = {
@Diagnostic(
type = Issue1904Mapper.class,

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1933;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -17,14 +15,13 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Sjaak Derksen
*/
@IssueKey("1933")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Issue1933Config.class,
Issue1933Mapper.class
})
public class Issue1933Test {
@Test
@ProcessorTest
public void shouldIgnoreIdAndMapUpdateCount() {
Issue1933Config.Dto dto = new Issue1933Config.Dto();

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._1966;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@ -17,13 +15,12 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Sjaak Derksen
*/
@IssueKey("1966")
@RunWith(AnnotationProcessorTestRunner.class)
@WithClasses({
Issue1966Mapper.class
})
public class Issue1966Test {
@Test
@ProcessorTest
public void shouldSelectDefaultExpressionEvenWhenSourceInMappingIsNotSpecified() {
Issue1966Mapper.AnimalRecord dto = new Issue1966Mapper.AnimalRecord();

View File

@ -5,17 +5,14 @@
*/
package org.mapstruct.ap.test.bugs._2001;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* @author Filip Hrisafov
*/
@IssueKey("2001")
@RunWith( AnnotationProcessorTestRunner.class )
@WithClasses( {
Entity.class,
EntityExtra.class,
@ -25,7 +22,7 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
} )
public class Issue2001Test {
@Test
@ProcessorTest
public void shouldCompile() {
}

View File

@ -5,13 +5,11 @@
*/
package org.mapstruct.ap.test.bugs._289;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Reproducer for https://github.com/mapstruct/mapstruct/issues/289.
@ -27,10 +25,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
SourceElement.class,
TargetElement.class
} )
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue289Test {
@Test
@ProcessorTest
public void shouldLeaveEmptyTargetSetWhenSourceIsNullAndGetterOnlyForCreateMethod() {
Source source = new Source();
@ -41,7 +38,7 @@ public class Issue289Test {
assertThat( target.getCollection() ).isEmpty();
}
@Test
@ProcessorTest
public void shouldLeaveEmptyTargetSetWhenSourceIsNullAndGetterOnlyForUpdateMethod() {
Source source = new Source();
@ -54,7 +51,7 @@ public class Issue289Test {
assertThat( target.getCollection() ).isEmpty();
}
@Test
@ProcessorTest
public void shouldLeaveNullTargetSetWhenSourceIsNullForCreateMethod() {
Source source = new Source();

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._306;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* Reproducer for https://github.com/mapstruct/mapstruct/issues/306.
@ -17,10 +15,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
* @author Sjaak Derksen
*/
@IssueKey( "306" )
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue306Test {
@Test
@ProcessorTest
@WithClasses( { Issue306Mapper.class, Source.class, Target.class } )
public void shouldForgeNewIterableMappingMethod() {
}

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._373;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* Reproducer for https://github.com/mapstruct/mapstruct/issues/373.
@ -17,10 +15,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
* @author Sjaak Derksen
*/
@IssueKey( "373" )
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue373Test {
@Test
@ProcessorTest
@WithClasses( { Issue373Mapper.class, Branch.class, BranchLocation.class, Country.class, ResultDto.class } )
public void shouldForgeCorrectEntityBranchLocationCountry() {
}

View File

@ -5,18 +5,16 @@
*/
package org.mapstruct.ap.test.bugs._374;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Reproducer for https://github.com/mapstruct/mapstruct/issues/306.
@ -24,10 +22,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
* @author Sjaak Derksen
*/
@IssueKey( "306" )
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue374Test {
@Test
@ProcessorTest
@WithClasses( { Issue374Mapper.class, Source.class, Target.class } )
public void shouldMapExistingTargetToDefault() {
@ -38,7 +35,7 @@ public class Issue374Test {
assertThat( result.getConstant() ).isEqualTo( "test" );
}
@Test
@ProcessorTest
@WithClasses( { Issue374Mapper.class, Source.class, Target.class } )
public void shouldMapExistingTargetWithConstantToDefault() {
@ -49,7 +46,7 @@ public class Issue374Test {
assertThat( target2.getConstant() ).isNull();
}
@Test
@ProcessorTest
@WithClasses( { Issue374Mapper.class, Source.class, Target.class } )
public void shouldMapExistingIterableTargetToDefault() {
@ -60,7 +57,7 @@ public class Issue374Test {
assertThat( targetList ).isEmpty();
}
@Test
@ProcessorTest
@WithClasses( { Issue374Mapper.class, Source.class, Target.class } )
public void shouldMapExistingMapTargetToDefault() {
@ -71,7 +68,7 @@ public class Issue374Test {
assertThat( resultMap ).isEqualTo( resultMap );
}
@Test
@ProcessorTest
@WithClasses( { Issue374VoidMapper.class, Source.class, Target.class } )
public void shouldMapExistingTargetVoidReturnToDefault() {
@ -81,7 +78,7 @@ public class Issue374Test {
assertThat( target.getConstant() ).isEqualTo( "test" );
}
@Test
@ProcessorTest
@WithClasses( { Issue374VoidMapper.class, Source.class, Target.class } )
public void shouldMapExistingIterableTargetVoidReturnToDefault() {
@ -91,7 +88,7 @@ public class Issue374Test {
assertThat( targetList ).isEmpty();
}
@Test
@ProcessorTest
@WithClasses( { Issue374VoidMapper.class, Source.class, Target.class } )
public void shouldMapExistingMapTargetVoidReturnToDefault() {

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._375;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* Reproducer for https://github.com/mapstruct/mapstruct/issues/375.
@ -17,10 +15,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
* @author Sjaak Derksen
*/
@IssueKey( "375" )
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue375Test {
@Test
@ProcessorTest
@WithClasses( { Issue375Mapper.class, Source.class, Target.class, Int.class, Case.class } )
public void shouldForgeNewMappings() {
}

View File

@ -5,18 +5,16 @@
*/
package org.mapstruct.ap.test.bugs._394;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.test.bugs._394.source.AnotherCar;
import org.mapstruct.ap.test.bugs._394.source.Cars;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
@WithClasses( {
SameNameForSourceAndTargetCarsMapper.class,
@ -26,10 +24,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
org.mapstruct.ap.test.bugs._394._target.AnotherCar.class
} )
@IssueKey("394")
@RunWith(AnnotationProcessorTestRunner.class)
public class SameClassNameInDifferentPackageTest {
@Test
@ProcessorTest
public void shouldCreateMapMethodImplementation() {
Map<String, AnotherCar> values = new HashMap<String, AnotherCar>();
//given

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._405;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* Reproducer for https://github.com/mapstruct/mapstruct/issues/405.
@ -17,10 +15,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
* @author Sjaak Derksen
*/
@IssueKey( "405" )
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue405Test {
@Test
@ProcessorTest
@WithClasses( { EntityFactory.class, Person.class, People.class, PersonMapper.class } )
public void shouldGenerateFactoryCorrectMethodForIterables() {
}

View File

@ -8,11 +8,11 @@ package org.mapstruct.ap.test.bugs._513;
import java.util.Arrays;
import java.util.HashMap;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
/**
* Reproducer for https://github.com/mapstruct/mapstruct/issues/513.
@ -34,10 +34,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
MappingKeyException.class,
MappingValueException.class
} )
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue513Test {
@Test( expected = MappingException.class )
@ProcessorTest
public void shouldThrowMappingException() throws Exception {
Source source = new Source();
@ -45,11 +44,12 @@ public class Issue513Test {
sourceElement.setValue( "test" );
source.setCollection( Arrays.asList( sourceElement ) );
Issue513Mapper.INSTANCE.map( source );
assertThatThrownBy( () -> Issue513Mapper.INSTANCE.map( source ) )
.isInstanceOf( MappingException.class );
}
@Test( expected = MappingKeyException.class )
@ProcessorTest
public void shouldThrowMappingKeyException() throws Exception {
Source source = new Source();
@ -60,11 +60,12 @@ public class Issue513Test {
map.put( sourceKey, sourceValue );
source.setMap( map );
Issue513Mapper.INSTANCE.map( source );
assertThatThrownBy( () -> Issue513Mapper.INSTANCE.map( source ) )
.isInstanceOf( MappingKeyException.class );
}
@Test( expected = MappingValueException.class )
@ProcessorTest
public void shouldThrowMappingValueException() throws Exception {
Source source = new Source();
@ -75,11 +76,12 @@ public class Issue513Test {
map.put( sourceKey, sourceValue );
source.setMap( map );
Issue513Mapper.INSTANCE.map( source );
assertThatThrownBy( () -> Issue513Mapper.INSTANCE.map( source ) )
.isInstanceOf( MappingValueException.class );
}
@Test( expected = MappingException.class )
@ProcessorTest
public void shouldThrowMappingCommonException() throws Exception {
Source source = new Source();
@ -90,7 +92,8 @@ public class Issue513Test {
map.put( sourceKey, sourceValue );
source.setMap( map );
Issue513Mapper.INSTANCE.map( source );
assertThatThrownBy( () -> Issue513Mapper.INSTANCE.map( source ) )
.isInstanceOf( MappingException.class );
}
}

View File

@ -5,11 +5,9 @@
*/
package org.mapstruct.ap.test.bugs._515;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
/**
* Reproducer for https://github.com/mapstruct/mapstruct/issues/515.
@ -17,10 +15,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
* @author Sjaak Derksen
*/
@IssueKey( "515" )
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue515Test {
@Test
@ProcessorTest
@WithClasses( { Issue515Mapper.class, Source.class, Target.class } )
public void shouldIgnoreParanthesesOpenInStringDefinition() {
}

View File

@ -5,13 +5,11 @@
*/
package org.mapstruct.ap.test.bugs._516;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Reproducer for https://github.com/mapstruct/mapstruct/issues/516.
@ -19,10 +17,9 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
* @author Sjaak Derksen
*/
@IssueKey( "516" )
@RunWith(AnnotationProcessorTestRunner.class)
public class Issue516Test {
@Test
@ProcessorTest
@WithClasses( { SourceTargetMapper.class, Source.class, Target.class } )
public void shouldAddNullPtrCheckAroundSourceForAdder() {

View File

@ -5,18 +5,15 @@
*/
package org.mapstruct.ap.test.bugs._537;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Christian Bandowski
*/
@RunWith(AnnotationProcessorTestRunner.class)
@IssueKey("537")
@WithClasses({
Issue537Mapper.class,
@ -27,7 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
})
public class Issue537Test {
@Test
@ProcessorTest
public void testThatReferencedMapperWillBeUsed() {
Target target = Issue537Mapper.INSTANCE.mapDto( new Source( "abc" ) );

Some files were not shown because too many files have changed in this diff Show More