BAEL-4936: Removed similar methods as per review comments
This commit is contained in:
parent
dd73b72fc9
commit
199d80fb34
|
@ -1,6 +1,5 @@
|
|||
package com.baeldung.interfaceVsAbstractClass;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
|
@ -13,24 +12,10 @@ public class InterfaceVsAbstractClassUnitTest {
|
|||
assertTrue(redCircle.isValid());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenAbstractClass_whenInvalidCircleUsedThenFail() {
|
||||
CircleClass redCircle = new ChildCircleClass();
|
||||
redCircle.setColor("WHITE");
|
||||
assertFalse(redCircle.isValid());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenInterface_whenValidCircleWithoutStateUsedThenPass() {
|
||||
ChidlCircleInterfaceImpl redCircleWithoutState = new ChidlCircleInterfaceImpl();
|
||||
redCircleWithoutState.setColor("RED");
|
||||
assertTrue(redCircleWithoutState.isValid(redCircleWithoutState.getColor()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenInterface_whenInvalidCircleWithoutStateUsedThenFail() {
|
||||
ChidlCircleInterfaceImpl redCircleWithoutState = new ChidlCircleInterfaceImpl();
|
||||
redCircleWithoutState.setColor("WHITE");
|
||||
assertFalse(redCircleWithoutState.isValid(redCircleWithoutState.getColor()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue