make Registry use Encode

This commit is contained in:
Daniel Smith
2014-06-20 15:30:49 -07:00
parent fb991fb84e
commit 2bcb44b6bd
5 changed files with 5 additions and 22 deletions

View File

@@ -16,7 +16,6 @@ limitations under the License.
package registry
import (
"encoding/json"
"fmt"
"reflect"
"testing"
@@ -102,12 +101,10 @@ func TestExtractJson(t *testing.T) {
ID: "foo",
},
}
body, err := json.Marshal(pod)
body, err := api.Encode(&pod)
expectNoError(t, err)
podOut, err := storage.Extract(body)
expectNoError(t, err)
// Extract adds in a kind
pod.Kind = "cluster#pod"
if !reflect.DeepEqual(pod, podOut) {
t.Errorf("Expected %#v, found %#v", pod, podOut)
}