@Test
public void testWriteTagContentTagWriter01() {

    // setup arguments
    TransactionTokenTag tag = new TransactionTokenTag();
    PageContext pageContext = mock(PageContext.class);
    tag.setPageContext(pageContext);
    HttpServletRequest request = mock(HttpServletRequest.class);
    StringWriter sw = new StringWriter();
    TagWriter tagWriter = new TagWriter(sw);
    // mock behavior
    when((HttpServletRequest) pageContext.getRequest()).thenReturn(request);
    when((TransactionToken) request.getAttribute(
            TransactionTokenInterceptor.NEXT_TOKEN_REQUEST_ATTRIBUTE_NAME))
                    .thenReturn(null);
    // run
    int result = 1;
    try {
        result = tag.writeTagContent(tagWriter);
    } catch (JspException e) {
        fail();
    }
    // assert
    assertThat(sw.getBuffer().toString(), is(""));
    assertThat(result, is(0));
}