@Test
public void testResourceContext() {

    RsrcCtxWrapper ctx = (RsrcCtxWrapper) zts.newResourceContext(mockServletRequest, mockServletResponse, "apiName");
    assertNotNull(ctx);
    assertNotNull(ctx.context());
    assertNull(ctx.principal());
    assertEquals(ctx.request(), mockServletRequest);
    assertEquals(ctx.response(), mockServletResponse);
    // throw exception without struct
    try {
        com.yahoo.athenz.common.server.rest.ResourceException restExc
            = new com.yahoo.athenz.common.server.rest.ResourceException(401, "failed message");
        ctx.throwZtsException(restExc);
        fail();
    } catch (ResourceException ex) {
        assertEquals(401, ex.getCode());
        assertEquals( ((ResourceError) ex.getData()).message, "failed message");
    }
}