@Test @RunWithCustomExecutor public void whenCheckDistributionComputedInheritedRulesDefaultThresholdOnSelectQueryThenReturnKO() throws Exception { HandlerIO handlerIO = mock(HandlerIO.class); MetaDataClient metaDataClient = mock(MetaDataClient.class); given(metaDataClientFactory.getClient()).willReturn(metaDataClient); VitamThreadUtils.getVitamSession().setTenantId(TENANT_ID); given(handlerIO.getInput(0)).willReturn("SELECT"); given(handlerIO.getInput(1)).willReturn("query.json"); JsonNode queryUnit = JsonHandler.getFromInputStream( getClass().getResourceAsStream("/computeInheritedRules/select_with_default_threshold.json")); given(handlerIO.getJsonFromWorkspace("query.json")).willReturn(queryUnit); given(metaDataClient.selectUnits(any())).willReturn( JsonHandler.getFromInputStream( getClass().getResourceAsStream("/computeInheritedRules/result_metadata_exeed_threshold.json"))); ItemStatus itemStatus = checkDistributionThresholdBase.execute(WorkerParametersFactory.newWorkerParameters(), handlerIO); assertThat(itemStatus).isNotNull(); assertThat(itemStatus.getData().toString()).isEqualTo("{eventDetailData={\"error\":\"Too many units found. Threshold=100000000, found=100000002\"}}"); assertThat(itemStatus.getGlobalStatus()).isEqualTo(StatusCode.KO); }
@Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { return checkThreshold(handler, VitamConfiguration.getComputedInheritedRulesThreshold(), COMPUTED_INHERITED_RULES_CHECK_DISTRIBUTION_THRESHOLD); }
ComputedInheritedRulesCheckDistributionThreshold extends CheckDistributionThresholdBase { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { return checkThreshold(handler, VitamConfiguration.getComputedInheritedRulesThreshold(), COMPUTED_INHERITED_RULES_CHECK_DISTRIBUTION_THRESHOLD); } }
ComputedInheritedRulesCheckDistributionThreshold extends CheckDistributionThresholdBase { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { return checkThreshold(handler, VitamConfiguration.getComputedInheritedRulesThreshold(), COMPUTED_INHERITED_RULES_CHECK_DISTRIBUTION_THRESHOLD); } ComputedInheritedRulesCheckDistributionThreshold();  ComputedInheritedRulesCheckDistributionThreshold(
        MetaDataClientFactory metaDataClientFactory); }
ComputedInheritedRulesCheckDistributionThreshold extends CheckDistributionThresholdBase { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { return checkThreshold(handler, VitamConfiguration.getComputedInheritedRulesThreshold(), COMPUTED_INHERITED_RULES_CHECK_DISTRIBUTION_THRESHOLD); } ComputedInheritedRulesCheckDistributionThreshold();  ComputedInheritedRulesCheckDistributionThreshold(
        MetaDataClientFactory metaDataClientFactory); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); static String getId(); }
ComputedInheritedRulesCheckDistributionThreshold extends CheckDistributionThresholdBase { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { return checkThreshold(handler, VitamConfiguration.getComputedInheritedRulesThreshold(), COMPUTED_INHERITED_RULES_CHECK_DISTRIBUTION_THRESHOLD); } ComputedInheritedRulesCheckDistributionThreshold();  ComputedInheritedRulesCheckDistributionThreshold(
        MetaDataClientFactory metaDataClientFactory); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); static String getId();  }