IAutocompleteModel model = createModel();
IRequestCycle cycle = newMock(IRequestCycle.class);
DataSqueezer ds = newMock(DataSqueezer.class);
checkOrder(ds, false);
IJSONWriter writer = newBufferJSONWriter();
Autocompleter component = newInstance(Autocompleter.class, new Object[]
{ "name", "fred", "model", model,
"filter", "l", "dataSqueezer", ds });
expect(ds.squeeze(1)).andReturn("1");
expect(ds.squeeze(2)).andReturn("2");
expect(ds.squeeze(3)).andReturn("3");
replay();
component.renderComponent(writer, cycle);
verify();
JSONObject json = writer.object();
assertEquals(json.length(), 3);
assertEquals(json.get("1"), "Simple 1");
assertEquals(json.get("2"), "Simple 2");
assertEquals(json.get("3"), "Simple 3");