Added test

(code moved from pkg/registry/service/rest_test.go)