func TestGetJSON(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	// Setup the test server.
	mux := newMultiplexer(assert)
	ts := restaudit.StartServer(mux, assert)
	defer ts.Close()
	err := mux.Register("test", "json", NewTestHandler("json", assert))
	assert.Nil(err)
	// Perform test requests.
	req := restaudit.NewRequest("GET", "/base/test/json/4711?foo=0815")
	req.AddHeader(restaudit.HeaderAccept, restaudit.ApplicationJSON)
	resp := ts.DoRequest(req)
	resp.AssertStatusEquals(200)
	resp.AssertBodyContains(`"ResourceID":"4711"`)
	resp.AssertBodyContains(`"Query":"0815"`)
	resp.AssertBodyContains(`"Context":"foo"`)
}
// TestGetJSON tests the GET command with a JSON result.
TestGetJSON tests the GET command with a JSON result.
// TestGetJSON tests the GET command with a JSON result .
func TestGetJSON(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	mux := newMultiplexer(assert)
	ts := restaudit.StartServer(mux, assert)
	defer ts.Close()
	err := mux.Register("test", "json", NewTestHandler("json", assert))
	assert.Nil(err)
	req := restaudit.NewRequest("GET", "/base/test/json/4711?foo=0815")
	req.AddHeader(restaudit.HeaderAccept, restaudit.ApplicationJSON)
	resp := ts.DoRequest(req)
	resp.AssertStatusEquals(200)
	resp.AssertBodyContains(`"ResourceID":"4711"`)
	resp.AssertBodyContains(`"Query":"0815"`)
	resp.AssertBodyContains(`"Context":"foo"`)
}
func TestGetJSON ( t * testing . T ) { assert := audit . NewTestingAssertion ( t , true ) mux := newMultiplexer ( assert ) ts := restaudit . StartServer ( mux , assert ) defer ts . Close ( ) err := mux . Register ( " " , " " , NewTestHandler ( " " , assert ) ) assert . Nil ( err ) req := restaudit . NewRequest ( " " , " " ) req . AddHeader ( restaudit . HeaderAccept , restaudit . ApplicationJSON ) resp := ts . DoRequest ( req ) resp . AssertStatusEquals ( 200 ) resp . AssertBodyContains ( `"ResourceID":"4711"` ) resp . AssertBodyContains ( `"Query":"0815"` ) resp . AssertBodyContains ( `"Context":"foo"` ) }
TestGetJSON tests the GET command with a JSON result.
TestGetJSON tests the GET command with a JSON result .
// Setup the test server. // Perform test requests.