File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/test/java/com/ibm/watson/developer_cloud Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -73,15 +73,27 @@ public static String getStringFromInputStream(InputStream is) {
7373
7474 public String getExistingProperty (String property ) {
7575 String value = prop .getProperty (property );
76- if (value == null ) throw new IllegalStateException ( "A property expected to exist does not exist: " + property );
76+ if (value == null ) throw new MissingPropertyException ( property );
7777 return value ;
7878 }
7979 public String getValidProperty (String property ) {
8080 String value = getExistingProperty (property );
81- if ("" .equals (value )) throw new IllegalStateException ( "Property " + property + " is empty. It's probably unset." );
81+ if ("" .equals (value )) throw new EmptyPropertyException ( property );
8282 return value ;
8383 }
8484
85+ private class MissingPropertyException extends IllegalStateException {
86+ MissingPropertyException (String property ) {
87+ super ("A property expected to exist does not exist: " + property );
88+ }
89+ }
90+
91+ private class EmptyPropertyException extends IllegalStateException {
92+ EmptyPropertyException (String property ) {
93+ super ("Property " + property + " is empty. It's probably unset." );
94+ }
95+ }
96+
8597 /**
8698 * Sets the up.
8799 *
You can’t perform that action at this time.
0 commit comments