@Test public void noHttpData() { doReturn(new TimerData()).when(invocationSequenceData).getTimerData(); String[] values = valueSource.getStringValues(invocationSequenceData, cachedDataService); assertThat(values, is(notNullValue())); assertThat(values.length, is(equalTo(0))); } }
return new HttpSchemeValueSource(); case HTTP_SERVER_NAME: return new HttpServerNameValueSource(); case HTTP_SERVER_PORT: return new HttpServerPortValueSource();
break; case HTTP_SERVER_NAME: expression.setStringValueSource(new HttpServerNameValueSource()); break; case HTTP_SERVER_PORT:
@Test public void retrieveServerName() { HttpInfo httpInfo = new HttpInfo(); httpInfo.setServerName("localhost"); doReturn(httpTimerData).when(invocationSequenceData).getTimerData(); doReturn(httpInfo).when(httpTimerData).getHttpInfo(); String[] values = valueSource.getStringValues(invocationSequenceData, cachedDataService); assertThat(values, hasItemInArray("localhost")); }