PropertyConfigurator extends AbstractChannelListener { public void collectDeviceId() { Analytics.getInstance().postCommandEvenIfDisabled(new Runnable() { @Override public void run() { mDeviceIdEnabled = true; } }); } PropertyConfigurator(AnalyticsTransmissionTarget transmissionTarget); @Override void onPreparingLog(@NonNull Log log, @NonNull String groupName); void setAppName(final String appName); void setAppVersion(final String appVersion); void setAppLocale(final String appLocale); void setUserId(final String userId); synchronized void setEventProperty(String key, boolean value); synchronized void setEventProperty(String key, Date value); synchronized void setEventProperty(String key, double value); synchronized void setEventProperty(String key, long value); synchronized void setEventProperty(String key, String value); synchronized void removeEventProperty(String key); void collectDeviceId();  }
@Test public void collectDeviceId() { CommonSchemaLog log = new CommonSchemaEventLog(); log.setExt(new Extensions()); log.getExt().setDevice(new DeviceExtension()); mockStatic(Secure.class); when(Secure.getString(any(ContentResolver.class), anyString())).thenReturn("mockDeviceId"); PropertyConfigurator pc = Analytics.getTransmissionTarget("test").getPropertyConfigurator(); pc.collectDeviceId(); log.addTransmissionTarget("test"); log.setTag(Analytics.getTransmissionTarget("test")); pc.onPreparingLog(log, "groupName"); assertEquals("a:mockDeviceId", log.getExt().getDevice().getLocalId()); }