()
| 245 | } |
| 246 | |
| 247 | @Test |
| 248 | public void shouldGetArrayAudience() { |
| 249 | String token = "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOlsiSG9wZSIsIlRyYXZpcyIsIlNvbG9tb24iXX0.Tm4W8WnfPjlmHSmKFakdij0on2rWPETpoM7Sh0u6-S4"; |
| 250 | DecodedJWT jwt = JWT.require(Algorithm.HMAC256("secret")) |
| 251 | .build() |
| 252 | .verify(token); |
| 253 | |
| 254 | assertThat(jwt, is(notNullValue())); |
| 255 | assertThat(jwt.getAudience(), is(IsCollectionWithSize.hasSize(3))); |
| 256 | assertThat(jwt.getAudience(), is(IsIterableContaining.hasItems("Hope", "Travis", "Solomon"))); |
| 257 | } |
| 258 | |
| 259 | @Test |
| 260 | public void shouldGetStringAudience() { |
nothing calls this directly
no test coverage detected