public void setupProperties(Context context) {
    // legacy properties
    context.putProperty(CoreConstants.DATA_DIR_KEY, getFilesDirectoryPath());
    final String extDir = getMountedExternalStorageDirectoryPath();
    if (extDir != null) {
      context.putProperty(CoreConstants.EXT_DIR_KEY, extDir);
    }
    context.putProperty(CoreConstants.PACKAGE_NAME_KEY, getPackageName());
    context.putProperty(CoreConstants.VERSION_CODE_KEY, getVersionCode());
    context.putProperty(CoreConstants.VERSION_NAME_KEY, getVersionName());
  }
@Test
  public void setupProperties() {
    LoggerContext loggerContext = new LoggerContext();

    assertThat(loggerContext.getProperty(CoreConstants.DATA_DIR_KEY), is(nullValue()));
    assertThat(loggerContext.getProperty(CoreConstants.EXT_DIR_KEY), is(nullValue()));
    assertThat(loggerContext.getProperty(CoreConstants.VERSION_CODE_KEY), is(nullValue()));
    assertThat(loggerContext.getProperty(CoreConstants.VERSION_NAME_KEY), is(nullValue()));
    assertThat(loggerContext.getProperty(CoreConstants.PACKAGE_NAME_KEY), is(nullValue()));

    contextUtil.setupProperties(loggerContext);

    assertThat(loggerContext.getProperty(CoreConstants.DATA_DIR_KEY), is(contextUtil.getFilesDirectoryPath()));
    assertThat(loggerContext.getProperty(CoreConstants.EXT_DIR_KEY), is(contextUtil.getMountedExternalStorageDirectoryPath()));
    assertThat(loggerContext.getProperty(CoreConstants.VERSION_CODE_KEY), is(contextUtil.getVersionCode()));
    assertThat(loggerContext.getProperty(CoreConstants.VERSION_NAME_KEY), is(contextUtil.getVersionName()));
    assertThat(loggerContext.getProperty(CoreConstants.PACKAGE_NAME_KEY), is(contextUtil.getPackageName()));
  }