Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface CommonDao<T> {
- public abstract T getEntityById(String entityId);
- public abstract void save(T object);
- public abstract void deleteEntityById(String entityId);
- }
- public interface LogService<T> extends CommonDao<T>{
- public void save(T item);
- public T getEntityById(String id);
- public List<T> getRecentActivity(String user);
- public void deleteEntityById(String entityId);
- public List<T> getActivityList(ActivityLogQueryParams params);
- }
- @RunWith(SwitchYardRunner.class)
- @SwitchYardTestCaseConfig(mixins = CDIMixIn.class)
- public class LogServiceTest {
- @ServiceOperation("LogService")
- private Invoker logService;
- @Test
- public void testSaveRuleActivity() throws Exception {
- RuleActivity expectedRuleActivity = new RuleActivity(new Date(), "user123", Application.RH, Category.Rules,
- "strategy123", "rule123", RuleAction.Created);
- logService.operation("save").sendInOnly(expectedRuleActivity);
- RuleActivity actualRuleActivity = logService.operation("getEntityById").sendInOut(expectedRuleActivity.getId())
- .getContent(RuleActivity.class);
- Assert.assertEquals(expectedRuleActivity, actualRuleActivity);
- logService.operation("deleteEntityById").sendInOnly(expectedRuleActivity.getId());
- Assert.assertNull(logService.operation("getEntityById").sendInOut(expectedRuleActivity.getId()).getContent());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement