ActionCallMethod extends ActionSetField { @Override public int hashCode() { return ~~Objects.hash(super.hashCode(), state, methodName); } ActionCallMethod(final String itemText);  ActionCallMethod(); int getState(); String getMethodName(); void setState(int state); void setMethodName(String methodName); ActionFieldFunction getFieldValue(int i); void addFieldValue(final ActionFieldValue val); @Override boolean equals(Object o); @Override int hashCode(); static final int TYPE_UNDEFINED; static final int TYPE_DEFINED; }
@Test public void testBothNamesNull() { final ActionCallMethod action1 = new ActionCallMethod(); final ActionCallMethod action2 = new ActionCallMethod(); Assertions.assertThat(action1).isEqualTo(action2); Assertions.assertThat(action2).isEqualTo(action1); Assertions.assertThat(action1.hashCode()).isEqualTo(action2.hashCode()); Assertions.assertThat(action2.hashCode()).isEqualTo(action1.hashCode()); }
@Test public void testFirstNameIsNull() { final ActionCallMethod action1 = new ActionCallMethod(); final ActionCallMethod action2 = new ActionCallMethod("invokedMethod"); Assertions.assertThat(action1).isNotEqualTo(action2); Assertions.assertThat(action2).isNotEqualTo(action1); Assertions.assertThat(action1.hashCode()).isNotEqualTo(action2.hashCode()); Assertions.assertThat(action2.hashCode()).isNotEqualTo(action1.hashCode()); }
@Test public void testSecondNameIsNull() { final ActionCallMethod action1 = new ActionCallMethod("invokedMethod"); final ActionCallMethod action2 = new ActionCallMethod(); Assertions.assertThat(action1).isNotEqualTo(action2); Assertions.assertThat(action2).isNotEqualTo(action1); Assertions.assertThat(action1.hashCode()).isNotEqualTo(action2.hashCode()); Assertions.assertThat(action2.hashCode()).isNotEqualTo(action1.hashCode()); }
@Test public void testNamesAreDifferent() { final ActionCallMethod action1 = new ActionCallMethod("invokedMethod1"); final ActionCallMethod action2 = new ActionCallMethod("invokedMethod2"); Assertions.assertThat(action1).isNotEqualTo(action2); Assertions.assertThat(action2).isNotEqualTo(action1); Assertions.assertThat(action1.hashCode()).isNotEqualTo(action2.hashCode()); Assertions.assertThat(action2.hashCode()).isNotEqualTo(action1.hashCode()); }
@Test public void testBothNamesAreSame() { final ActionCallMethod action1 = new ActionCallMethod("invokedMethod"); final ActionCallMethod action2 = new ActionCallMethod("invokedMethod"); Assertions.assertThat(action1).isEqualTo(action2); Assertions.assertThat(action2).isEqualTo(action1); Assertions.assertThat(action1.hashCode()).isEqualTo(action2.hashCode()); Assertions.assertThat(action2.hashCode()).isEqualTo(action1.hashCode()); }