From 0245a5635e618f9cec7264a42490541dbd65aa2c Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray <57103426+arifBurakDemiray@users.noreply.github.com> Date: Fri, 10 Nov 2023 14:30:36 +0300 Subject: [PATCH] [Java] Add new device ID module tests add device ID type to scenario tests (#161) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: new device id change callback * feat: call after onDeviceId * refactor: usage of device id changed in module device id * feat: did changes * feat: add device id type to scenario tests * fix: tests * revert: scenario changes * feat: missing comments * feat: new device id module calls to scenarioo device id tests * feat: missing changelog * fix: update existing tests * fix: add check to callback * refactor: remove unnecessary callback * feat: test ccases * fix: login and logout * refactor: device id module * fix: remove unnecessary params * feat: new tests * fix: rq access index * feat: multiple device id check * fix: test * fix: device id change logic * fix: device id callbacks * fix: module events req * fix: module event check and test cases comments * fix: new ids * fix: added missings tests * feat: buggy test for device id change * refactor: remove unsued * fix: changed index of features * fix: end any view * feat: finish up tests * misc * fix: without merge not started session * fix: add missing test cases --------- Co-authored-by: Artūrs Kadiķis --- CHANGELOG.md | 3 +- .../count/sdk/java/internal/CoreFeature.java | 4 +- .../count/sdk/java/internal/ModuleBase.java | 17 +- .../sdk/java/internal/ModuleDeviceIdCore.java | 55 +- .../count/sdk/java/internal/ModuleEvents.java | 46 +- .../sdk/java/internal/ModuleSessions.java | 17 +- .../ly/count/sdk/java/internal/SDKCore.java | 12 +- .../count/sdk/java/internal/SessionImpl.java | 5 - .../java/internal/ModuleDeviceIdTests.java | 571 +++++++++++++++++- .../internal/ModuleRemoteConfigTests.java | 6 +- .../internal/ScenarioDeviceIdInitTests.java | 18 +- ...enarioRemoteConfigDeviceIdChangeTests.java | 4 +- .../ly/count/sdk/java/internal/TestUtils.java | 41 +- 13 files changed, 688 insertions(+), 111 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efc5dfe90..f1d5a702f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ * 'enableRemoteConfigAutomaticTriggers' to automatically download remote config values on init * 'remoteConfigRegisterGlobalCallback(RCDownloadCallback callback)' to register a remote config callback * Added the ability to set the user profile picture with an URL -* Added to a way to get device id type by calling "Countly::deviceId::getType" via "instance()" call +* Added the DeviceId interface. It is accessible through "Countly::instance()::deviceId()" call. +* Added a way to get device id type by calling "Countly::deviceId::getType" via "instance()" call * The SDK now uses a different file for internal configuration. Old file will be deleted. * Fixed a bug where it was not possible to send a profile picture with binary data diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/CoreFeature.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/CoreFeature.java index e832a112f..c921f3ec1 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/CoreFeature.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/CoreFeature.java @@ -4,8 +4,8 @@ import java.util.Map; public enum CoreFeature { - Sessions(1 << 1, ModuleSessions::new), - Events(1 << 2, ModuleEvents::new), + Events(1 << 1, ModuleEvents::new), + Sessions(1 << 2, ModuleSessions::new), Views(1 << 3, ModuleViews::new), CrashReporting(1 << 4, ModuleCrash::new), Location(1 << 5), diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleBase.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleBase.java index f3a6a58fe..0b676ace4 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleBase.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleBase.java @@ -1,11 +1,9 @@ package ly.count.sdk.java.internal; -import ly.count.sdk.java.Config; import ly.count.sdk.java.Session; /** * Created by artem on 05/01/2017. - * * Contract: *