X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dmaap-mediator-producer%2Finternal%2Fconfig%2Fregistrator_test.go;h=b2f10ccd6ad00a7b572a2502ff9fe7b1da66bced;hb=3287cf6923fe9b6f768a10e9d7a852227e1a3949;hp=324aed0c56228a5398ec32b63fafc29e26b4e70f;hpb=9b6fec053ae15d9ea67d7c85db0acb45cf9effe8;p=nonrtric.git diff --git a/dmaap-mediator-producer/internal/config/registrator_test.go b/dmaap-mediator-producer/internal/config/registrator_test.go index 324aed0c..b2f10ccd 100644 --- a/dmaap-mediator-producer/internal/config/registrator_test.go +++ b/dmaap-mediator-producer/internal/config/registrator_test.go @@ -21,6 +21,7 @@ package config import ( + "encoding/json" "io/ioutil" "net/http" "testing" @@ -39,8 +40,17 @@ func TestRegisterTypes(t *testing.T) { StatusCode: http.StatusCreated, }, nil) + schemaString := `{ + "type": "object", + "properties": {}, + "additionalProperties": false + }` + var schemaObj interface{} + json.Unmarshal([]byte(schemaString), &schemaObj) + type1 := TypeDefinition{ - Id: "Type1", + Identity: "Type1", + TypeSchema: schemaObj, } types := []TypeDefinition{type1} @@ -59,7 +69,7 @@ func TestRegisterTypes(t *testing.T) { assertions.Equal("/data-producer/v1/info-types/Type1", actualRequest.URL.Path) assertions.Equal("application/json", actualRequest.Header.Get("Content-Type")) body, _ := ioutil.ReadAll(actualRequest.Body) - expectedBody := []byte(`{"info_job_data_schema": {"type": "object","properties": {},"additionalProperties": false}}`) + expectedBody := []byte(`{"info_job_data_schema": {"additionalProperties":false,"properties":{},"type":"object"}}`) assertions.Equal(expectedBody, body) clientMock.AssertNumberOfCalls(t, "Do", 1) }