@Override
    public void run() throws Exception {
        if (isJCacheAvailable()) {
            ICacheService cacheService = getService();
            for (CacheConfig cacheConfig : configs) {
                cacheService.putCacheConfigIfAbsent(cacheConfig);
            }
        } else {
            // if JCache is not in classpath and no Cache configurations need to be processed, do not fail the operation
            // instead log a warning that if JCache API will be used then it will fail.
            if (configs.isEmpty()) {
                getLogger().warning("This member is joining a cluster whose members support JCache, however the cache-api "
                        + "artifact is missing from this member's classpath. In case JCache API will be used, add cache-api "
                        + "artifact in this member's classpath and restart the member.");
            } else {
                // JCache is already in use by other cluster members, so log an informative message to resolve the issue and
                // throw the CacheService not found exception.
                getLogger().severe("This member cannot support JCache because the cache-api artifact is missing from "
                        + "its classpath. Add the JCache API JAR in the classpath and restart the member.");
                throw new HazelcastException("Service with name '" + SERVICE_NAME + "' not found!",
                        new ServiceNotFoundException("Service with name '" + SERVICE_NAME + "' not found!"));
            }
        }
    }
@Test
    public void test_cachePostJoinOperationSucceeds_whenJCacheAvailable_noWarningIsLogged() throws Exception {
        // node engine returns mock CacheService
        when(nodeEngine.getService(CacheService.SERVICE_NAME)).thenReturn(mock(ICacheService.class));

        // JCacheDetector finds JCache in classpath
        OnJoinCacheOperation onJoinCacheOperation = createTestOnJoinCacheOperation(true);
        onJoinCacheOperation.setNodeEngine(nodeEngine);

        onJoinCacheOperation.run();

        verify(nodeEngine).getService(CacheService.SERVICE_NAME);
        verifyNoMoreInteractions(nodeEngine);
        // verify logger was not invoked
        verify(logger, never()).warning(anyString());
    }