DitoTracker implements TrackerAdapter { @Override public void setUserProperty(String key, Object value) { switch (key) { case USER_PROPERTY_ID: this.userId = value.toString(); default: this.userProperties.put(key, value); } } DitoTracker(Map<String, Object> userProperties); @Override void logPageView(String name); @Override void logEvent(final Map<String, Object> eventData); @Override void setUserProperty(String key, Object value); @Override void logException(Throwable e);  }
@Test public void setUserProperty() throws Exception { this.subject.setUserProperty(Constants.USER_PROPERTY_ID, "123"); this.subject.setUserProperty("custom", "a value"); assertEquals("a value", this.userProperties.get("custom")); assertEquals("123", this.userProperties.get(Constants.USER_PROPERTY_ID)); }