Add tests
This commit is contained in:
parent
d006a8e6d0
commit
a87323fa08
|
@ -92,6 +92,12 @@
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-web</artifactId>
|
<artifactId>spring-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<reporting>
|
<reporting>
|
||||||
|
|
|
@ -32,6 +32,8 @@ import org.apache.commons.lang3.Validate;
|
||||||
/**
|
/**
|
||||||
* This interceptor adds an arbitrary header to requests made by this client. Both the
|
* This interceptor adds an arbitrary header to requests made by this client. Both the
|
||||||
* header name and the header value are specified by the calling code.
|
* header name and the header value are specified by the calling code.
|
||||||
|
*
|
||||||
|
* @see AdditionalRequestHeadersInterceptor for a more advanced version of this interceptor which can add multiple headers
|
||||||
*/
|
*/
|
||||||
public class SimpleRequestHeaderInterceptor implements IClientInterceptor {
|
public class SimpleRequestHeaderInterceptor implements IClientInterceptor {
|
||||||
|
|
||||||
|
|
|
@ -3149,16 +3149,18 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
|
||||||
.count(1)
|
.count(1)
|
||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
ourLog.info("** Done searching with count of 1");
|
ourLog.info("** Done searching in {}ms with count of 1", sw.getMillis());
|
||||||
|
|
||||||
ourLog.info(myCapturingInterceptor.getLastResponse().getAllHeaders().toString());
|
ourLog.info(myCapturingInterceptor.getLastResponse().getAllHeaders().toString());
|
||||||
assertThat(myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE), Matchers.<String>empty());
|
assertThat(myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE), Matchers.<String>empty());
|
||||||
assertThat(myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE.toLowerCase()),Matchers.<String>empty());
|
assertThat(myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE.toLowerCase()),Matchers.<String>empty());
|
||||||
|
|
||||||
|
String msg = "Total is " + found.getTotalElement().getValue() + " and took " + sw.getMillis() + " millis";
|
||||||
|
|
||||||
// If this fails under load, try increasing the throttle above
|
// If this fails under load, try increasing the throttle above
|
||||||
assertEquals(null, found.getTotalElement().getValue());
|
assertEquals(msg,null, found.getTotalElement().getValue());
|
||||||
assertEquals(1, found.getEntry().size());
|
assertEquals(msg, 1, found.getEntry().size());
|
||||||
assertThat(sw.getMillis(), lessThan(1000L));
|
assertThat(msg, sw.getMillis(), lessThan(1000L));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue