@Test public void Non_element_from_list_request_returns_no_specimen() { Object result = this.relay.create("string", null); assertEquals(new NoSpecimen(), result); }
@Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof ElementFromListRequest)) { return new NoSpecimen(); } ElementFromListRequest listRequest = (ElementFromListRequest) request; if (listRequest.getList().isEmpty()) { throw new ObjectCreationException("List of elements was empty"); } return this.strategy.get(listRequest.getList()); }
ElementFromListRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof ElementFromListRequest)) { return new NoSpecimen(); } ElementFromListRequest listRequest = (ElementFromListRequest) request; if (listRequest.getList().isEmpty()) { throw new ObjectCreationException("List of elements was empty"); } return this.strategy.get(listRequest.getList()); } }
ElementFromListRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof ElementFromListRequest)) { return new NoSpecimen(); } ElementFromListRequest listRequest = (ElementFromListRequest) request; if (listRequest.getList().isEmpty()) { throw new ObjectCreationException("List of elements was empty"); } return this.strategy.get(listRequest.getList()); } ElementFromListRelay(ElementFromListStrategy strategy); }
ElementFromListRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof ElementFromListRequest)) { return new NoSpecimen(); } ElementFromListRequest listRequest = (ElementFromListRequest) request; if (listRequest.getList().isEmpty()) { throw new ObjectCreationException("List of elements was empty"); } return this.strategy.get(listRequest.getList()); } ElementFromListRelay(ElementFromListStrategy strategy); @Override Object create(Object request, SpecimenContext context); }
ElementFromListRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof ElementFromListRequest)) { return new NoSpecimen(); } ElementFromListRequest listRequest = (ElementFromListRequest) request; if (listRequest.getList().isEmpty()) { throw new ObjectCreationException("List of elements was empty"); } return this.strategy.get(listRequest.getList()); } ElementFromListRelay(ElementFromListStrategy strategy); @Override Object create(Object request, SpecimenContext context);  }