Skip to content

Commit

Permalink
Refactor CleanRemove method verifications in ScaleReverseTest
Browse files Browse the repository at this point in the history
Streamlined the verification of CleanRemove method calls in various test functions within ScaleReverseTest. The ArgumentMatchers usage has been modified from having anyInt() combined with any(Iterator.class) to just use any(). This increases the readability of method call verifications and bolsters test integrity.
  • Loading branch information
SmartGecko44 committed Dec 5, 2023
1 parent ca0dbb0 commit 0275b7d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/test/java/org/gecko/wauh/logic/ScaleReverseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.mockito.Mockito;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import static org.mockito.Mockito.*;
Expand Down Expand Up @@ -52,7 +51,7 @@ void testScaleReverseLogic_BucketSource() {

// Assertions
// Verify that CleanRemove() method of BucketListener is called once
verify(bucketListenerMock, times(1)).CleanRemove(anyInt(), any(Iterator.class));
verify(bucketListenerMock, times(1)).CleanRemove(anyInt(), any());
}
}

Expand Down Expand Up @@ -85,7 +84,7 @@ void testScaleReverseLogic_BarrierSource() {

// Assertions
// Verify that CleanRemove() method of BarrierListener is called once
verify(barrierListenerMock, times(1)).CleanRemove(anyInt(), any(Iterator.class));
verify(barrierListenerMock, times(1)).CleanRemove(anyInt(), any());
}
}

Expand Down Expand Up @@ -118,7 +117,7 @@ void testScaleReverseLogic_BedrockSource() {

// Assertions
// Verify that CleanRemove() method of BedrockListener is called once
verify(bedrockListenerMock, times(1)).CleanRemove(anyInt(), any(Iterator.class));
verify(bedrockListenerMock, times(1)).CleanRemove(anyInt(), any());
}
}

Expand Down Expand Up @@ -151,7 +150,7 @@ void testScaleReverseLogic_WauhSource() {

// Assertions
// Verify that CleanRemove() method of WauhBucketListener is called once
verify(waterBucketListenerMock, times(1)).CleanRemove(anyInt(), any(Iterator.class));
verify(waterBucketListenerMock, times(1)).CleanRemove(anyInt(), any());
}
}
}

0 comments on commit 0275b7d

Please sign in to comment.