pivotal-cf / java-cfenv

Apache License 2.0
95 stars 59 forks source link

Get string null check #178

Closed swarnav31 closed 1 year ago

swarnav31 commented 2 years ago

We were unit testing a piece of code where the getUsername() in CfCredentials.class is getting called. In case of null in username/password we put a custom Exception to be thrown, later in code depending upon the return value of getUsername() or getPassword(). However, assertion failed as it was a NPE instead! A null-check before accessing toString() on the map data helps.