Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f8c0cf3
feat(tracker): scaffold module, move event queue classes, add interfa…
gthea Apr 20, 2026
cf8cca7
ci: run tests on all branches and all JDK versions
gthea Apr 21, 2026
c65dbb9
Semver fix
gthea Apr 21, 2026
f788179
Revert ci
gthea Apr 21, 2026
913fb2f
Add baseline CI run
gthea Apr 21, 2026
a5e16ec
Fixes
gthea Apr 21, 2026
448475f
Fix segments and parsing commons mockito version
gthea Apr 21, 2026
1d9e2fb
Upgrade Mockito to 4.11.0 for Java 8/11 compatibility in commons modules
gthea Apr 21, 2026
9eb8a43
Add PowerMock to all submodules for mocking final classes
gthea Apr 21, 2026
53f4f3d
Remove PowerMock from Mockito 4.11.0 modules
gthea Apr 21, 2026
3c9b6f4
Standardize all modules on Mockito 1.10.19 with PowerMock 1.7.4
gthea Apr 21, 2026
1881107
Fix EvaluatorTest by using real CombiningMatcher instead of mock
gthea Apr 21, 2026
8d701fb
Fix null threadFactory in EventsTask when not configured
gthea Apr 21, 2026
eceef45
Replace Mockito.anyObject() with Mockito.any() in EvaluatorTest
gthea Apr 21, 2026
07f96dc
Remove Mockito stubs for condition.matcher().match() in EvaluatorTest
gthea Apr 21, 2026
1afe510
Remove two problematic EvaluatorTest test methods
gthea Apr 21, 2026
24caef5
Revert "Remove two problematic EvaluatorTest test methods"
gthea Apr 21, 2026
4b5dde9
Fix evaluateFallbackTreatmentWorks test by removing problematic stubs
gthea Apr 21, 2026
0b19b54
Fix Prerequisites comparison in SplitManagerImplTest
gthea Apr 21, 2026
7efd093
Add assertions to sendEventsDoesNotThrowWhenQueueIsFull test
gthea Apr 21, 2026
257fe7f
Add tests for TelemetryEventQueueStats and Event.equals(), add no-op …
gthea Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches:
- master
- development
- '*_baseline'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
Expand Down
5 changes: 5 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@
</properties>

<dependencies>
<dependency>
<groupId>io.split.client</groupId>
<artifactId>tracker</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.split.client</groupId>
<artifactId>targeting-engine</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import io.split.client.events.EventsTask;
import io.split.client.events.InMemoryEventsStorage;
import io.split.client.events.NoopEventsStorageImp;
import io.split.client.events.EventQueueStats;
import io.split.client.events.TelemetryEventQueueStats;
import io.split.client.impressions.AsynchronousImpressionListener;
import io.split.client.impressions.HttpImpressionsSender;
import io.split.client.impressions.ImpressionCounter;
Expand Down Expand Up @@ -135,7 +137,7 @@
import io.split.client.utils.SplitExecutorFactory;
import static io.split.client.utils.SplitExecutorFactory.buildExecutorService;

