Skip to content

Commit

Permalink
add telemetry base values getters
Browse files Browse the repository at this point in the history
  • Loading branch information
lbalmaceda committed Dec 28, 2016
1 parent f9195a1 commit 90d2838
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
12 changes: 12 additions & 0 deletions auth0/src/main/java/com/auth0/android/util/Telemetry.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> values = new HashMap<>();
if (name != null) {
Expand Down
17 changes: 16 additions & 1 deletion auth0/src/test/java/com/auth0/android/util/TelemetryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"));
}
}

0 comments on commit 90d2838

Please sign in to comment.