Increased Test Coverage and Reduced Sonar Violations

The NPE is coming from when I try to access dsc.registry, since it's null from when I constructed dsc, the DatastoreServiceContext code wasn't doing something wrong.