From 7231e846da2a7e8a00c01129bb6a030f56ccb2e9 Mon Sep 17 00:00:00 2001 From: Luciano Balmaceda Date: Wed, 28 Dec 2016 14:24:47 -0300 Subject: [PATCH] add telemetry base values getters --- .../java/com/auth0/android/util/Telemetry.java | 12 ++++++++++++ .../com/auth0/android/util/TelemetryTest.java | 17 ++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/auth0/src/main/java/com/auth0/android/util/Telemetry.java b/auth0/src/main/java/com/auth0/android/util/Telemetry.java index db8447554..003746f9a 100755 --- a/auth0/src/main/java/com/auth0/android/util/Telemetry.java +++ b/auth0/src/main/java/com/auth0/android/util/Telemetry.java @@ -26,6 +26,18 @@ public Telemetry(String name, String version, String libraryVersion) { this.libraryVersion = libraryVersion; } + public String getName() { + return name; + } + + public String getVersion() { + return version; + } + + public String getLibraryVersion() { + return libraryVersion; + } + public String getValue() { Map values = new HashMap<>(); if (name != null) { diff --git a/auth0/src/test/java/com/auth0/android/util/TelemetryTest.java b/auth0/src/test/java/com/auth0/android/util/TelemetryTest.java index 49fa00140..e18b8f27f 100755 --- a/auth0/src/test/java/com/auth0/android/util/TelemetryTest.java +++ b/auth0/src/test/java/com/auth0/android/util/TelemetryTest.java @@ -14,7 +14,7 @@ public class TelemetryTest { @Before public void setUp() throws Exception { - telemetry = new Telemetry("auth0-java", "1.0.0"); + telemetry = new Telemetry("auth0-java", "1.0.0", "1.2.3"); } @Test @@ -27,4 +27,19 @@ public void shouldReturnNullWhenNoInfoIsProvided() throws Exception { telemetry = new Telemetry(null, null); assertThat(telemetry.getValue(), is(nullValue())); } + + @Test + public void shouldGetName() throws Exception { + assertThat(telemetry.getName(), is("auth0-java")); + } + + @Test + public void shouldGetVersion() throws Exception { + assertThat(telemetry.getVersion(), is("1.0.0")); + } + + @Test + public void shouldGetLibraryVersion() throws Exception { + assertThat(telemetry.getLibraryVersion(), is("1.2.3")); + } } \ No newline at end of file