ShowCallHierarchyAction extends FocusOnThisAbstractAction<CallHierarchyLogFilter> { protected boolean theSameLogMethod(LogData ld1, LogData ld2) { return StringUtils.equals(ld1.getClazz(), ld2.getClazz()) && StringUtils.equals(ld1.getMethod(), ld2.getMethod()); } ShowCallHierarchyAction(CallHierarchyLogFilter filter, JCheckBox filterEnableCheckBox, OtrosApplication otrosApplication); @Override void action(ActionEvent e, CallHierarchyLogFilter filter, LogData... selectedLogData);  }
@Test public void testTheSameLogMethod() { ShowCallHierarchyAction action = new ShowCallHierarchyAction(null, null, null); LogData ld1 = new LogDataBuilder().withId(1).withClass("a.b.c").withMethod("a").build(); LogData ld2 = new LogDataBuilder().withId(1).withClass("a.b.c").withMethod("a").build(); AssertJUnit.assertTrue(action.theSameLogMethod(ld1, ld2)); }
@Test public void testTheSameLogMethodDifferentClass() { ShowCallHierarchyAction action = new ShowCallHierarchyAction(null, null, null); LogData ld1 = new LogDataBuilder().withId(1).withClass("a.b.c").withMethod("a").build(); LogData ld2 = new LogDataBuilder().withId(1).withClass("a.b.d").withMethod("a").build(); AssertJUnit.assertFalse(action.theSameLogMethod(ld1, ld2)); }
@Test public void testTheSameLogMethodDifferentMethod() { ShowCallHierarchyAction action = new ShowCallHierarchyAction(null, null, null); LogData ld1 = new LogDataBuilder().withId(1).withClass("a.b.c").withMethod("a").build(); LogData ld2 = new LogDataBuilder().withId(1).withClass("a.b.c").withMethod("b").build(); AssertJUnit.assertFalse(action.theSameLogMethod(ld1, ld2)); }