### Question:
ScriptingService extends AbstractService { public GroovyResponse runScript(GroovyScript script) { checkArgumentNotNull(script, "Script cannot be null"); return client().postForObject(SEGMENT_SCRIPT_TEXT, script, GroovyResponse.class); } ScriptingService();  ScriptingService(JenkinsClient client); GroovyResponse runScript(GroovyScript script);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void runScript_WithNullScript_ThrowsException() throws Exception { service.runScript(null); }
@Test public void runScript() throws Exception { GroovyScript script = new StringGroovyScript("print 'hello'"); when(client.postForObject("/scriptText", script, GroovyResponse.class)).thenReturn(response); assertEquals(response, service.runScript(script)); }