use of com.thoughtworks.go.server.exceptions.InvalidAccessTokenException in project gocd by gocd.
the class AccessTokenServiceIntegrationTest method shouldFailToGetAccessTokenWhenProvidedTokenContainsInvalidSaltId.
@Test
public void shouldFailToGetAccessTokenWhenProvidedTokenContainsInvalidSaltId() {
String accessToken = RandomStringUtils.randomAlphanumeric(40);
InvalidAccessTokenException exception = assertThrows(InvalidAccessTokenException.class, () -> accessTokenService.findByAccessToken(accessToken));
assertThat("Invalid Personal Access Token.").isEqualTo(exception.getMessage());
}
use of com.thoughtworks.go.server.exceptions.InvalidAccessTokenException in project gocd by gocd.
the class AccessTokenServiceIntegrationTest method shouldFailToGetAccessTokenWhenProvidedTokenLengthIsNotEqualTo40.
@Test
public void shouldFailToGetAccessTokenWhenProvidedTokenLengthIsNotEqualTo40() {
InvalidAccessTokenException exception = assertThrows(InvalidAccessTokenException.class, () -> accessTokenService.findByAccessToken("my-access-token"));
assertThat("Invalid Personal Access Token.").isEqualTo(exception.getMessage());
}
Aggregations