28
28
import org .pitest .junit5 .repository .TestClassWithNestedClassWithNestedAnnotationAndNestedTestFactoryAnnotation ;
29
29
import org .pitest .junit5 .repository .TestClassWithParameterizedTestAnnotation ;
30
30
import org .pitest .junit5 .repository .TestClassWithRepeatedTestAnnotation ;
31
+ import org .pitest .junit5 .repository .TestClassWithTags ;
31
32
import org .pitest .junit5 .repository .TestClassWithTestAnnotation ;
32
33
import org .pitest .junit5 .repository .TestClassWithTestFactoryAnnotation ;
33
34
import org .pitest .junit5 .repository .TestClassWithTestTemplateAnnotation ;
34
35
import org .pitest .junit5 .repository .TestClassWithoutAnnotations ;
36
+ import org .pitest .testapi .TestGroupConfig ;
35
37
36
38
/**
37
39
*
@@ -44,77 +46,87 @@ public JUnit5TestUnitFinderTest() {
44
46
45
47
@ Test
46
48
public void testTestClassWithParameterizedTestAnnotation () {
47
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithParameterizedTestAnnotation .class )).hasSize (1 );
49
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithParameterizedTestAnnotation .class )).hasSize (1 );
48
50
}
49
51
50
52
@ Test
51
53
public void testTestClassWithRepeatedTestAnnotation () {
52
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithRepeatedTestAnnotation .class )).hasSize (1 );
54
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithRepeatedTestAnnotation .class )).hasSize (1 );
53
55
}
54
56
55
57
@ Test
56
58
public void testTestClassWithTestAnnotation () {
57
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithTestAnnotation .class )).hasSize (1 );
59
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithTestAnnotation .class )).hasSize (1 );
58
60
}
59
61
60
62
@ Test
61
63
public void testTestClassWithTestFactoryAnnotation () {
62
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithTestFactoryAnnotation .class )).hasSize (1 );
64
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithTestFactoryAnnotation .class )).hasSize (1 );
63
65
}
64
66
65
67
@ Test
66
68
public void testTestClassWithTestTemplateAnnotation () {
67
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithTestTemplateAnnotation .class )).hasSize (1 );
69
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithTestTemplateAnnotation .class )).hasSize (1 );
68
70
}
69
71
70
72
@ Test
71
73
public void testTestClassWithNestedAnnotationAndNestedTestAnnotation () {
72
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedAnnotationAndNestedTestAnnotation .class )).hasSize (1 );
73
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedAnnotationAndNestedTestAnnotation .NestedClass .class )).isEmpty ();
74
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedAnnotationAndNestedTestAnnotation .class )).hasSize (1 );
75
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedAnnotationAndNestedTestAnnotation .NestedClass .class )).isEmpty ();
74
76
}
75
77
76
78
@ Test
77
79
public void testTestClassWithNestedAnnotationAndNestedTestFactoryAnnotation () {
78
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedAnnotationAndNestedTestFactoryAnnotation .class )).hasSize (1 );
79
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedAnnotationAndNestedTestFactoryAnnotation .NestedClass .class )).isEmpty ();
80
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedAnnotationAndNestedTestFactoryAnnotation .class )).hasSize (1 );
81
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedAnnotationAndNestedTestFactoryAnnotation .NestedClass .class )).isEmpty ();
80
82
}
81
83
82
84
@ Test
83
85
public void testTestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation () {
84
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation .class )).hasSize (1 );
85
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation .NestedClass .class )).isEmpty ();
86
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation .NestedClass .NestedNestedClass .class )).isEmpty ();
86
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation .class )).hasSize (1 );
87
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation .NestedClass .class )).isEmpty ();
88
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation .NestedClass .NestedNestedClass .class )).isEmpty ();
87
89
}
88
90
89
91
@ Test
90
92
public void testTestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation () {
91
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation .class )).hasSize (1 );
92
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation .NestedClass .class )).isEmpty ();
93
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation .NestedClass .NestedNestedClass .class )).isEmpty ();
93
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation .class )).hasSize (1 );
94
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation .NestedClass .class )).isEmpty ();
95
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation .NestedClass .NestedNestedClass .class )).isEmpty ();
94
96
}
95
97
96
98
@ Test
97
99
public void testTestClassWithoutAnnotations () {
98
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithoutAnnotations .class )).isEmpty ();
100
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithoutAnnotations .class )).isEmpty ();
99
101
}
100
102
101
103
@ Test
102
104
public void testTestClassWithNestedClassWithNestedAnnotationAndNestedTestAnnotation () {
103
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedClassWithNestedAnnotationAndNestedTestAnnotation .class )).isEmpty ();
105
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedClassWithNestedAnnotationAndNestedTestAnnotation .class )).isEmpty ();
104
106
}
105
107
106
108
@ Test
107
109
public void testTestClassWithNestedClassWithNestedAnnotationAndNestedTestFactoryAnnotation () {
108
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithNestedClassWithNestedAnnotationAndNestedTestFactoryAnnotation .class )).isEmpty ();
110
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithNestedClassWithNestedAnnotationAndNestedTestFactoryAnnotation .class )).isEmpty ();
109
111
}
110
112
111
113
@ Test
112
114
public void testTestClassWithInheritedTestMethod () {
113
- assertThat (new JUnit5TestUnitFinder (emptyList ()).findTestUnits (TestClassWithInheritedTestMethod .class )).hasSize (1 );
115
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), emptyList ()).findTestUnits (TestClassWithInheritedTestMethod .class )).hasSize (1 );
114
116
}
115
117
116
118
@ Test
117
119
public void testTestClassWithIncludedTestMethod () {
118
- assertThat (new JUnit5TestUnitFinder (singletonList ("included" )).findTestUnits (TestClassWithIncludedTestMethod .class )).hasSize (1 );
120
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig (), singletonList ("included" )).findTestUnits (TestClassWithIncludedTestMethod .class )).hasSize (1 );
121
+ }
122
+
123
+ @ Test
124
+ public void testTestClassWithExcludedTag () {
125
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig ().withExcludedGroups ("excluded" ), emptyList ()).findTestUnits (TestClassWithTags .class )).hasSize (3 );
126
+ }
127
+
128
+ @ Test
129
+ public void testTestClassWithIncludedTag () {
130
+ assertThat (new JUnit5TestUnitFinder (new TestGroupConfig ().withIncludedGroups ("included" ), emptyList ()).findTestUnits (TestClassWithTags .class )).hasSize (1 );
119
131
}
120
132
}
0 commit comments