server.expect(baseUrl + "cmd?listBrowsers", gson.toJson(Lists.newArrayList(browserInfo)));
Map<String, String> params = new LinkedHashMap<String, String>();
params.put("data", "{mooh}");
params.put("id", "1");
FakeResponseStream stream = new FakeResponseStream();
MockFileLoader fileReader = new MockFileLoader();
fileReader.addExpectation(fileInfo, "foobar");
CommandTask task = createCommandTask(server, params,
stream, fileReader, true);
task.run(new JstdTestCase(Collections.<FileInfo>emptyList(), Lists.newArrayList(fileInfo), java.util.Collections.<FileInfo> emptyList(), ""));
Response response = stream.getResponse();
assertEquals("response", response.getResponse());
assertEquals("browser", response.getBrowser().getName());
assertEquals("error", response.getError());
assertEquals(123L, response.getExecutionTime());