private void cleanOnUpgrade() { // we assume that pending tasks are not compatible with the new version // and can't be processed LOGGER.info("Cancel all pending tasks (due to upgrade)"); queue.clear(); }
@Test public void start_clears_queue_if_version_upgrade() { when(serverUpgradeStatus.isUpgraded()).thenReturn(true); runCleaner(); verify(queue).clear(); }
@Test public void start_does_not_clear_queue_if_version_upgrade_but_blue_green_deployment() { when(serverUpgradeStatus.isUpgraded()).thenReturn(true); settings.setProperty(ProcessProperties.Property.BLUE_GREEN_ENABLED.getKey(), true); runCleaner(); verify(queue, never()).clear(); }
private void cleanOnUpgrade() { // we assume that pending tasks are not compatible with the new version // and can't be processed LOGGER.info("Cancel all pending tasks (due to upgrade)"); queue.clear(); }