Tweak to test data builder

This commit is contained in:
jamesagnew 2020-05-19 09:18:59 -04:00
parent cc92bd7b07
commit f3c023bb6f
1 changed files with 6 additions and 4 deletions

View File

@ -107,10 +107,12 @@ public interface ITestDataBuilder {
}
default <T extends IBaseResource> Consumer<T> withId(String theId) {
return t -> {
assertThat(theId, matchesPattern("[a-zA-Z0-9]+"));
t.setId(theId);
};
assertThat(theId, matchesPattern("[a-zA-Z0-9-]+"));
return t -> t.setId(theId);
}
default <T extends IBaseResource> Consumer<T> withId(IIdType theId) {
return withId(theId.getIdPart());
}
default Consumer<IBaseResource> withTag(String theSystem, String theCode) {