From 7c409bfe632f8dcf5f276cfcbc62672f83599dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Thea?= Date: Thu, 11 Aug 2022 13:52:55 -0300 Subject: [PATCH] Log merged attributes in Impression Logger (#407) --- .../validators/TreatmentManagerImpl.java | 10 +++---- .../events/EventsManagerCoordinatorTest.java | 29 ------------------- 2 files changed, 5 insertions(+), 34 deletions(-) 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;