Skip to content

Instantly share code, notes, and snippets.

@coderunner
Created September 20, 2011 00:25
Show Gist options
  • Select an option

  • Save coderunner/1227989 to your computer and use it in GitHub Desktop.

Select an option

Save coderunner/1227989 to your computer and use it in GitHub Desktop.
stateless test
@Test
public void shouldStoreReverseInContext()
{
when(headers.get(TRANSFORM_HEADER)).thenReturn("REVERSE");
transformer.processRequest(request, context);
verify(context).setAttribute(TRANSFORM_HEADER,
Transform.REVERSE);
}
@Test
public void shouldReverse()
{
when(context.getAttribute(TRANSFORM_HEADER)).thenReturn(Transform.REVERSE);
transformer.processResponse(response, context);
verify(response).setBody(new StringBuffer(BODY).reverse().toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment