### Question:
BonitaHomeFolderAccessor { public boolean isInTempFolder(final File file, final WebBonitaConstantsUtils webBonitaConstantsUtils) throws IOException { return isInFolder(file, webBonitaConstantsUtils.getTempFolder()); } BonitaHomeFolderAccessor(); File getTempFile(final String filePath, final Long tenantId); String getCompleteTempFilePath(final String filePath); String getCompleteTempFilePath(final String filePath, final Long tenantId); WebBonitaConstantsUtils getBonitaConstantUtil(final Long tenantId); boolean isInTempFolder(final File file, final WebBonitaConstantsUtils webBonitaConstantsUtils); boolean isInFolder(final File file, final File parentFolder); IconDescriptor getIconFromFileSystem(String iconPath, long tenantId);  }### Answer:
@Test public void should_authorized_a_file_in_temp_folder() throws Exception { given(webBonitaConstantsUtils.getTempFolder()).willReturn(new File("." + File.separator + "tempFolder")); final File file = new File(webBonitaConstantsUtils.getTempFolder().getAbsolutePath(), "" + File.separator + ".." + File.separator + "tempFolder" + File.separator + "fileName.txt"); final boolean isInTempFolder = tenantFolder.isInTempFolder(file, webBonitaConstantsUtils); assertTrue(isInTempFolder); }
@Test public void should_unauthorized_a_file_not_in_temp_folder() throws Exception { given(webBonitaConstantsUtils.getTempFolder()).willReturn(new File("." + File.separator + "tempFolder")); final File file = new File(webBonitaConstantsUtils.getTempFolder().getAbsolutePath(), "" + File.separator + ".." + File.separator + ".." + File.separator + ".." + File.separator + "fileName.txt"); final boolean isInTempFolder = tenantFolder.isInTempFolder(file, webBonitaConstantsUtils); assertFalse(isInTempFolder); }