Code Review
/
aai
/
babel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Additional null checks and comments
[aai/babel.git]
/
src
/
test
/
java
/
org
/
onap
/
aai
/
babel
/
util
/
ArtifactTestUtils.java
diff --git
a/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java
b/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java
index
066911e
..
a98b7c2
100644
(file)
--- a/
src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java
+++ b/
src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java
@@
-65,7
+65,7
@@
public class ArtifactTestUtils {
/**
* Load the Widget type mappings (resource).
/**
* Load the Widget type mappings (resource).
- *
+ *
* @throws IOException
* if the configuration file is not loaded
*/
* @throws IOException
* if the configuration file is not loaded
*/
@@
-127,7
+127,11
@@
public class ArtifactTestUtils {
}
public String loadResourceAsString(String resourceName) throws IOException {
}
public String loadResourceAsString(String resourceName) throws IOException {
+ try {
return IOUtils.toString(getResource(resourceName), Charset.defaultCharset());
return IOUtils.toString(getResource(resourceName), Charset.defaultCharset());
+ } catch (NullPointerException e) {
+ throw new IllegalArgumentException("No such resource " + resourceName);
+ }
}
public String getRequestJson(String resource) throws IOException {
}
public String getRequestJson(String resource) throws IOException {
@@
-144,7
+148,7
@@
public class ArtifactTestUtils {
/**
* Create Properties from the content of the named resource (e.g. a file on the classpath).
/**
* Create Properties from the content of the named resource (e.g. a file on the classpath).
- *
+ *
* @param resourceName
* the resource name
* @return Properties loaded from the named resource
* @param resourceName
* the resource name
* @return Properties loaded from the named resource