@Test public void non_field_request_returns_no_specimen() { Object result = this.fieldBuilder.create(String.class, mockSpecimenContext); assertEquals(new NoSpecimen(), result); }
@Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof Field)) { return new NoSpecimen(); } Field field = (Field) request; Type genericType = field.getGenericType(); SpecimenType specimenType = SpecimenType.of(genericType); String fieldName = field.getName(); Object actualRequest = getActualRequest(field, specimenType); return context.resolve(new SeededRequest(fieldName, actualRequest)); }
FieldRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof Field)) { return new NoSpecimen(); } Field field = (Field) request; Type genericType = field.getGenericType(); SpecimenType specimenType = SpecimenType.of(genericType); String fieldName = field.getName(); Object actualRequest = getActualRequest(field, specimenType); return context.resolve(new SeededRequest(fieldName, actualRequest)); } }
FieldRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof Field)) { return new NoSpecimen(); } Field field = (Field) request; Type genericType = field.getGenericType(); SpecimenType specimenType = SpecimenType.of(genericType); String fieldName = field.getName(); Object actualRequest = getActualRequest(field, specimenType); return context.resolve(new SeededRequest(fieldName, actualRequest)); } FieldRelay(RequestEnricher requestEnricher); }
FieldRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof Field)) { return new NoSpecimen(); } Field field = (Field) request; Type genericType = field.getGenericType(); SpecimenType specimenType = SpecimenType.of(genericType); String fieldName = field.getName(); Object actualRequest = getActualRequest(field, specimenType); return context.resolve(new SeededRequest(fieldName, actualRequest)); } FieldRelay(RequestEnricher requestEnricher); @Override Object create(Object request, SpecimenContext context); }
FieldRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof Field)) { return new NoSpecimen(); } Field field = (Field) request; Type genericType = field.getGenericType(); SpecimenType specimenType = SpecimenType.of(genericType); String fieldName = field.getName(); Object actualRequest = getActualRequest(field, specimenType); return context.resolve(new SeededRequest(fieldName, actualRequest)); } FieldRelay(RequestEnricher requestEnricher); @Override Object create(Object request, SpecimenContext context);  }