Esempio n. 1
0
func TestRefreshTokenUsingNilTokenFails(t *testing.T) {
	resource.Require(t, resource.Database)
	service, controller := createControler(t)

	payload := &app.RefreshToken{}
	_, err := test.RefreshLoginBadRequest(t, nil, service, controller, payload)
	assert.NotNil(t, err)
}
Esempio n. 2
0
func TestRefreshTokenUsingInvalidTokenFails(t *testing.T) {
	resource.Require(t, resource.Database)
	service, controller := createControler(t)

	refreshToken := "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.S-vR8LZTQ92iqGCR3rNUG0MiGx2N5EBVq0frCHP_bJ8"
	payload := &app.RefreshToken{RefreshToken: &refreshToken}
	_, err := test.RefreshLoginBadRequest(t, nil, service, controller, payload)
	assert.NotNil(t, err)
}