### Question:
JenkinsClient { public JenkinsClient setUserAgent(String identifier) { checkArgumentNotNull(identifier, "Identifier cannot be null"); getClientHttpRequestFactory().setUserAgent(identifier); return this; } JenkinsClient();  JenkinsClient(String host, Integer port);  JenkinsClient(String scheme, String host, Integer port, String prefix); T getForObject(String uri, Class<T> responseType); URI postForLocation(String uri, Object request); T postForObject(String uri, Object request, Class<T> responseType); JenkinsClient setCredentials(String user, String password); JenkinsClient setUserAgent(String identifier); ClientHttpRequestFactory getClientHttpRequestFactory(); void setClientHttpRequestFactory(ClientHttpRequestFactory clientHttpRequestFactory); ResponseErrorHandler getResponseErrorHandler(); JenkinsClient setResponseErrorHandler(ResponseErrorHandler responseErrorHandler); List<HttpMessageConverter<?>> getMessageConverters(); void setMessageConverters(List<HttpMessageConverter<?>> messageConverters); static final String DEFAULT_URL_HOST; static final int DEFAULT_URL_PORT; static final String SEGMENT_JOB; static final String SEGMENT_CREATE_ITEM; static final String SEGMENT_DO_DELETE; static final String SEGMENT_API_XML; static final String SEGMENT_CONFIG_XML; static final String SEGMENT_SCRIPT_TEXT; static final String DEFAULT_USER_AGENT; }### Answer:
@Test(expected = IllegalArgumentException.class) public void setUserAgent_WithNullIdentifier_ThrowsException() throws Exception { client.setUserAgent(null); }
@Test public void setUserAgent() throws Exception { client.setUserAgent("JenkinsJavaAPI"); verify(httpRequestFactory).setUserAgent("JenkinsJavaAPI"); }