use of org.pentaho.platform.api.engine.ISystemSettings in project data-access by pentaho.
the class AgileHelperTest method testGetTmpFolderPath.
@Test
public void testGetTmpFolderPath() {
PentahoSystem.setSystemSettingsService(null);
assertNull(AgileHelper.getTmpFolderPath(null));
String sampleProject = AgileHelper.PLUGIN_NAME;
String sampleFolderPath = "/etc/";
ISystemSettings systemSettings = mock(ISystemSettings.class);
when(systemSettings.getSystemSetting(anyString(), anyString(), anyString())).thenReturn(null).thenReturn(sampleFolderPath);
PentahoSystem.setSystemSettingsService(systemSettings);
assertNull(AgileHelper.getTmpFolderPath(sampleProject));
assertTrue((sampleFolderPath + sampleProject).equals(AgileHelper.getTmpFolderPath(sampleProject)));
}
Aggregations