diff options
author | Rob Daugherty <rd472p@att.com> | 2018-05-02 16:46:14 -0400 |
---|---|---|
committer | Rob Daugherty <rd472p@att.com> | 2018-05-04 15:28:51 +0000 |
commit | 3ee4ec41ac18e51a16eafa767e090502b1a33fb5 (patch) | |
tree | 11a4d7b6c3bc5b88ce8dd67f12c7726c9f7dd80f /adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud | |
parent | 13999df2b5cbcfd29d479e20970b39ba876725f3 (diff) |
Fix CloudConfig junits
...for some definition of the word "fix". There is still a lot
that's less than ideal about how CloudConfig is handled, and with
how the unit tests are written.
Change-Id: Ic8c66c64d336f22c141687cf41a4828810bf1aec
Issue-ID: SO-584
Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud')
-rw-r--r-- | adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigFactory.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigFactory.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigFactory.java index 3281f0489c..2b385910d9 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigFactory.java +++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigFactory.java @@ -92,11 +92,11 @@ public class CloudConfigFactory implements Serializable { public CloudConfig getCloudConfig () { rwl.readLock ().lock (); try { - if (cloudConfigCache.isValidCloudConfig()) { - return cloudConfigCache.clone (); - } else { - return new CloudConfig(); + if (!cloudConfigCache.isValidCloudConfig()) { + // Not ideal, but better than returning an invalid object + throw new IllegalStateException("No valid CloudConfig is loaded"); } + return cloudConfigCache.clone (); } finally { rwl.readLock ().unlock (); } |