added some unit tests around username replacement