Skip to content

Commit

Permalink
feat(objectionary#1385): make all private test methods static
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Nov 3, 2022
1 parent 15553c1 commit fcc306c
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ void checksAllDependenciesWithoutTransitive() throws Exception {
MatcherAssert.assertThat(
new LengthOf(
new DcsNoOneHasTransitive(
this.single("eo-collections"),
dependency -> this.empty()
DcsNoOneHasTransitiveTest.single("eo-collections"),
dependency -> DcsNoOneHasTransitiveTest.empty()
)).value(),
Matchers.equalTo(1L)
);
Expand All @@ -55,21 +55,23 @@ void checksAllDependenciesWithTransitive() {
Assertions.assertThrows(
IllegalStateException.class,
new DcsNoOneHasTransitive(
this.single("eo-foo"),
dependency -> this.single("eo-bar")
DcsNoOneHasTransitiveTest.single("eo-foo"),
dependency -> DcsNoOneHasTransitiveTest.single("eo-bar")
)::iterator
);
}

private Dependencies empty() {
private static Dependencies empty() {
return Collections::emptyIterator;
}

private Dependencies single(final String artifact) {
return () -> Collections.singletonList(this.dependency(artifact)).iterator();
private static Dependencies single(final String artifact) {
return Collections.singletonList(
DcsNoOneHasTransitiveTest.dependency(artifact)
)::iterator;
}

private Dependency dependency(final String artifact) {
private static Dependency dependency(final String artifact) {
final Dependency dependency = new Dependency();
dependency.setGroupId("org.eolang");
dependency.setArtifactId(artifact);
Expand Down

0 comments on commit fcc306c

Please sign in to comment.