Fix to state/apiserver/uniter_test as requested by davecheney

Addressed comments / request for helper function.