@Test(expected = ObjectCreationException.class) public void Empty_list_request_throws_exception() { this.relay.create(new ElementFromListRequest(new ArrayList<Object>()), null); }
@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);  }