@h1alexbel take a look, please
I have a class
public final class SkipAuthors implements Scalar<Collection<String>> {
public SkipAuthors() {
this(
new ListOf<>(
System.getenv().get("SKIP_AUTHORS").split(",")
)
);
}
@Override
public Collection<String> value() {
return Collections.unmodifiableCollection(this.authors);
}
}
which is taking values of SKIP_AUTHORS sys env, what is the right way to test this? For now test looks like:
final class SkipAuthorsTest {
@Test
void worksAsImmutable() throws Exception {
final Scalar<Collection<String>> authors = new SkipAuthors("ruby", "jeff");
final Collection<String> expected = new ListOf<>("ruby", "jeff");
MatcherAssert.assertThat(
"%s should be equal to %s".formatted(authors.value(), expected),
expected,
Matchers.everyItem(
Matchers.in(authors.value())
)
);
}
}
btw, might be you know how array variables from action.yaml maps to system environment variables
@h1alexbel take a look, please
I have a class
which is taking values of
SKIP_AUTHORSsys env, what is the right way to test this? For now test looks like:btw, might be you know how array variables from
action.yamlmaps to system environment variables