mhansonp commented on a change in pull request #7124:
URL: https://github.com/apache/geode/pull/7124#discussion_r779962520



##########
File path: 
geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/rebalance/PartitionedRegionLoadModelJUnitTest.java
##########
@@ -902,19 +927,555 @@ public void testMoveBuckets() throws 
UnknownHostException {
         buildDetails(member2, 500, 500, new long[] {0, 0, 0, 0}, new long[] 
{0, 0, 0, 0});
     model.addRegion("a", Arrays.asList(details1, details2), new 
FakeOfflineDetails(), true);
 
-    assertEquals(2, doMoves(new CompositeDirector(false, false, true, true), 
model));
+    assertThat(doMoves(new CompositeDirector(false, false, true, true), 
model)).isEqualTo(2);
 
-    assertEquals(Collections.emptyList(), bucketOperator.creates);
-    assertEquals(Collections.emptyList(), bucketOperator.primaryMoves);
+    assertThat(bucketOperator.creates).isEqualTo(Collections.emptyList());
+    assertThat(bucketOperator.primaryMoves).isEqualTo(Collections.emptyList());
 
     // Two of the buckets should move to member2
     List<Move> expectedMoves = new ArrayList<>();
     expectedMoves.add(new Move(member1, member2));
     expectedMoves.add(new Move(member1, member2));
 
-    assertEquals(expectedMoves, bucketOperator.bucketMoves);
+    assertThat(bucketOperator.bucketMoves).isEqualTo(expectedMoves);
+  }
+
+  @Test
+  public void testRemoveBuckets() throws UnknownHostException {
+
+    InternalDistributedMember member1 =
+        new InternalDistributedMember(InetAddress.getByName("127.0.0.1"), 1);
+    InternalDistributedMember member2 =
+        new InternalDistributedMember(InetAddress.getByName("127.0.0.1"), 2);
+    // Create some imbalanced nodes
+    PartitionMemberInfoImpl details1 =
+        buildDetails(member1, 500, 500, new long[] {1, 1, 1, 1}, new long[] 
{0, 1, 1, 0});
+    PartitionMemberInfoImpl details2 =
+        buildDetails(member2, 500, 500, new long[] {1, 1, 1, 1}, new long[] 
{1, 0, 0, 1});
+
+    PartitionedRegionLoadModel model = new 
PartitionedRegionLoadModel(bucketOperator, 0, 4,
+        getAddressComparor(false), Collections.emptySet(), partitionedRegion);
+    model.addRegion("a", Arrays.asList(details1, details2), new 
FakeOfflineDetails(), true);
+
+    assertThat(4).isEqualTo(doMoves(new CompositeDirector(true, true, true, 
true), model));

Review comment:
       I thought I had gotten them all with a structural replace. Obviously 
not. Thanks.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to