Skip to content

Commit

Permalink
Filter versions by visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Weiler committed Nov 28, 2020
1 parent 300cb94 commit 70ce4e5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ libraryDependencies ++= Seq(
jdbc,
cache,
ws,
"io.sdkman" %% "sdkman-mongodb-persistence" % "1.4",
"io.sdkman" %% "sdkman-mongodb-persistence" % "1.5",
"org.typelevel" %% "cats-core" % "1.0.1",
"org.scalatestplus.play" %% "scalatestplus-play" % "1.5.0" % Test,
"info.cukes" %% "cucumber-scala" % "1.2.5" % Test,
Expand Down
28 changes: 28 additions & 0 deletions features/version_list_by_visibility.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Feature: Version List by Visibility

Scenario: Visible versions are displayed
Given the Candidate
| candidate | name | description | default | websiteUrl | distribution |
| java | Java | Java Platform | 11.0.9.hs-adpt | https://adoptopenjdk.net/ | PLATFORM_SPECIFIC |
And the Versions
| candidate | version | vendor | platform | url | visible |
| java | 8.0.222.hs-adpt | adpt | LINUX_64 | https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u222b10.tar.gz | true |
| java | 8.0.272.hs-adpt | adpt | LINUX_64 | https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u272-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u272b10.tar.gz | |
| java | 8.0.275.hs-adpt | adpt | LINUX_64 | https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01/OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz | false |
When a request is made to /candidates/java/linux64/versions/list
Then a 200 status code is received
And the response body is
"""
|================================================================================
|Available Java Versions
|================================================================================
| Vendor | Use | Version | Dist | Status | Identifier
|--------------------------------------------------------------------------------
| AdoptOpenJDK | | 8.0.272.hs | adpt | | 8.0.272.hs-adpt
| | | 8.0.222.hs | adpt | | 8.0.222.hs-adpt
|================================================================================
|Use the Identifier for installation:
|
| $ sdk install java 11.0.3.hs-adpt
|================================================================================
"""
3 changes: 2 additions & 1 deletion test/steps/DbSteps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class DbSteps extends ScalaDsl with EN with Matchers {
version = cells(1),
vendor = if (cells(2) == "") None else Some(cells(2)),
platform = cells(3),
url = cells(4))
url = cells(4),
visible = if (cells.size == 6 && cells(5).nonEmpty) Some(cells(5).toBoolean) else Some(true))
}
}

Expand Down

0 comments on commit 70ce4e5

Please sign in to comment.