@Test
public void testReducedPropagationQueueingStrategy(){

    // valid ReducedPropagationQueueingStrategy config
    QueueingStrategy queueingStrategy = QueueingStrategyFactory.buildQueueStrategy(
            buildHookConfig(new JsonObject().put("type", "reducedPropagation").put("intervalMs", 22)));
    assertThat(queueingStrategy, instanceOf(ReducedPropagationQueueingStrategy.class));
    assertEquals(22, ((ReducedPropagationQueueingStrategy)queueingStrategy).getPropagationIntervalMs());
    queueingStrategy = QueueingStrategyFactory.buildQueueStrategy(
            buildHookConfig(new JsonObject().put("type", "reducedpropagation").put("intervalMs", 888)));
    assertThat(queueingStrategy, instanceOf(ReducedPropagationQueueingStrategy.class));
    assertEquals(888, ((ReducedPropagationQueueingStrategy)queueingStrategy).getPropagationIntervalMs());
    queueingStrategy = QueueingStrategyFactory.buildQueueStrategy(
            buildHookConfig(new JsonObject().put("type", "REDUCEDPROPAGATION").put("intervalMs", 999)));
    assertThat(queueingStrategy, instanceOf(ReducedPropagationQueueingStrategy.class));
    assertEquals(999, ((ReducedPropagationQueueingStrategy)queueingStrategy).getPropagationIntervalMs());
    queueingStrategy = QueueingStrategyFactory.buildQueueStrategy(
            buildHookConfig(new JsonObject().put("type", "REDUCEDPROPAGATION").put("intervalMs", 999999999999999999L)));
    assertThat(queueingStrategy, instanceOf(ReducedPropagationQueueingStrategy.class));
    assertEquals(999999999999999999L, ((ReducedPropagationQueueingStrategy)queueingStrategy).getPropagationIntervalMs());
    // invalid ReducedPropagationQueueingStrategy config
    assertThat(QueueingStrategyFactory.buildQueueStrategy(buildHookConfig(new JsonObject().put("type", "reducedPropagation"))),
            instanceOf(DefaultQueueingStrategy.class));
    assertThat(QueueingStrategyFactory.buildQueueStrategy(buildHookConfig(new JsonObject().put("typeXX", "reducedPropagation").put("intervalMs", 123))),
            instanceOf(DefaultQueueingStrategy.class));
    assertThat(QueueingStrategyFactory.buildQueueStrategy(buildHookConfig(new JsonObject().put("type", "reducedPropagation").put("intervalMs", "234"))),
            instanceOf(DefaultQueueingStrategy.class));
    assertThat(QueueingStrategyFactory.buildQueueStrategy(buildHookConfig(new JsonObject().put("type", "reducedPropagation").put("intervalXX", 234))),
            instanceOf(DefaultQueueingStrategy.class));
    assertThat(QueueingStrategyFactory.buildQueueStrategy(buildHookConfig(new JsonObject().put("type", "reducedPropagation").put("intervalMs", new JsonObject()))),
            instanceOf(DefaultQueueingStrategy.class));
}