-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fix: delegation token deserialization
- Loading branch information
Denisas
committed
Feb 2, 2022
1 parent
4acfbe4
commit 37f67f7
Showing
4 changed files
with
47 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
server/src/test/groovy/com/exacaster/lighter/backend/yarn/resources/TokenTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.exacaster.lighter.backend.yarn.resources | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper | ||
import spock.lang.Specification | ||
|
||
class TokenTest extends Specification { | ||
|
||
def "deserialize token"() { | ||
given: | ||
def token = ''' | ||
{ | ||
"Token": { | ||
"urlString": "KQAJZXhhY2FzdGVyB2xpZ2h0ZXIAigF-uY9SkIoBft2b1pCNODxOjgJxFDKUzUCmoGSSlWPLpH4UD2uHgDyXEldFQkhERlMgZGVsZWdhdGlvbhIxOTIuMTY4LjQwLjQxOjgwMjA" | ||
} | ||
} | ||
''' | ||
|
||
when: | ||
def result = new ObjectMapper().readValue(token, Token.class) | ||
|
||
then: | ||
result.getTokenWrapper() != null | ||
result.getTokenWrapper().getToken() != null | ||
} | ||
} |