### Question:
LocalFileVreAuthorizationAccess implements VreAuthorizationAccess { @Override public void deleteVreAuthorizations(String vreId) throws AuthorizationUnavailableException { synchronized (authorizationsFolder) { if (!getFileOfVre(vreId).delete()) { throw new AuthorizationUnavailableException("Failed to delete vre authorizations for vre '" + vreId + "'"); } } } LocalFileVreAuthorizationAccess(Path authorizationsFolder); @Override VreAuthorization getOrCreateAuthorization(String vreId, String userId, String userRole); @Override Optional<VreAuthorization> getAuthorization(String vreId, String userId); @Override void deleteVreAuthorizations(String vreId); static final Logger LOG; }### Answer:
@Test(expected = AuthorizationUnavailableException.class) public void deleteVreAuthorizationThrowsAnAuthorizationUnavailableExceptionWhenTheFileIsUnavailable() throws Exception { instance.deleteVreAuthorizations("nonExisting"); }
@Test public void deleteVreAuthorizationsDeletesTheVreAuthorizationsFile() throws Exception { instance.deleteVreAuthorizations(VRE); assertThat(new File(authorizationsFolder.resolve(AUTH_FILE).toString()).exists(), equalTo(false)); }