@Test public void if_request_is_a_specimen_type_it_gets_passed_to_the_inner_builder() { SpecimenType type = new SpecimenType<String>() { }; injector.create(type, mockContext); verify(mockBuilder).create(type, mockContext); }
@Override public Object create(final Object request, SpecimenContext context) { Object actualRequest; if(request instanceof Type) { actualRequest = SpecimenType.of((Type) request); } else { actualRequest = request; } return builder.create(actualRequest, context); }
SpecimenTypeInjector implements SpecimenBuilder { @Override public Object create(final Object request, SpecimenContext context) { Object actualRequest; if(request instanceof Type) { actualRequest = SpecimenType.of((Type) request); } else { actualRequest = request; } return builder.create(actualRequest, context); } }
SpecimenTypeInjector implements SpecimenBuilder { @Override public Object create(final Object request, SpecimenContext context) { Object actualRequest; if(request instanceof Type) { actualRequest = SpecimenType.of((Type) request); } else { actualRequest = request; } return builder.create(actualRequest, context); } SpecimenTypeInjector(SpecimenBuilder builder); }
SpecimenTypeInjector implements SpecimenBuilder { @Override public Object create(final Object request, SpecimenContext context) { Object actualRequest; if(request instanceof Type) { actualRequest = SpecimenType.of((Type) request); } else { actualRequest = request; } return builder.create(actualRequest, context); } SpecimenTypeInjector(SpecimenBuilder builder); @Override Object create(final Object request, SpecimenContext context); }
SpecimenTypeInjector implements SpecimenBuilder { @Override public Object create(final Object request, SpecimenContext context) { Object actualRequest; if(request instanceof Type) { actualRequest = SpecimenType.of((Type) request); } else { actualRequest = request; } return builder.create(actualRequest, context); } SpecimenTypeInjector(SpecimenBuilder builder); @Override Object create(final Object request, SpecimenContext context);  }