func TestDecodeInvalidRequest(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	assert.Logf("testing decode invalid requests")
	// Setup the test server.
	mux := newMultiplexer(assert)
	ts := restaudit.StartServer(mux, assert)
	defer ts.Close()
	asserter := newHeaderAsserter(assert, ".* request contains no authorization header")
	err := mux.Register("test", "jwt", newTestHandler("jwt", asserter))
	assert.Nil(err)
	// Perform request without authorization.
	req := restaudit.NewRequest("GET", "/test/jwt/1234567890")
	req.AddHeader(restaudit.HeaderAccept, restaudit.ApplicationJSON)
	resp := ts.DoRequest(req)
	ok := ""
	resp.AssertUnmarshalledBody(&ok)
	assert.Equal(ok, "OK")
}
// TestDecodeInvalidRequest tests the decoding of requests
// without a header or an invalid one.
TestDecodeInvalidRequest tests the decoding of requests
without a header or an invalid one.
// TestDecodeInvalidRequest tests the decoding of requests // without a header or an invalid one .
func TestDecodeInvalidRequest(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	assert.Logf("testing decode invalid requests")
	mux := newMultiplexer(assert)
	ts := restaudit.StartServer(mux, assert)
	defer ts.Close()
	asserter := newHeaderAsserter(assert, ".* request contains no authorization header")
	err := mux.Register("test", "jwt", newTestHandler("jwt", asserter))
	assert.Nil(err)
	req := restaudit.NewRequest("GET", "/test/jwt/1234567890")
	req.AddHeader(restaudit.HeaderAccept, restaudit.ApplicationJSON)
	resp := ts.DoRequest(req)
	ok := ""
	resp.AssertUnmarshalledBody(&ok)
	assert.Equal(ok, "OK")
}
func TestDecodeInvalidRequest ( t * testing . T ) { assert := audit . NewTestingAssertion ( t , true ) assert . Logf ( " " ) mux := newMultiplexer ( assert ) ts := restaudit . StartServer ( mux , assert ) defer ts . Close ( ) asserter := newHeaderAsserter ( assert , " " ) err := mux . Register ( " " , " " , newTestHandler ( " " , asserter ) ) assert . Nil ( err ) req := restaudit . NewRequest ( " " , " " ) req . AddHeader ( restaudit . HeaderAccept , restaudit . ApplicationJSON ) resp := ts . DoRequest ( req ) ok := " " resp . AssertUnmarshalledBody ( & ok ) assert . Equal ( ok , " " ) }
TestDecodeInvalidRequest tests the decoding of requests
without a header or an invalid one.
TestDecodeInvalidRequest tests the decoding of requests without a header or an invalid one .
// Setup the test server. // Perform request without authorization.