### Question:
BaseService { protected void createTenantDirIfNotExists(String tenantCode) throws Exception { String resourcePath = HadoopUtils.getHdfsResDir(tenantCode); String udfsPath = HadoopUtils.getHdfsUdfDir(tenantCode); HadoopUtils.getInstance().mkdir(resourcePath); HadoopUtils.getInstance().mkdir(udfsPath); }  static Cookie getCookie(HttpServletRequest request, String name);  }### Answer:
@Test public void testCreateTenantDirIfNotExists(){ PowerMockito.mockStatic(HadoopUtils.class); PowerMockito.when(HadoopUtils.getInstance()).thenReturn(hadoopUtils); try { baseService.createTenantDirIfNotExists("test"); } catch (Exception e) { Assert.assertTrue(false); logger.error("CreateTenantDirIfNotExists error ",e); e.printStackTrace(); } }