public class SplitFactoryImpl implements SplitFactory {

Check warning on line 140 in client/src/main/java/io/split/client/SplitFactoryImpl.java

View check run for this annotation

SonarQube Pull Requests / SonarQube Code Analysis

Split this “Monster Class” into smaller and more specialized ones to reduce its dependencies on other classes from 30 to the maximum authorized 20 or less.

[S6539] Classes should not depend on an excessive number of classes (aka Monster Class) See more on https://sonar.harness.io/project/issues?id=io.split.client%3Ajava-client-parent&pullRequest=624&issues=2f22ea05-bc0e-4f3e-830c-83ef6784c307&open=2f22ea05-bc0e-4f3e-830c-83ef6784c307
private static final org.slf4j.Logger _log = LoggerFactory.getLogger(SplitFactoryImpl.class);
private static final String LEGACY_LOG_MESSAGE = "The sdk initialize in localhost mode using Legacy file. The splitFile or "
+
Expand Down Expand Up @@ -254,7 +256,8 @@
_impressionsManager = buildImpressionsManager(config, impressionsStorage, impressionsStorage);

// EventClient
EventsStorage eventsStorage = new InMemoryEventsStorage(config.eventsQueueSize(), _telemetryStorageProducer);
EventQueueStats eventsQueueStats = new TelemetryEventQueueStats(_telemetryStorageProducer);
EventsStorage eventsStorage = new InMemoryEventsStorage(config.eventsQueueSize(), eventsQueueStats);
EventsSender eventsSender = EventsSender.create(_splitHttpClient, _eventsRootTarget, _telemetryStorageProducer);
_eventsTask = EventsTask.create(config.eventSendIntervalInMillis(), eventsStorage, eventsSender,
config.getThreadFactory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import static com.google.common.base.Preconditions.checkNotNull;

public class EventsSender {
public class EventsSender implements io.split.client.events.EventSender {

private static final String BULK_ENDPOINT_PATH = "api/events/bulk";
private final URI _bulkEndpoint;
Expand All @@ -34,10 +34,15 @@
_httpPostImp = new HttpPostImp(_client, telemetryRuntimeProducer);
}

public void sendEvents(List<Event> _data) {
@Override
public void send(List<Event> _data) {

Check warning on line 38 in client/src/main/java/io/split/client/events/EventsSender.java

View check run for this annotation

SonarQube Pull Requests / SonarQube Code Analysis

Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

[S117] Local variable and method parameter names should comply with a naming convention See more on https://sonar.harness.io/project/issues?id=io.split.client%3Ajava-client-parent&pullRequest=624&issues=9dddeefd-c120-4dd1-9fac-3938a61a78b9&open=9dddeefd-c120-4dd1-9fac-3938a61a78b9
_httpPostImp.post(_bulkEndpoint, _data, "Events ", HttpParamsWrapper.EVENTS);
}

public void sendEvents(List<Event> _data) {

Check warning on line 42 in client/src/main/java/io/split/client/events/EventsSender.java

View check run for this annotation

SonarQube Pull Requests / SonarQube Code Analysis

Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

[S117] Local variable and method parameter names should comply with a naming convention See more on https://sonar.harness.io/project/issues?id=io.split.client%3Ajava-client-parent&pullRequest=624&issues=044d77dc-48dd-4598-8df8-11b0eadba7ae&open=044d77dc-48dd-4598-8df8-11b0eadba7ae
send(_data);
}

@VisibleForTesting
URI getBulkEndpoint() {
return _bulkEndpoint;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.split.client.events;

import io.split.telemetry.domain.enums.EventsDataRecordsEnum;
import io.split.telemetry.storage.TelemetryRuntimeProducer;

import java.util.Objects;

public class TelemetryEventQueueStats implements EventQueueStats {

private final TelemetryRuntimeProducer _telemetryRuntimeProducer;

Check warning on line 10 in client/src/main/java/io/split/client/events/TelemetryEventQueueStats.java

View check run for this annotation

SonarQube Pull Requests / SonarQube Code Analysis

Rename this field "_telemetryRuntimeProducer" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

[S116] Field names should comply with a naming convention See more on https://sonar.harness.io/project/issues?id=io.split.client%3Ajava-client-parent&pullRequest=624&issues=17ee5f3d-9d8f-48b5-83cc-d93fb3f75e3a&open=17ee5f3d-9d8f-48b5-83cc-d93fb3f75e3a

public TelemetryEventQueueStats(TelemetryRuntimeProducer telemetryRuntimeProducer) {
_telemetryRuntimeProducer = Objects.requireNonNull(telemetryRuntimeProducer);
}

@Override
public void onQueued(long count) {
_telemetryRuntimeProducer.recordEventStats(EventsDataRecordsEnum.EVENTS_QUEUED, count);
}

@Override
public void onDropped(long count) {
_telemetryRuntimeProducer.recordEventStats(EventsDataRecordsEnum.EVENTS_DROPPED, count);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ public void splitCallWithExistentSplit() {
Assert.assertEquals("off", theOne.treatments.get(0));
Assert.assertEquals(0, theOne.configs.size());
Assert.assertEquals("off", theOne.defaultTreatment);
Assert.assertEquals(Lists.newArrayList(prereq), theOne.prerequisites);
Assert.assertEquals(1, theOne.prerequisites.size());
Assert.assertEquals(prereq.featureFlagName, theOne.prerequisites.get(0).featureFlagName);
Assert.assertEquals(prereq.treatments, theOne.prerequisites.get(0).treatments);
}

@Test
Expand Down
102 changes: 0 additions & 102 deletions client/src/test/java/io/split/client/events/EventsTaskTest.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package io.split.client.events;

import io.split.telemetry.domain.enums.EventsDataRecordsEnum;
import io.split.telemetry.storage.TelemetryRuntimeProducer;
import org.junit.Test;
import org.mockito.Mockito;

import static org.mockito.Mockito.verify;

public class TelemetryEventQueueStatsTest {

@Test
public void onQueuedRecordsEventStats() {
TelemetryRuntimeProducer telemetryRuntimeProducer = Mockito.mock(TelemetryRuntimeProducer.class);
TelemetryEventQueueStats stats = new TelemetryEventQueueStats(telemetryRuntimeProducer);

stats.onQueued(42);

verify(telemetryRuntimeProducer).recordEventStats(EventsDataRecordsEnum.EVENTS_QUEUED, 42);
}

@Test
public void onDroppedRecordsEventStats() {
TelemetryRuntimeProducer telemetryRuntimeProducer = Mockito.mock(TelemetryRuntimeProducer.class);
TelemetryEventQueueStats stats = new TelemetryEventQueueStats(telemetryRuntimeProducer);

stats.onDropped(10);

verify(telemetryRuntimeProducer).recordEventStats(EventsDataRecordsEnum.EVENTS_DROPPED, 10);
}

}
Loading
Loading