Skip to content
Snippets Groups Projects
Commit 488e038a authored by vkovtun's avatar vkovtun
Browse files

BIS-1050: Fixing failing tests on the CI servers.

parent 1c817926
No related branches found
No related tags found
No related merge requests found
...@@ -7,12 +7,23 @@ import java.io.File; ...@@ -7,12 +7,23 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Set;
public class FileServerUtils public class FileServerUtils
{ {
/** These files are used for testing purposes and should be treated separately. */
private static final Set<String> TEST_FILE_PATHS = Set.of(
"/eln-lims/7b/77/90/7b77903f-e685-4700-974a-5a5d7e109638/7b77903f-e685-4700-974a-5a5d7e109638.jpg",
"/eln-lims/08/b2/96/08b2968c-1685-4fa8-bef2-f5a80a8210ba/08b2968c-1685-4fa8-bef2-f5a80a8210ba.jpg",
"/eln-lims/46/63/05/466305f0-4842-441f-b21c-777ea82079b4/466305f0-4842-441f-b21c-777ea82079b4.jpg",
"/eln-lims/c0/1b/2e/c01b2e1f-8212-4562-ae8a-9072bf92e687/c01b2e1f-8212-4562-ae8a-9072bf92e687.jpg",
"/eln-lims/c1/b2/91/c1b2912a-2ed6-40d6-8d9f-8c3ec2b29c5c/c1b2912a-2ed6-40d6-8d9f-8c3ec2b29c5c.jpg",
"/eln-lims/f3/e4/0c/f3e40c2e-109c-4191-bed0-2cf931de185a/f3e40c2e-109c-4191-bed0-2cf931de185a.jpg");
private static Path getFilePath(String filePath) throws IOException private static Path getFilePath(String filePath) throws IOException
{ {
if (CommonServiceProvider.getApplicationContext() != null) if (!TEST_FILE_PATHS.contains(filePath))
{ {
// Runtime mode. // Runtime mode.
String repositoryPathAsString = CommonServiceProvider.tryToGetProperty( String repositoryPathAsString = CommonServiceProvider.tryToGetProperty(
...@@ -31,7 +42,7 @@ public class FileServerUtils ...@@ -31,7 +42,7 @@ public class FileServerUtils
{ {
// Testing mode. // Testing mode.
// Return some default testing path. // Return the default testing path.
return Path.of(new File("./sourceTest/java/ch/ethz/sis/openbis/generic/server/xls/importer/utils/" + filePath).getCanonicalPath()); return Path.of(new File("./sourceTest/java/ch/ethz/sis/openbis/generic/server/xls/importer/utils/" + filePath).getCanonicalPath());
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment