ShardingService { public boolean isNeedSharding() { return jobNodeStorage.isJobNodeExisted(ShardingNode.NECESSARY); } ShardingService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); void setReshardingFlag(); boolean isNeedSharding(); void shardingIfNecessary(); List<Integer> getLocalHostShardingItems();  }
@Test public void assertIsNeedSharding() { when(jobNodeStorage.isJobNodeExisted("leader/sharding/necessary")).thenReturn(true); assertTrue(shardingService.isNeedSharding()); verify(jobNodeStorage).isJobNodeExisted("leader/sharding/necessary"); }