DatasetAffinityFunctionWrapper implements AffinityFunction { @Override public List<List<ClusterNode>> assignPartitions(AffinityFunctionContext affCtx) { return delegate.assignPartitions(affCtx); } DatasetAffinityFunctionWrapper(AffinityFunction delegate); @Override void reset(); @Override int partitions(); @Override int partition(Object key); @Override List<List<ClusterNode>> assignPartitions(AffinityFunctionContext affCtx); @Override void removeNode(UUID nodeId);  }
@Test public void testAssignPartitions() { List<List<ClusterNode>> nodes = Collections.singletonList(Collections.singletonList(mock(ClusterNode.class))); doReturn(nodes).when(affinityFunction).assignPartitions(any()); List<List<ClusterNode>> resNodes = wrapper.assignPartitions(mock(AffinityFunctionContext.class)); assertEquals(nodes, resNodes); verify(affinityFunction, times(1)).assignPartitions(any()); }