From 034c064c25a5b822aec4db4a70bd63f949278d96 Mon Sep 17 00:00:00 2001 From: Winston Li Date: Thu, 5 Jan 2017 13:21:15 +0000 Subject: [PATCH] Fix for zip unzip test --- .../bridge/repo/FSGitRepoStoreTest.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest.java b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest.java index 8d03201516..d83dfe6637 100644 --- a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest.java +++ b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest.java @@ -77,18 +77,14 @@ public class FSGitRepoStoreTest { @Test public void zipAndUnzipShouldBeTheSame() throws IOException { - long beforeSize = repoStore.totalSize(); + File expected = new File(original, "proj1"); + File actual = new File(repoStore.getRootDirectory(), "proj1"); + assertTrue(Files.contentsAreEqual(expected, actual)); InputStream zipped = repoStore.bzip2Project("proj1"); repoStore.remove("proj1"); - assertTrue(beforeSize > repoStore.totalSize()); + assertFalse(actual.exists()); repoStore.unbzip2Project("proj1", zipped); - assertEquals(beforeSize, repoStore.totalSize()); - assertTrue( - Files.contentsAreEqual( - original, - repoStore.getRootDirectory() - ) - ); + assertTrue(Files.contentsAreEqual(expected, actual)); } } \ No newline at end of file