@Test
public void testAffinityCallWithRetriesNegative() {

    ClusterNode node1 = grid(1).cluster().localNode();
    ClusterNode node2 = grid(2).cluster().localNode();
    String firstCacheName = "CACHE_1_" + UUID.randomUUID();
    String secondCacheName = "CACHE_2_" + UUID.randomUUID();
    CacheConfiguration<Integer, Integer> cacheConfiguration1 = new CacheConfiguration<>();
    cacheConfiguration1.setName(firstCacheName);
    cacheConfiguration1.setAffinity(new TestAffinityFunction(node1));
    IgniteCache<Integer, Integer> cache1 = ignite.createCache(cacheConfiguration1);
    CacheConfiguration<Integer, Integer> cacheConfiguration2 = new CacheConfiguration<>();
    cacheConfiguration2.setName(secondCacheName);
    cacheConfiguration2.setAffinity(new TestAffinityFunction(node2));
    IgniteCache<Integer, Integer> cache2 = ignite.createCache(cacheConfiguration2);
    try {
        try {
            ComputeUtils.affinityCallWithRetries(
                ignite,
                Arrays.asList(firstCacheName, secondCacheName),
                part -> part,
                0,
                DeployingContext.unitialized()
            );
        }
        catch (IllegalStateException expectedException) {
            return;
        }
        fail("Missing IllegalStateException");
    }
    finally {
        cache1.destroy();
        cache2.destroy();
    }
}