}
public void testCreateActivity() throws Exception {
ActivityManagerImpl manager = new ActivityManagerImpl();
manager.setRegistry(registry);
Activity activity1 = new ActivityImpl();
activity1.setUserId("admin");
activity1.setId("1");
activity1.setAppId("1");
activity1.setTitle("Adding Gadget");
//manager.saveActivity("admin", activity1);
manager.createActivity("admin","self","1",null,activity1);
Activity activity2 = manager.getActivity("admin", "self", "1", null, "1");
assertNotNull(activity2);
assertEquals("admin", activity2.getUserId());
assertEquals("Adding Gadget", activity2.getTitle());
assertEquals("1",activity2.getId());
/* Checking the scenario - no activityId specified*/
activity1 = new ActivityImpl();
activity1.setUserId("admin");
activity1.setAppId("99");
activity1.setTitle("Adding GadgetXXX");
manager.createActivity("admin","self","99",null,activity1);
Activity activity3=new ActivityImpl();
activity3.setUserId("admin");
activity3.setAppId("99");
activity3.setTitle("Adding GadgetYYY");
manager.createActivity("admin","self","99",null,activity3);
activity2 = manager.getActivity("admin", "self", "99", null, "1");
assertNotNull(activity2);
assertEquals("admin", activity2.getUserId());
assertEquals("Adding GadgetYYY", activity2.getTitle());