pratiks
8/31/2017 - 2:56 PM

Go Lang Tests

Go Lang Tests

			
// Create a request payload			
var invalidBotManagerRequest = `{
	"aaid" : {
"id": "655363:b51e3fc3-1a61-4cd2-80d5-02fa4175a082"
},
"context":
}`

// Create a request with invalid JSON
// convert request payload string to a body closer
r, _ := http.NewRequest("POST", url, ioutil.NopCloser(bytes.NewBufferString(invalidBotManagerRequest)))

// httptest.NewRecorder() will save the response to 
w := httptest.NewRecorder()
botManagerHandler.InstallAppByAID( w , r)