public static PeriodicCacheReloadTrigger fromConfig(ReadableConfig config) {
        checkArgument(
                config.get(CACHE_TYPE) == FULL,
                "'%s' should be '%s' in order to build a Periodic cache reload trigger.",
                CACHE_TYPE.key(),
                FULL);
        checkArgument(
                config.get(FULL_CACHE_RELOAD_STRATEGY) == PERIODIC,
                "'%s' should be '%s' in order to build a Periodic cache reload trigger.",
                FULL_CACHE_RELOAD_STRATEGY.key(),
                PERIODIC);
        checkArgument(
                config.getOptional(FULL_CACHE_PERIODIC_RELOAD_INTERVAL).isPresent(),
                "Missing '%s' in the configuration. This option is required to build Periodic cache reload trigger.",
                FULL_CACHE_PERIODIC_RELOAD_INTERVAL.key());
        return new PeriodicCacheReloadTrigger(
                config.get(FULL_CACHE_PERIODIC_RELOAD_INTERVAL),
                config.get(FULL_CACHE_PERIODIC_RELOAD_SCHEDULE_MODE));
    }
@Test
    void testCreateFromConfig() {
        assertThat(PeriodicCacheReloadTrigger.fromConfig(createValidConf())).isNotNull();
        Configuration conf1 = createValidConf().set(CACHE_TYPE, PARTIAL);
        assertThatThrownBy(() -> PeriodicCacheReloadTrigger.fromConfig(conf1))
                .isInstanceOf(IllegalArgumentException.class)
                .hasMessageContaining("should be 'FULL'");
        Configuration conf2 = createValidConf().set(FULL_CACHE_RELOAD_STRATEGY, TIMED);
        assertThatThrownBy(() -> PeriodicCacheReloadTrigger.fromConfig(conf2))
                .isInstanceOf(IllegalArgumentException.class)
                .hasMessageContaining("should be 'PERIODIC'");
        Configuration conf3 = createValidConf();
        conf3.removeConfig(FULL_CACHE_PERIODIC_RELOAD_INTERVAL);
        assertThatThrownBy(() -> PeriodicCacheReloadTrigger.fromConfig(conf3))
                .isInstanceOf(IllegalArgumentException.class)
                .hasMessageContaining(
                        "Missing '" + FULL_CACHE_PERIODIC_RELOAD_INTERVAL.key() + "'");
    }