XD-2235 Allow for 'security.basic.realm' to control the security realm

This is a minor fix, but without it, the realm will always default to null
Or fix the test, which wasn't supposed to have the space in.