@Test
public void testResourceContext() {

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