### Question:
BonitaHomeFolderAccessor { public boolean isInFolder(final File file, final File parentFolder) throws IOException { try { verifyFolderAuthorization(file, parentFolder); } catch (final UnauthorizedFolderException e) { return false; } return true; } 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_a_specific_folder() throws Exception { final File folder = new File("." + File.separator + "anyFolder"); final File file = new File("." + File.separator + "anyFolder" + File.separator + ".." + File.separator + "anyFolder" + File.separator + "fileName.txt"); final boolean isInTempFolder = tenantFolder.isInFolder(file, folder); assertTrue(isInTempFolder); }
@Test public void should_unauthorized_a_file_not_in_a_specific_folder() throws Exception { final File folder = new File("." + File.separator + "anyFolder"); final File file = new File("." + File.separator + "anyFolder" + File.separator + ".." + File.separator + ".." + File.separator + "fileName.txt"); final boolean isInTempFolder = tenantFolder.isInFolder(file, folder); assertFalse(isInTempFolder); }