@Test public void executeSecurity() throws Exception { getInst().execute("String bogus"); Mockito.verify(security).checkPermission(Hudson.ADMINISTER); }
public String execute(final String script) throws Exception { checkNotNull(script); security.checkPermission(Hudson.ADMINISTER); log.debug("Executing script on master: {}", script); return RemotingDiagnostics.executeGroovy(script, MasterComputer.localChannel); }
ScriptServiceImpl extends ServiceSupport implements ScriptService { public String execute(final String script) throws Exception { checkNotNull(script); security.checkPermission(Hudson.ADMINISTER); log.debug("Executing script on master: {}", script); return RemotingDiagnostics.executeGroovy(script, MasterComputer.localChannel); } }
ScriptServiceImpl extends ServiceSupport implements ScriptService { public String execute(final String script) throws Exception { checkNotNull(script); security.checkPermission(Hudson.ADMINISTER); log.debug("Executing script on master: {}", script); return RemotingDiagnostics.executeGroovy(script, MasterComputer.localChannel); } @Inject  ScriptServiceImpl(final SecurityService security); }
ScriptServiceImpl extends ServiceSupport implements ScriptService { public String execute(final String script) throws Exception { checkNotNull(script); security.checkPermission(Hudson.ADMINISTER); log.debug("Executing script on master: {}", script); return RemotingDiagnostics.executeGroovy(script, MasterComputer.localChannel); } @Inject  ScriptServiceImpl(final SecurityService security); String execute(final String script); }
ScriptServiceImpl extends ServiceSupport implements ScriptService { public String execute(final String script) throws Exception { checkNotNull(script); security.checkPermission(Hudson.ADMINISTER); log.debug("Executing script on master: {}", script); return RemotingDiagnostics.executeGroovy(script, MasterComputer.localChannel); } @Inject  ScriptServiceImpl(final SecurityService security); String execute(final String script);  }