public void test_listen() throws IOException {
ScriptProcess p = datastore.newProcess(TEST_USER, "listen.js", false, "", "owner", TransportType.Twitter);
ScriptAction r = p.call();
assertTrue("listened correctly", r instanceof Listen);
assertTrue("listened correctly to no-one", ((Listen) r).getWho() == null);
p.save();
// final ThreadLocal<String> tweetId = new ThreadLocal<String>();
ScriptusFacade f = new ScriptusFacade(datastore, c, m, config) {
@Override
public void registerMessageCorrelation(MessageCorrelation cid) {
// tweetId.set(cid.getMessageId());
super.registerMessageCorrelation(cid);
}
};
r.visit(f, p); // sould say
Set<MessageCorrelation> ccc = datastore.getMessageCorrelations(null, "ianso", TEST_USER, TransportType.Twitter);
assertEquals("1 correlation", 1, ccc.size());