1919import com .google .common .collect .Sets ;
2020import nl .jqno .equalsverifier .EqualsVerifier ;
2121import org .junit .Test ;
22- import org .junit .runner .RunWith ;
23- import org .mockito .Mock ;
24- import org .mockito .junit .MockitoJUnitRunner ;
2522
2623import java .util .Set ;
2724
2825import static org .assertj .core .api .Assertions .assertThat ;
2926
30- @ RunWith (MockitoJUnitRunner .class )
3127public class TestRepairEntry
3228{
33- @ Mock
34- private DriverNode mockNode ;
35-
3629 @ Test
3730 public void testGetters ()
3831 {
3932 LongTokenRange expectedLongTokenRange = new LongTokenRange (0 , 1 );
4033 long expectedStartedAt = 5 ;
4134 long expectedFinishedAt = expectedStartedAt + 5 ;
42- Set <DriverNode > expectedParticipants = Sets .newHashSet (mockNode );
35+ Set <DriverNode > expectedParticipants = Sets .newHashSet ();
4336 RepairStatus expectedStatus = RepairStatus .SUCCESS ;
4437
4538 RepairEntry repairEntry = new RepairEntry (expectedLongTokenRange , expectedStartedAt , expectedFinishedAt , expectedParticipants , expectedStatus .toString ());
@@ -54,8 +47,8 @@ public void testGetters()
5447 @ Test
5548 public void testRepairEntriesAreEqual ()
5649 {
57- RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (mockNode ), "SUCCESS" );
58- RepairEntry repairEntry2 = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (mockNode ), "SUCCESS" );
50+ RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (), "SUCCESS" );
51+ RepairEntry repairEntry2 = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (), "SUCCESS" );
5952
6053 assertThat (repairEntry ).isEqualTo (repairEntry2 );
6154 assertThat (repairEntry .hashCode ()).isEqualTo (repairEntry2 .hashCode ());
@@ -64,34 +57,34 @@ public void testRepairEntriesAreEqual()
6457 @ Test
6558 public void testRepairEntriesWithDifferentRangeAreNotEqual ()
6659 {
67- RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (mockNode ), "SUCCESS" );
68- RepairEntry repairEntry2 = new RepairEntry (new LongTokenRange (1 , 2 ), 5 , 5 , Sets .newHashSet (mockNode ), "SUCCESS" );
60+ RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (), "SUCCESS" );
61+ RepairEntry repairEntry2 = new RepairEntry (new LongTokenRange (1 , 2 ), 5 , 5 , Sets .newHashSet (), "SUCCESS" );
6962
7063 assertThat (repairEntry ).isNotEqualTo (repairEntry2 );
7164 }
7265
7366 @ Test
7467 public void testRepairEntriesWithDifferentStartedAtAreNotEqual ()
7568 {
76- RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 7 , Sets .newHashSet (mockNode ), "SUCCESS" );
77- RepairEntry repairEntry2 = new RepairEntry (new LongTokenRange (0 , 1 ), 6 , 7 , Sets .newHashSet (mockNode ), "SUCCESS" );
69+ RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 7 , Sets .newHashSet (), "SUCCESS" );
70+ RepairEntry repairEntry2 = new RepairEntry (new LongTokenRange (0 , 1 ), 6 , 7 , Sets .newHashSet (), "SUCCESS" );
7871
7972 assertThat (repairEntry ).isNotEqualTo (repairEntry2 );
8073 }
8174
8275 @ Test
8376 public void testRepairEntriesWithDifferentFinishedAtAreNotEqual ()
8477 {
85- RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 6 , Sets .newHashSet (mockNode ), "SUCCESS" );
86- RepairEntry repairEntry2 = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 7 , Sets .newHashSet (mockNode ), "SUCCESS" );
78+ RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 6 , Sets .newHashSet (), "SUCCESS" );
79+ RepairEntry repairEntry2 = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 7 , Sets .newHashSet (), "SUCCESS" );
8780
8881 assertThat (repairEntry ).isNotEqualTo (repairEntry2 );
8982 }
9083
9184 @ Test
9285 public void testRepairEntriesWithDifferentParticipantsAreNotEqual ()
9386 {
94- RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (mockNode ), "SUCCESS" );
87+ RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (new DriverNode ( null ) ), "SUCCESS" );
9588 RepairEntry repairEntry2 = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (), "SUCCESS" );
9689
9790 assertThat (repairEntry ).isNotEqualTo (repairEntry2 );
@@ -100,8 +93,8 @@ public void testRepairEntriesWithDifferentParticipantsAreNotEqual()
10093 @ Test
10194 public void testRepairEntriesWithDifferentStatusAreNotEqual ()
10295 {
103- RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (mockNode ), "SUCCESS" );
104- RepairEntry repairEntry2 = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (mockNode ), "FAILED" );
96+ RepairEntry repairEntry = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (), "SUCCESS" );
97+ RepairEntry repairEntry2 = new RepairEntry (new LongTokenRange (0 , 1 ), 5 , 5 , Sets .newHashSet (), "FAILED" );
10598
10699 assertThat (repairEntry ).isNotEqualTo (repairEntry2 );
107100 }
0 commit comments