@Test public void Non_seeded_request_returns_new_no_specimen() { Object result = this.builder.create(new Object(), this.mockSpecimenContext); assertEquals(new NoSpecimen(), result); }
@Override public Object create(Object request, SpecimenContext context) { if(!(request instanceof SeededRequest)) return new NoSpecimen(); SeededRequest seededRequest = (SeededRequest)request; if(!(seededRequest.getSeed() instanceof String)) return new NoSpecimen(); if(!seededRequest.getRequest().equals(String.class)) return new NoSpecimen(); String seed = (String)seededRequest.getSeed(); Object innerRequest = seededRequest.getRequest(); Object specimen = context.resolve(innerRequest); if(!(specimen instanceof String)) return new NoSpecimen(); return seed + specimen; }
SeededStringBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if(!(request instanceof SeededRequest)) return new NoSpecimen(); SeededRequest seededRequest = (SeededRequest)request; if(!(seededRequest.getSeed() instanceof String)) return new NoSpecimen(); if(!seededRequest.getRequest().equals(String.class)) return new NoSpecimen(); String seed = (String)seededRequest.getSeed(); Object innerRequest = seededRequest.getRequest(); Object specimen = context.resolve(innerRequest); if(!(specimen instanceof String)) return new NoSpecimen(); return seed + specimen; } }
SeededStringBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if(!(request instanceof SeededRequest)) return new NoSpecimen(); SeededRequest seededRequest = (SeededRequest)request; if(!(seededRequest.getSeed() instanceof String)) return new NoSpecimen(); if(!seededRequest.getRequest().equals(String.class)) return new NoSpecimen(); String seed = (String)seededRequest.getSeed(); Object innerRequest = seededRequest.getRequest(); Object specimen = context.resolve(innerRequest); if(!(specimen instanceof String)) return new NoSpecimen(); return seed + specimen; }  }
SeededStringBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if(!(request instanceof SeededRequest)) return new NoSpecimen(); SeededRequest seededRequest = (SeededRequest)request; if(!(seededRequest.getSeed() instanceof String)) return new NoSpecimen(); if(!seededRequest.getRequest().equals(String.class)) return new NoSpecimen(); String seed = (String)seededRequest.getSeed(); Object innerRequest = seededRequest.getRequest(); Object specimen = context.resolve(innerRequest); if(!(specimen instanceof String)) return new NoSpecimen(); return seed + specimen; }  @Override Object create(Object request, SpecimenContext context); }
SeededStringBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if(!(request instanceof SeededRequest)) return new NoSpecimen(); SeededRequest seededRequest = (SeededRequest)request; if(!(seededRequest.getSeed() instanceof String)) return new NoSpecimen(); if(!seededRequest.getRequest().equals(String.class)) return new NoSpecimen(); String seed = (String)seededRequest.getSeed(); Object innerRequest = seededRequest.getRequest(); Object specimen = context.resolve(innerRequest); if(!(specimen instanceof String)) return new NoSpecimen(); return seed + specimen; }  @Override Object create(Object request, SpecimenContext context);  }