@Test public void testFaultStringString() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { Container container = new Container(); Map<String, Class<? extends Fault>> classes = new HashMap<>(); classes.put("fault-2", Fault2.class); Field classesField = Container.class.getDeclaredField("classes"); classesField.setAccessible(true); classesField.set(container, classes); Fault2 fault2 = (Fault2) container.fault("fault-2", "{\"property2\":2,\"property3\":\"hello\"}"); assertThat(fault2.id().length(), is(8)); }
public Fault fault(String name, String params) { return fault(name, RandomStringUtils.randomAlphanumeric(8), params); }
Container { public Fault fault(String name, String params) { return fault(name, RandomStringUtils.randomAlphanumeric(8), params); } }
Container { public Fault fault(String name, String params) { return fault(name, RandomStringUtils.randomAlphanumeric(8), params); } Container();  Container(Scheduler scheduler, Repository repository); }
Container { public Fault fault(String name, String params) { return fault(name, RandomStringUtils.randomAlphanumeric(8), params); } Container();  Container(Scheduler scheduler, Repository repository); Scheduler scheduler(); Repository repository(); Fault fault(String name, String params); Fault fault(String name, String id, String params); Map<String, Class<? extends Fault>> classes(); Map<String, Fault> faults(); Map<String, Interceptor> interceptors(); void shutdown(); }
Container { public Fault fault(String name, String params) { return fault(name, RandomStringUtils.randomAlphanumeric(8), params); } Container();  Container(Scheduler scheduler, Repository repository); Scheduler scheduler(); Repository repository(); Fault fault(String name, String params); Fault fault(String name, String id, String params); Map<String, Class<? extends Fault>> classes(); Map<String, Fault> faults(); Map<String, Interceptor> interceptors(); void shutdown();  }