1818import static com .github .nylle .javafixture .SpecimenType .fromClass ;
1919import static org .assertj .core .api .Assertions .assertThat ;
2020
21- class FactoryMethodTest {
21+ class FactoryMethodInstantiatorTest {
2222
2323 @ Test
2424 @ DisplayName ("returns instance of class using factory method without arguments" )
2525 void factoryMethodWithoutArgument () throws NoSuchMethodException {
26- var sut = FactoryMethod .<FactoryMethodWithoutArgument >create (FactoryMethodWithoutArgument .class .getDeclaredMethod ("factoryMethod" ), fromClass (FactoryMethodWithoutArgument .class ));
26+ var sut = FactoryMethodInstantiator .<FactoryMethodWithoutArgument >create (FactoryMethodWithoutArgument .class .getDeclaredMethod ("factoryMethod" ), fromClass (FactoryMethodWithoutArgument .class ));
2727
2828 var actual = sut .invoke (new SpecimenFactory (new Context (Configuration .configure ())), noContext ());
2929
@@ -33,7 +33,7 @@ void factoryMethodWithoutArgument() throws NoSuchMethodException {
3333 @ Test
3434 @ DisplayName ("returns instance of class using factory method with arguments" )
3535 void returnsInstanceOfClassUsingFactoryMethodWithArguments () throws NoSuchMethodException {
36- var sut = FactoryMethod .<FactoryMethodWithArgument >create (FactoryMethodWithArgument .class .getDeclaredMethod ("factoryMethod" , int .class ), fromClass (FactoryMethodWithArgument .class ));
36+ var sut = FactoryMethodInstantiator .<FactoryMethodWithArgument >create (FactoryMethodWithArgument .class .getDeclaredMethod ("factoryMethod" , int .class ), fromClass (FactoryMethodWithArgument .class ));
3737
3838 var actual = sut .invoke (new SpecimenFactory (new Context (Configuration .configure ())), noContext ());
3939
@@ -43,7 +43,7 @@ void returnsInstanceOfClassUsingFactoryMethodWithArguments() throws NoSuchMethod
4343 @ Test
4444 @ DisplayName ("returns instance of class using factory method with generic argument" )
4545 void factoryMethodWithGenericArgument () throws NoSuchMethodException {
46- var sut = FactoryMethod .create (FactoryMethodWithGenericArgument .class .getDeclaredMethod ("factoryMethod" , Object .class ), new SpecimenType <FactoryMethodWithGenericArgument <Integer >>() {});
46+ var sut = FactoryMethodInstantiator .create (FactoryMethodWithGenericArgument .class .getDeclaredMethod ("factoryMethod" , Object .class ), new SpecimenType <FactoryMethodWithGenericArgument <Integer >>() {});
4747
4848 var actual = sut .invoke (new SpecimenFactory (new Context (Configuration .configure ())), noContext ());
4949
@@ -53,7 +53,7 @@ void factoryMethodWithGenericArgument() throws NoSuchMethodException {
5353 @ Test
5454 @ DisplayName ("returns instance of abstract class using factory method without arguments" )
5555 void returnsInstanceOfAbstractClassUsingFactoryMethod () throws NoSuchMethodException {
56- var sut = FactoryMethod .create (Charset .class .getDeclaredMethod ("defaultCharset" ), new SpecimenType <Charset >() {});
56+ var sut = FactoryMethodInstantiator .create (Charset .class .getDeclaredMethod ("defaultCharset" ), new SpecimenType <Charset >() {});
5757
5858 var actual = sut .invoke (new SpecimenFactory (new Context (Configuration .configure ())), noContext ());
5959
@@ -63,7 +63,7 @@ void returnsInstanceOfAbstractClassUsingFactoryMethod() throws NoSuchMethodExcep
6363 @ Test
6464 @ DisplayName ("returns instance of Optional using factory method with arguments" )
6565 void createOptionalWithArgument () throws NoSuchMethodException {
66- var sut = FactoryMethod .create (Optional .class .getDeclaredMethod ("of" , Object .class ), new SpecimenType <Optional <String >>() {});
66+ var sut = FactoryMethodInstantiator .create (Optional .class .getDeclaredMethod ("of" , Object .class ), new SpecimenType <Optional <String >>() {});
6767
6868 var actual = sut .invoke (new SpecimenFactory (new Context (Configuration .configure ())), noContext ());
6969
@@ -75,7 +75,7 @@ void createOptionalWithArgument() throws NoSuchMethodException {
7575 @ Test
7676 @ DisplayName ("returns instance of Optional using factory method without arguments" )
7777 void createOptionalWithoutArgument () throws NoSuchMethodException {
78- var sut = FactoryMethod .create (Optional .class .getDeclaredMethod ("empty" ), new SpecimenType <Optional <String >>() {});
78+ var sut = FactoryMethodInstantiator .create (Optional .class .getDeclaredMethod ("empty" ), new SpecimenType <Optional <String >>() {});
7979
8080 var actual = sut .invoke (new SpecimenFactory (new Context (Configuration .configure ())), noContext ());
8181
@@ -86,7 +86,7 @@ void createOptionalWithoutArgument() throws NoSuchMethodException {
8686 @ Test
8787 @ DisplayName ("returns instance of generic class using generic method without arguments" )
8888 void genericNoArgumentFactoryMethod () throws NoSuchMethodException {
89- var sut = FactoryMethod .create (GenericClassWithFactoryMethodWithoutArgument .class .getDeclaredMethod ("factoryMethod" ), new SpecimenType <GenericClassWithFactoryMethodWithoutArgument <Integer >>() {});
89+ var sut = FactoryMethodInstantiator .create (GenericClassWithFactoryMethodWithoutArgument .class .getDeclaredMethod ("factoryMethod" ), new SpecimenType <GenericClassWithFactoryMethodWithoutArgument <Integer >>() {});
9090
9191 var actual = sut .invoke (new SpecimenFactory (new Context (Configuration .configure ())), noContext ());
9292
0 commit comments