use of com.thoughtworks.go.plugin.access.scm.exceptions.InvalidSCMRevisionDataException in project gocd by gocd.
the class SCMRevisionTest method shouldThrowExceptionIfDataKeyContainsCharactersOtherThanAlphaNumericAndUnderScoreCharacters.
@Test
public void shouldThrowExceptionIfDataKeyContainsCharactersOtherThanAlphaNumericAndUnderScoreCharacters() throws Exception {
SCMRevision scmRevision = new SCMRevision("rev123", new Date(), "loser", null, null, null);
try {
scmRevision.addData("HEL-LO-WORLD", "value");
fail("should have thrown exception");
} catch (InvalidSCMRevisionDataException e) {
assertThat(e.getMessage(), is("Key 'HEL-LO-WORLD' is invalid. Key names should consists of only alphanumeric characters and/or underscores."));
}
}
Aggregations