ConfigPayloadBuilder { public void setField(String name, String value) { validateField(name, value); objectMap.put(name, new ConfigPayloadBuilder(value)); } ConfigPayloadBuilder();  ConfigPayloadBuilder(ConfigDefinition configDefinition); private  ConfigPayloadBuilder(String value); private  ConfigPayloadBuilder(ConfigDefinition configDefinition, String value); private  ConfigPayloadBuilder(ConfigPayloadBuilder other);  ConfigPayloadBuilder(ConfigPayload payload); void setField(String name, String value); ConfigPayloadBuilder getObject(String name); Array getArray(String name); void resolve(Cursor parent); ConfigPayloadBuilder override(ConfigPayloadBuilder other); String getValue(); void setValue(String value); MapBuilder getMap(String name); ConfigDefinition getConfigDefinition();  }
@Test public void require_that_simple_fields_can_be_overwritten() { ConfigPayloadBuilder builder = new ConfigPayloadBuilder(); builder.setField("foo", "bar"); builder.setField("foo", "baz"); Cursor root = createSlime(builder); assertEquals("baz", root.field("foo").asString()); }
@Test(expected=IllegalArgumentException.class) public void require_that_values_are_verified_against_def() { builderWithDef.setField("boolval", "true"); builderWithDef.setField("boolval", "invalid"); }