diff --git a/src/main/java/io/split/android/client/validators/TreatmentManagerImpl.java b/src/main/java/io/split/android/client/validators/TreatmentManagerImpl.java index 31ff15c8d..8cc4b55b4 100644 --- a/src/main/java/io/split/android/client/validators/TreatmentManagerImpl.java +++ b/src/main/java/io/split/android/client/validators/TreatmentManagerImpl.java @@ -169,7 +169,6 @@ private SplitResult getTreatmentWithConfigWithoutMetrics(String split, Map mergedAttributes = mAttributesMerger.merge(mAttributesManager.getAllAttributes(), attributes); + EvaluationResult evaluationResult = evaluateIfReady(splitName, mergedAttributes, validationTag); SplitResult splitResult = new SplitResult(evaluationResult.getTreatment(), evaluationResult.getConfigurations()); if (evaluationResult.getLabel().equals(TreatmentLabels.DEFINITION_NOT_FOUND)) { @@ -196,7 +196,7 @@ private SplitResult getTreatmentWithConfigWithoutMetrics(String split, Map getTreatmentsWithConfigWithoutMetrics(List mergedAttributes = mAttributesMerger.merge(mAttributesManager.getAllAttributes(), attributes); + final Map mergedAttributes = mAttributesMerger.merge(mAttributesManager.getAllAttributes(), attributes); for (String split : splits) { errorInfo = mSplitValidator.validateName(split); if (errorInfo != null) { @@ -243,7 +243,7 @@ private Map getTreatmentsWithConfigWithoutMetrics(List mEventsManager.registerEventsManager(new Key("first", "bucketing"), firstEventsManager)); - Thread thread1 = new Thread(() -> mEventsManager.registerEventsManager(new Key("second", "bucketing"), secondEventsManager)); - - Thread thread4 = new Thread(() -> mEventsManager.notifyInternalEvent(SplitInternalEvent.SPLITS_FETCHED)); - Thread thread5 = new Thread(this::delay); - - thread0.start(); - thread1.start(); - thread4.start(); - thread5.start(); - - try { - thread0.join(); - thread1.join(); - thread4.join(); - thread5.join(); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - verify(firstEventsManager, times(1)).notifyInternalEvent(SplitInternalEvent.SPLITS_FETCHED); - verify(secondEventsManager, times(1)).notifyInternalEvent(SplitInternalEvent.SPLITS_FETCHED); - } - private void delay() { boolean shouldStop = false; long maxExecutionTime = System.currentTimeMillis() + 1000;