{
//generate an event
HttpRequest httpRequest = new DefaultHttpRequest(HttpVersion.HTTP_1_1,
HttpMethod.GET, "/genDataEvents/start?src_ids=100&fromScn=10&eventsPerSec=1&duration=10");
SimpleTestHttpClient httpClient = SimpleTestHttpClient.createLocal(TimeoutPolicy.ALL_TIMEOUTS);
SimpleHttpResponseHandler respHandler = httpClient.sendRequest(_serverAddress, httpRequest);
assertTrue("failed to get a response", respHandler.awaitResponseUninterruptedly(1, TimeUnit.SECONDS));
String respString = new String(respHandler.getReceivedBytes());
LOG.debug("Response string:" + respString);
ByteArrayInputStream in = new ByteArrayInputStream(respHandler.getReceivedBytes());
ObjectMapper objMapper = new ObjectMapper();
Map<String,String> genRes = objMapper.readValue(in, new TypeReference<Map<String,String>>(){});
HttpResponse respObj = respHandler.getResponse();
assertNull("/genDataEvents returned unexpected error", respObj.getHeader(DatabusHttpHeaders.DATABUS_ERROR_CLASS_HEADER));
assertEquals("event-generation failed to start", "true", genRes.get("genDataEventsStarted"));
try {Thread.sleep(2000);} catch (InterruptedException ie) {}
}