@Test
  public void createScriptAutoCreateNoDefaultFS() {
    Map<String, String> properties = new HashMap<String, String>();
    properties.put("dataworker.storagePath", pigStorageFile.toString());
    properties.put("scripts.dir", "/tmp/.pigscripts");

    expect(context.getProperties()).andReturn(properties).anyTimes();
    expect(context.getUsername()).andReturn("ambari-qa").anyTimes();

    replay(handler, context);
    scriptService = getService(ScriptService.class, handler, context);

    thrown.expect(ServiceFormattedException.class);
    doCreateScript("Test", null);
  }
Tests without HDFS and predefined properties
contrib/views/pig/src/test/java/org/apache/ambari/view/pig/test/ScriptTestUnmanaged.java