diff --git a/core/src/test/java/com/gentics/mesh/core/field/binary/BinaryFieldUploadEndpointTest.java b/core/src/test/java/com/gentics/mesh/core/field/binary/BinaryFieldUploadEndpointTest.java index 31364a05b3..f631f92062 100644 --- a/core/src/test/java/com/gentics/mesh/core/field/binary/BinaryFieldUploadEndpointTest.java +++ b/core/src/test/java/com/gentics/mesh/core/field/binary/BinaryFieldUploadEndpointTest.java @@ -124,8 +124,8 @@ public void testUploadMultipleToBinaryNode() throws IOException { String value = container.getBinary("binary") == null ? null : container.getBinary("binary").getFileName(); assertEquals("Version {" + container.getVersion() + "} did not contain the old value", oldFilename, value); assertNotNull("Version {" + newContainer.getVersion() + "} did not contain the updated field.", newContainer.getBinary("binary")); - assertEquals("Version {" + newContainer.getVersion() + "} did not contain the updated value.", newFileName, - newContainer.getBinary("binary").getFileName()); + assertEquals("Version {" + newContainer.getVersion() + "} did not contain the updated value.", newFileName, newContainer.getBinary( + "binary").getFileName()); container = newContainer; } } @@ -277,6 +277,7 @@ public void testUpload() throws Exception { NodeResponse response = call(() -> uploadRandomData(node, "en", "binary", binaryLen, contentType, fileName)); assertTrue("The upload should have created the tmp folder", uploadFolder.exists()); + Thread.sleep(1000); assertThat(uploadFolder.list()).as("Folder should not contain any remaining tmp upload file").isEmpty(); response = call(() -> client().findNodeByUuid(PROJECT_NAME, uuid, new VersioningParametersImpl().draft())); @@ -343,8 +344,8 @@ public void testDeleteBinaryNode() throws IOException { call(() -> client().deleteNode(PROJECT_NAME, uuid, new DeleteParametersImpl().setRecursive(true))); try (Tx tx = tx()) { - assertNull("The binary for the hash should have also been removed since only one node used the binary.", - meshRoot().getBinaryRoot().findByHash(hash)); + assertNull("The binary for the hash should have also been removed since only one node used the binary.", meshRoot().getBinaryRoot() + .findByHash(hash)); } assertFalse("The binary file should have been removed.", binaryFile.exists()); @@ -411,8 +412,8 @@ public void testDeleteBinaryNodeDeuplication() throws IOException { // Now delete nodeA call(() -> client().deleteNode(PROJECT_NAME, uuidA, new DeleteParametersImpl().setRecursive(true))); try (Tx tx = tx()) { - assertNotNull("The binary for the hash should not have been removed since it is still in use.", - meshRoot().getBinaryRoot().findByHash(hashA)); + assertNotNull("The binary for the hash should not have been removed since it is still in use.", meshRoot().getBinaryRoot().findByHash( + hashA)); } assertTrue("The binary file should not have been deleted since there is still one node which uses it.", binaryFileA.exists()); @@ -420,8 +421,8 @@ public void testDeleteBinaryNodeDeuplication() throws IOException { call(() -> client().deleteNode(PROJECT_NAME, uuidB, new DeleteParametersImpl().setRecursive(true))); try (Tx tx = tx()) { - assertNull("The binary for the hash should have also been removed since only one node used the binary.", - meshRoot().getBinaryRoot().findByHash(hashA)); + assertNull("The binary for the hash should have also been removed since only one node used the binary.", meshRoot().getBinaryRoot() + .findByHash(hashA)); } assertFalse("The binary file should have been removed.", binaryFileA.exists()); @@ -452,8 +453,8 @@ public void testUploadWithSegmentfieldConflict() throws IOException { call(() -> uploadRandomData(folder2014, "en", "binary", binaryLen, contentType, fileName)); } - call(() -> client().findNodeByUuid(PROJECT_NAME, db().tx(() -> folder("2014").getUuid()), - new NodeParametersImpl().setResolveLinks(LinkType.FULL))); + call(() -> client().findNodeByUuid(PROJECT_NAME, db().tx(() -> folder("2014").getUuid()), new NodeParametersImpl().setResolveLinks( + LinkType.FULL))); try (Tx tx = tx()) { // try to upload same file to folder 2015 @@ -508,8 +509,8 @@ private int uploadImage(Node node, String languageTag, String fieldname, String Buffer buffer = Buffer.buffer(bytes); String uuid = node.getUuid(); VersionNumber version = node.getGraphFieldContainer(languageTag).getVersion(); - NodeResponse response = call( - () -> client().updateNodeBinaryField(PROJECT_NAME, uuid, languageTag, version.toString(), fieldname, buffer, filename, contentType)); + NodeResponse response = call(() -> client().updateNodeBinaryField(PROJECT_NAME, uuid, languageTag, version.toString(), fieldname, buffer, + filename, contentType)); assertNotNull(response); return bytes.length;