@Test
public void testWriteTagContentTagWriter03() {

    // setup arguments
    TransactionTokenTag tag = new TransactionTokenTag();
    PageContext pageContext = mock(PageContext.class);
    tag.setPageContext(pageContext);
    HttpServletRequest request = mock(HttpServletRequest.class);
    TransactionToken token = new TransactionToken("tokenName", "tokenkey", "tokenValue");
    TagWriter tagWriter = mock(TagWriter.class);
    // mock behavior
    when((HttpServletRequest) pageContext.getRequest()).thenReturn(request);
    when((TransactionToken) request.getAttribute(
            TransactionTokenInterceptor.NEXT_TOKEN_REQUEST_ATTRIBUTE_NAME))
                    .thenReturn(token);
    // run
    int result = 1;
    try {
        doThrow(new JspException()).when(tagWriter).startTag(anyString());
        result = tag.writeTagContent(tagWriter);
    } catch (JspException e) {
        e.printStackTrace();
    }
    assertThat(result, is(1));
}