service: make RequestData to provide BearerTokenSource interface

This commit is contained in:
Leonard Lyubich 2020-06-18 15:24:17 +03:00
parent ce5264a479
commit 3f7d3f8a86
6 changed files with 73 additions and 0 deletions

View file

@ -128,3 +128,13 @@ func TestRequestVerificationHeader_SetBearer(t *testing.T) {
require.Equal(t, token, h.GetBearer())
}
func TestRequestVerificationHeader_GetBearerToken(t *testing.T) {
s := new(RequestVerificationHeader)
require.Nil(t, s.GetBearerToken())
bearer := new(BearerTokenMsg)
s.SetBearer(bearer)
require.Equal(t, wrapBearerTokenMsg(bearer), s.GetBearerToken())
}