final HttpServletResponse response = context.mock(HttpServletResponse.class);
final Map<Object, Object> headers = new HashMap<Object, Object>();
context.checking(new Expectations() {
{
allowing(response).setHeader(with(any(String.class)), with(any(String.class)));
will(new Action(){
public void describeTo(Description desc) {
desc.appendText("Setting header ");
}
public Object invoke(Invocation invocation) throws Throwable {
headers.put(invocation.getParameter(0), invocation.getParameter(1));
return null;
}
});
}
});
String clearMessage = "TestMessage2";
final String message = topologyRequestValidator.encodeMessage(clearMessage);
topologyRequestValidator.trustMessage(response, request, message);
final HttpMethod method = context.mock(HttpMethod.class);
context.checking(new Expectations(){
{
allowing(method).getResponseHeader(with(any(String.class)));
will(new Action() {
public void describeTo(Description desc) {
desc.appendText("Getting header ");
}
public Object invoke(Invocation invocation) throws Throwable {