@SuppressWarnings("unchecked")
@Test
public void handleEvent() {

	Twitter twitter = mock(Twitter.class);
	Map<Event, EventPayLoadToTweet<JSONObject, TradeEventPayLoad>> eventPayLoadToTweetMap = Maps.newHashMap();
	EventPayLoadToTweet<JSONObject, TradeEventPayLoad> handler = mock(EventPayLoadToTweet.class);
	eventPayLoadToTweetMap.put(TradeEvents.TAKE_PROFIT_FILLED, handler);
	TweetFXTradeService<JSONObject, TradeEventPayLoad> service = new TweetFXTradeService<JSONObject, TradeEventPayLoad>();
	service.twitter = twitter;
	service.eventPayLoadToTweetMap = eventPayLoadToTweetMap;
	EventBus eventBus = new EventBus();
	eventBus.register(service);
	JSONObject jsonPayload = mock(JSONObject.class);
	TradeEventPayLoad payload = new TradeEventPayLoad(TradeEvents.TAKE_PROFIT_FILLED, jsonPayload);
	String tweet = "hello Twitter";
	when(handler.toTweet(payload)).thenReturn(tweet);
	TimelineOperations operations = mock(TimelineOperations.class);
	when(twitter.timelineOperations()).thenReturn(operations);
	eventBus.post(payload);
	verify(operations, times(1)).updateStatus(tweet);
}