Skip to content

Commit

Permalink
feat(objectionary#1386): remove HARCODED dependency from DcsWithRuntime
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Nov 7, 2022
1 parent 54537f9 commit c56b05f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@
*/
final class DcsWithRuntime implements Dependencies {

/**
* Hardcoded dependency.
*/
static final Unchecked<Dependency> HARDCODED = DcsWithRuntime.dependency("0.28.10");

/**
* Dependency downloaded by HTTP from Maven Central.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Collections;
import org.apache.maven.model.Dependency;
import org.cactoos.scalar.LengthOf;
import org.cactoos.scalar.Unchecked;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
Expand All @@ -41,7 +42,7 @@ class DcsWithRuntimeTest {
void addsHardcodedVersionOfRuntimeDependency() throws Exception {
final DcsWithRuntime dependencies = new DcsWithRuntime(
dependencies(),
DcsWithRuntime.HARDCODED
new Unchecked<>(DcsWithRuntimeTest::dependency)
);
MatcherAssert.assertThat(
new LengthOf(dependencies).value(),
Expand All @@ -61,12 +62,14 @@ void addsRemoteVersionOfRuntimeDependency() throws Exception {
}

private static Dependencies dependencies() {
return () -> {
final Dependency dependency = new Dependency();
dependency.setGroupId("org.eolang");
dependency.setArtifactId("eo-collections");
dependency.setVersion("0.1.0");
return Collections.singleton(dependency).iterator();
};
return Collections.singleton(dependency())::iterator;
}

private static Dependency dependency() {
final Dependency dependency = new Dependency();
dependency.setGroupId("org.eolang");
dependency.setArtifactId("eo-collections");
dependency.setVersion("0.1.0");
return dependency;
}
}

0 comments on commit c56b05f

Please sign in to comment.