Merge changes from topic "credman-tests"

* changes:
  Add CredentialManagerTest
  Add some null checks in various credentials classes