### Question:
TenantIdAccessor { public long ensureTenantId() throws ServletException { long tenantId = parseTenantId(request.getTenantId()); if(tenantId < 0) { return getDefaultTenantId(); } return getRequestedTenantId(); } TenantIdAccessor(HttpServletRequestAccessor request); long getRequestedTenantId(); long ensureTenantId(); long getDefaultTenantId(); long getTenantIdFromRequestOrCookie();  }### Answer:
@Test(expected = ServletException.class) public void testInvalidTenantIdThrowsException() throws Exception { doReturn("invalid").when(requestAccessor).getTenantId(); new TenantIdAccessor(requestAccessor).ensureTenantId(); }