2020import com .github .nylle .javafixture .testobjects .interfaces .GenericInterfaceTUWithGenericImplementationT ;
2121import com .github .nylle .javafixture .testobjects .interfaces .GenericInterfaceTUWithGenericImplementationTU ;
2222import com .github .nylle .javafixture .testobjects .interfaces .GenericInterfaceTUWithGenericImplementationU ;
23+ import com .github .nylle .javafixture .testobjects .interfaces .GenericInterfaceTWithGenericImplementationTU ;
2324import com .github .nylle .javafixture .testobjects .interfaces .GenericInterfaceWithImplementation ;
2425import com .github .nylle .javafixture .testobjects .interfaces .InterfaceWithGenericImplementation ;
2526import com .github .nylle .javafixture .testobjects .interfaces .InterfaceWithImplementation ;
@@ -111,17 +112,24 @@ class CreatesInterfaceSpecimen {
111112
112113 @ Test
113114 @ DisplayName ("no implementations found" )
114- void createsInterfaceSpecimenIfInterfaceHasNoImplementations () {
115+ void ifInterfaceHasNoImplementations () {
115116 assertThat (new SpecimenFactory (context ).build (SpecimenType .fromClass (InterfaceWithoutImplementation .class )))
116117 .isExactlyInstanceOf (InterfaceSpecimen .class );
117118 }
118119
119120 @ Test
120121 @ DisplayName ("implementation is generic and interface is not" )
121- void createsInterfaceSpecimenIfImplementationIsGenericAndInterfaceIsNot () {
122+ void ifImplementationIsGenericAndInterfaceIsNot () {
122123 assertThat (new SpecimenFactory (context ).build (SpecimenType .fromClass (InterfaceWithGenericImplementation .class )))
123124 .isExactlyInstanceOf (InterfaceSpecimen .class );
124125 }
126+
127+ @ Test
128+ @ DisplayName ("implementation has more type arguments than interface" )
129+ void ifImplementationHasMoreTypeArgumentsThanInterface () {
130+ assertThat (new SpecimenFactory (context ).build (new SpecimenType <GenericInterfaceTWithGenericImplementationTU <String >>() {}))
131+ .isExactlyInstanceOf (InterfaceSpecimen .class );
132+ }
125133 }
126134
127135 @ Nested
@@ -130,14 +138,14 @@ class CreatesObjectSpecimen {
130138
131139 @ Test
132140 @ DisplayName ("implementation is not generic and interface is not generic" )
133- void createsObjectSpecimenIfBothImplementationAndInterfaceAreNotGeneric () {
141+ void ifBothImplementationAndInterfaceAreNotGeneric () {
134142 assertThat (new SpecimenFactory (context ).build (SpecimenType .fromClass (InterfaceWithImplementation .class )))
135143 .isExactlyInstanceOf (ObjectSpecimen .class );
136144 }
137145
138146 @ Test
139147 @ DisplayName ("implementation is not generic and interface is generic" )
140- void createsObjectSpecimenIfImplementationIsNotGenericAndInterfaceIs () {
148+ void ifImplementationIsNotGenericAndInterfaceIs () {
141149 assertThat (new SpecimenFactory (context ).build (new SpecimenType <GenericInterfaceWithImplementation <Integer , String >>() {}))
142150 .isExactlyInstanceOf (ObjectSpecimen .class );
143151 }
@@ -149,21 +157,21 @@ class CreatesGenericSpecimen {
149157
150158 @ Test
151159 @ DisplayName ("implementation is generic and interface is generic" )
152- void createsGenericSpecimenIfImplementationAndInterfaceAreGeneric () {
160+ void ifImplementationAndInterfaceAreGeneric () {
153161 assertThat (new SpecimenFactory (context ).build (new SpecimenType <GenericInterfaceTUWithGenericImplementationTU <String , Integer >>() {}))
154162 .isExactlyInstanceOf (GenericSpecimen .class );
155163 }
156164
157165 @ Test
158166 @ DisplayName ("generic implementation only uses first type-argument of generic interface" )
159- void createsGenericSpecimenIfGenericImplementationOnlyUsesFirstTypeArgumentOfGenericInterface () {
167+ void ifGenericImplementationOnlyUsesFirstTypeArgumentOfGenericInterface () {
160168 assertThat (new SpecimenFactory (context ).build (new SpecimenType <GenericInterfaceTUWithGenericImplementationT <String , Integer >>() {}))
161169 .isExactlyInstanceOf (GenericSpecimen .class );
162170 }
163171
164172 @ Test
165173 @ DisplayName ("generic implementation only uses second type-argument of generic interface" )
166- void createsGenericSpecimenIfGenericImplementationOnlyUsesSecondTypeArgumentOfGenericInterface () {
174+ void ifGenericImplementationOnlyUsesSecondTypeArgumentOfGenericInterface () {
167175 assertThat (new SpecimenFactory (context ).build (new SpecimenType <GenericInterfaceTUWithGenericImplementationU <String , Integer >>() {}))
168176 .isExactlyInstanceOf (GenericSpecimen .class );
169177 }
0 commit comments