aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test/java/org/openecomp/sdc/TestUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/test/java/org/openecomp/sdc/TestUtils.java')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/TestUtils.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/TestUtils.java b/catalog-be/src/test/java/org/openecomp/sdc/TestUtils.java
index 2c06f22632..809dc7ddb0 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/TestUtils.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/TestUtils.java
@@ -40,4 +40,16 @@ public class TestUtils {
}
return result;
}
+
+ public static InputStream getResourceAsStream(final String resourcePath) {
+ return TestUtils.class.getClassLoader().getResourceAsStream(resourcePath);
+ }
+
+ public static byte[] getResourceAsByteArray(final String resourcePath) throws IOException {
+ final InputStream resourceAsStream = getResourceAsStream(resourcePath);
+ if (resourceAsStream == null) {
+ throw new IOException("Could not find file: " + resourcePath);
+ }
+ return IOUtils.toByteArray(resourceAsStream);
+ }
}