From 83bad3e009388227db0adc4198ad88974ef421f1 Mon Sep 17 00:00:00 2001 From: Michael Lux Date: Tue, 18 Feb 2020 13:20:45 +0100 Subject: [PATCH 1/5] Added version API --- .../java/com/amihaiemil/docker/Docker.java | 7 ++ .../java/com/amihaiemil/docker/RtDocker.java | 20 ++++++ .../java/com/amihaiemil/docker/RtVersion.java | 71 +++++++++++++++++++ .../java/com/amihaiemil/docker/Version.java | 11 +++ 4 files changed, 109 insertions(+) create mode 100644 src/main/java/com/amihaiemil/docker/RtVersion.java create mode 100644 src/main/java/com/amihaiemil/docker/Version.java diff --git a/src/main/java/com/amihaiemil/docker/Docker.java b/src/main/java/com/amihaiemil/docker/Docker.java index fbb40fb8..d35e7927 100644 --- a/src/main/java/com/amihaiemil/docker/Docker.java +++ b/src/main/java/com/amihaiemil/docker/Docker.java @@ -103,6 +103,13 @@ Reader events() */ Plugins plugins(); + /** + * Entry point for Version API. + * @return Version. + * @throws IOException If an I/O error occurs. + */ + Version version() throws IOException; + /** * The underlying, immutable, Apache HttpClient.

* diff --git a/src/main/java/com/amihaiemil/docker/RtDocker.java b/src/main/java/com/amihaiemil/docker/RtDocker.java index 53462cd2..65325def 100644 --- a/src/main/java/com/amihaiemil/docker/RtDocker.java +++ b/src/main/java/com/amihaiemil/docker/RtDocker.java @@ -33,6 +33,8 @@ import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; +import javax.json.JsonObject; + /** * Restful Docker. * @author Mihai Andronache (amihaiemil@gmail.com) @@ -158,6 +160,24 @@ public Plugins plugins() { ); } + @Override + public Version version() throws IOException { + final String versionUri = this.baseUri.toString() + "/version"; + final HttpGet version = new HttpGet(versionUri); + final JsonObject json = this.client.execute( + version, + new ReadJsonObject( + new MatchStatus(version.getURI(), HttpStatus.SC_OK) + ) + ); + return new RtVersion( + json, + this.client, + URI.create(versionUri), + this + ); + } + @Override public HttpClient httpClient() { return this.client; diff --git a/src/main/java/com/amihaiemil/docker/RtVersion.java b/src/main/java/com/amihaiemil/docker/RtVersion.java new file mode 100644 index 00000000..fd941f49 --- /dev/null +++ b/src/main/java/com/amihaiemil/docker/RtVersion.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2018-2019, Mihai Emil Andronache + * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1)Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2)Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3)Neither the name of docker-java-api nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.amihaiemil.docker; + +import org.apache.http.client.HttpClient; + +import javax.json.JsonObject; +import java.net.URI; + +/** + * Runtime {@link Version}. + * @author Michael Lux (michi.lux@gmail.com) + * @since 0.0.11 + */ +final class RtVersion extends JsonResource implements Version { + /** + * Apache HttpClient which sends the requests. + */ + private final HttpClient client; + + /** + * Base URI. + */ + private final URI baseUri; + + /** + * Docker API. + */ + private final Docker docker; + + /** + * Ctor. + * @param rep JsonObject representation of this Version. + * @param client The http client. + * @param uri The URI for this version. + * @param dkr The docker entry point. + * @checkstyle ParameterNumber (5 lines) + */ + RtVersion( + final JsonObject rep, final HttpClient client, + final URI uri, final Docker dkr + ) { + super(rep); + this.client = client; + this.baseUri = uri; + this.docker = dkr; + } +} diff --git a/src/main/java/com/amihaiemil/docker/Version.java b/src/main/java/com/amihaiemil/docker/Version.java new file mode 100644 index 00000000..05feecd3 --- /dev/null +++ b/src/main/java/com/amihaiemil/docker/Version.java @@ -0,0 +1,11 @@ +package com.amihaiemil.docker; + +import javax.json.JsonObject; + +/** + * Version API. + * @author Michael Lux (michi.lux@gmail.com) + * @since 0.0.11 + */ +public interface Version extends JsonObject { +} From d04a543bbce7bc2b58b33d55c08ab0d84ab7bc30 Mon Sep 17 00:00:00 2001 From: Michael Lux Date: Wed, 19 Feb 2020 15:31:53 +0100 Subject: [PATCH 2/5] Improved version API implementation and provided unit test --- .../java/com/amihaiemil/docker/RtDocker.java | 13 +-- .../java/com/amihaiemil/docker/RtVersion.java | 99 +++++++++++++++---- .../java/com/amihaiemil/docker/Version.java | 41 ++++++++ .../amihaiemil/docker/RtVersionTestCase.java | 59 +++++++++++ src/test/resources/version.json | 1 + 5 files changed, 181 insertions(+), 32 deletions(-) create mode 100644 src/test/java/com/amihaiemil/docker/RtVersionTestCase.java create mode 100644 src/test/resources/version.json diff --git a/src/main/java/com/amihaiemil/docker/RtDocker.java b/src/main/java/com/amihaiemil/docker/RtDocker.java index 65325def..09f8494c 100644 --- a/src/main/java/com/amihaiemil/docker/RtDocker.java +++ b/src/main/java/com/amihaiemil/docker/RtDocker.java @@ -33,8 +33,6 @@ import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; -import javax.json.JsonObject; - /** * Restful Docker. * @author Mihai Andronache (amihaiemil@gmail.com) @@ -163,18 +161,9 @@ public Plugins plugins() { @Override public Version version() throws IOException { final String versionUri = this.baseUri.toString() + "/version"; - final HttpGet version = new HttpGet(versionUri); - final JsonObject json = this.client.execute( - version, - new ReadJsonObject( - new MatchStatus(version.getURI(), HttpStatus.SC_OK) - ) - ); return new RtVersion( - json, this.client, - URI.create(versionUri), - this + URI.create(versionUri) ); } diff --git a/src/main/java/com/amihaiemil/docker/RtVersion.java b/src/main/java/com/amihaiemil/docker/RtVersion.java index fd941f49..61ba9e6e 100644 --- a/src/main/java/com/amihaiemil/docker/RtVersion.java +++ b/src/main/java/com/amihaiemil/docker/RtVersion.java @@ -25,9 +25,12 @@ */ package com.amihaiemil.docker; +import org.apache.http.HttpStatus; import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; import javax.json.JsonObject; +import java.io.IOException; import java.net.URI; /** @@ -37,35 +40,91 @@ */ final class RtVersion extends JsonResource implements Version { /** - * Apache HttpClient which sends the requests. + * Ctor. + * @param client The http client. + * @param uri The URI for this version. + * @throws IOException If an I/O error occurs. */ - private final HttpClient client; + RtVersion(final HttpClient client, final URI uri) throws IOException { + super(fetch(client, uri)); + } /** - * Base URI. + * Fetch the JsonObject resource. + * @param client The Http client. + * @param uri The request URL. + * @return The fetched JsonObject. + * @throws UnexpectedResponseException If Docker's response code is not 200. + * @throws IOException If an I/O error occurs. */ - private final URI baseUri; + private static JsonObject fetch(final HttpClient client, final URI uri) + throws UnexpectedResponseException, IOException { + final HttpGet version = new HttpGet(uri); + try { + return client.execute( + version, + new ReadJsonObject( + new MatchStatus(version.getURI(), HttpStatus.SC_OK) + ) + ); + } finally { + version.releaseConnection(); + } + } /** - * Docker API. + * Returns the version of the connected docker engine. + * @return Version of connected docker engine */ - private final Docker docker; + public String getVersion() { + return this.getString("Version"); + } /** - * Ctor. - * @param rep JsonObject representation of this Version. - * @param client The http client. - * @param uri The URI for this version. - * @param dkr The docker entry point. - * @checkstyle ParameterNumber (5 lines) + * Returns the name of the connected docker platform. + * @return Name of the docker platform + */ + public String getPlatformName() { + return this.getJsonObject("Platform").getString("Name"); + } + + /** + * Returns the API version of the docker engine. + * @return API version + */ + public String getApiVersion() { + return this.getString("ApiVersion"); + } + + /** + * Returns the minimum API version of the docker engine. + * @return Minimum API version + */ + public String getMinApiVersion() { + return this.getString("MinAPIVersion"); + } + + /** + * Returns the OS docker is running on. + * @return Name of the OS docker is running on + */ + public String getOs() { + return this.getString("Os"); + } + + /** + * Returns the (CPU) architecture docker is running on. + * @return The (CPU) architecture docker is running on + */ + public String getArch() { + return this.getString("Arch"); + } + + /** + * Reports whether experimental docker features are enabled. + * @return Whether experimental docker features are enabled */ - RtVersion( - final JsonObject rep, final HttpClient client, - final URI uri, final Docker dkr - ) { - super(rep); - this.client = client; - this.baseUri = uri; - this.docker = dkr; + public boolean isExperimental() { + return this.getBoolean("Experimental"); } } diff --git a/src/main/java/com/amihaiemil/docker/Version.java b/src/main/java/com/amihaiemil/docker/Version.java index 05feecd3..6fd7b5ed 100644 --- a/src/main/java/com/amihaiemil/docker/Version.java +++ b/src/main/java/com/amihaiemil/docker/Version.java @@ -8,4 +8,45 @@ * @since 0.0.11 */ public interface Version extends JsonObject { + /** + * Returns the version of the connected docker engine. + * @return Version of connected docker engine + */ + String getVersion(); + + /** + * Returns the name of the connected docker platform. + * @return Name of the docker platform + */ + String getPlatformName(); + + /** + * Returns the API version of the docker engine. + * @return API version + */ + String getApiVersion(); + + /** + * Returns the minimum API version of the docker engine. + * @return Minimum API version + */ + String getMinApiVersion(); + + /** + * Returns the OS docker is running on. + * @return Name of the OS docker is running on + */ + String getOs(); + + /** + * Returns the (CPU) architecture docker is running on. + * @return The (CPU) architecture docker is running on + */ + String getArch(); + + /** + * Reports whether experimental docker features are enabled. + * @return Whether experimental docker features are enabled + */ + boolean isExperimental(); } diff --git a/src/test/java/com/amihaiemil/docker/RtVersionTestCase.java b/src/test/java/com/amihaiemil/docker/RtVersionTestCase.java new file mode 100644 index 00000000..9b187957 --- /dev/null +++ b/src/test/java/com/amihaiemil/docker/RtVersionTestCase.java @@ -0,0 +1,59 @@ +package com.amihaiemil.docker; + +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.StatusLine; +import org.apache.http.client.HttpClient; +import org.apache.http.client.ResponseHandler; +import org.apache.http.client.methods.HttpGet; +import org.junit.Test; + +import java.io.IOException; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +/** + * Unit tests for {@link RtVersion}. + * @author Michael Lux (michi.lux@gmail.com) + * @since 0.0.11 + */ +public class RtVersionTestCase { + /** + * Must return the same number of images as there are elements in the + * json array returned by the service. + * @throws IOException On I/O error. + */ + @Test + public final void queryDockerVersion() throws IOException { + HttpClient client = mock(HttpClient.class); + when(client.execute(any(HttpGet.class), any(ResponseHandler.class))) + .thenAnswer(invocation -> { + HttpResponse response = mock(HttpResponse.class); + HttpEntity entity = mock(HttpEntity.class); + when(response.getEntity()).thenReturn(entity); + when(entity.getContent()).thenReturn( + getClass().getClassLoader() + .getResourceAsStream("version.json")); + StatusLine statusLine = mock(StatusLine.class); + when(response.getStatusLine()).thenReturn(statusLine); + when(statusLine.getStatusCode()).thenReturn(HttpStatus.SC_OK); + return ((ReadJsonObject) invocation.getArguments()[1]) + .handleResponse(response); + }); + Docker docker = new LocalDocker(client, "v1.35"); + Version version = docker.version(); + assertEquals("19.03.3", version.getVersion()); + assertEquals("Docker Engine - Community", version.getPlatformName()); + assertEquals("1.40", version.getApiVersion()); + assertEquals("1.12", version.getMinApiVersion()); + assertEquals("linux", version.getOs()); + assertEquals("amd64", version.getArch()); + assertTrue(version.isExperimental()); + } + +} diff --git a/src/test/resources/version.json b/src/test/resources/version.json new file mode 100644 index 00000000..7c0accc1 --- /dev/null +++ b/src/test/resources/version.json @@ -0,0 +1 @@ +{"Platform":{"Name":"Docker Engine - Community"},"Components":[{"Name":"Engine","Version":"19.03.3","Details":{"ApiVersion":"1.40","Arch":"amd64","BuildTime":"2019-10-08T00:59:17.000000000+00:00","Experimental":"true","GitCommit":"a872fc2f86","GoVersion":"go1.12.10","KernelVersion":"5.3.0-40-generic","MinAPIVersion":"1.12","Os":"linux"}},{"Name":"containerd","Version":"1.2.10","Details":{"GitCommit":"b34a5c8af56e510852c35414db4c1f4fa6172339"}},{"Name":"runc","Version":"1.0.0-rc8+dev","Details":{"GitCommit":"3e425f80a8c931f88e6d94a8c831b9d5aa481657"}},{"Name":"docker-init","Version":"0.18.0","Details":{"GitCommit":"fec3683"}}],"Version":"19.03.3","ApiVersion":"1.40","MinAPIVersion":"1.12","GitCommit":"a872fc2f86","GoVersion":"go1.12.10","Os":"linux","Arch":"amd64","KernelVersion":"5.3.0-40-generic","Experimental":true,"BuildTime":"2019-10-08T00:59:17.000000000+00:00"} \ No newline at end of file From 9dc7a66fb77e32a491fc62e834280735176c3397 Mon Sep 17 00:00:00 2001 From: Michael Lux Date: Wed, 19 Feb 2020 15:58:50 +0100 Subject: [PATCH 3/5] Added missing override annotations --- src/main/java/com/amihaiemil/docker/RtVersion.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/amihaiemil/docker/RtVersion.java b/src/main/java/com/amihaiemil/docker/RtVersion.java index 61ba9e6e..a3e83373 100644 --- a/src/main/java/com/amihaiemil/docker/RtVersion.java +++ b/src/main/java/com/amihaiemil/docker/RtVersion.java @@ -76,6 +76,7 @@ private static JsonObject fetch(final HttpClient client, final URI uri) * Returns the version of the connected docker engine. * @return Version of connected docker engine */ + @Override public String getVersion() { return this.getString("Version"); } @@ -84,6 +85,7 @@ public String getVersion() { * Returns the name of the connected docker platform. * @return Name of the docker platform */ + @Override public String getPlatformName() { return this.getJsonObject("Platform").getString("Name"); } @@ -92,6 +94,7 @@ public String getPlatformName() { * Returns the API version of the docker engine. * @return API version */ + @Override public String getApiVersion() { return this.getString("ApiVersion"); } @@ -100,6 +103,7 @@ public String getApiVersion() { * Returns the minimum API version of the docker engine. * @return Minimum API version */ + @Override public String getMinApiVersion() { return this.getString("MinAPIVersion"); } @@ -108,6 +112,7 @@ public String getMinApiVersion() { * Returns the OS docker is running on. * @return Name of the OS docker is running on */ + @Override public String getOs() { return this.getString("Os"); } @@ -116,6 +121,7 @@ public String getOs() { * Returns the (CPU) architecture docker is running on. * @return The (CPU) architecture docker is running on */ + @Override public String getArch() { return this.getString("Arch"); } @@ -124,6 +130,7 @@ public String getArch() { * Reports whether experimental docker features are enabled. * @return Whether experimental docker features are enabled */ + @Override public boolean isExperimental() { return this.getBoolean("Experimental"); } From 3c196fd0a6d63cfff65b9a3f63a2d41056efa0f8 Mon Sep 17 00:00:00 2001 From: Michael Lux Date: Wed, 19 Feb 2020 16:01:19 +0100 Subject: [PATCH 4/5] Removed is/get method prefixes --- src/main/java/com/amihaiemil/docker/RtVersion.java | 14 +++++++------- src/main/java/com/amihaiemil/docker/Version.java | 14 +++++++------- .../com/amihaiemil/docker/RtVersionTestCase.java | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/amihaiemil/docker/RtVersion.java b/src/main/java/com/amihaiemil/docker/RtVersion.java index a3e83373..37e43287 100644 --- a/src/main/java/com/amihaiemil/docker/RtVersion.java +++ b/src/main/java/com/amihaiemil/docker/RtVersion.java @@ -77,7 +77,7 @@ private static JsonObject fetch(final HttpClient client, final URI uri) * @return Version of connected docker engine */ @Override - public String getVersion() { + public String version() { return this.getString("Version"); } @@ -86,7 +86,7 @@ public String getVersion() { * @return Name of the docker platform */ @Override - public String getPlatformName() { + public String platformName() { return this.getJsonObject("Platform").getString("Name"); } @@ -95,7 +95,7 @@ public String getPlatformName() { * @return API version */ @Override - public String getApiVersion() { + public String apiVersion() { return this.getString("ApiVersion"); } @@ -104,7 +104,7 @@ public String getApiVersion() { * @return Minimum API version */ @Override - public String getMinApiVersion() { + public String minApiVersion() { return this.getString("MinAPIVersion"); } @@ -113,7 +113,7 @@ public String getMinApiVersion() { * @return Name of the OS docker is running on */ @Override - public String getOs() { + public String os() { return this.getString("Os"); } @@ -122,7 +122,7 @@ public String getOs() { * @return The (CPU) architecture docker is running on */ @Override - public String getArch() { + public String arch() { return this.getString("Arch"); } @@ -131,7 +131,7 @@ public String getArch() { * @return Whether experimental docker features are enabled */ @Override - public boolean isExperimental() { + public boolean experimental() { return this.getBoolean("Experimental"); } } diff --git a/src/main/java/com/amihaiemil/docker/Version.java b/src/main/java/com/amihaiemil/docker/Version.java index 6fd7b5ed..eef864b8 100644 --- a/src/main/java/com/amihaiemil/docker/Version.java +++ b/src/main/java/com/amihaiemil/docker/Version.java @@ -12,41 +12,41 @@ public interface Version extends JsonObject { * Returns the version of the connected docker engine. * @return Version of connected docker engine */ - String getVersion(); + String version(); /** * Returns the name of the connected docker platform. * @return Name of the docker platform */ - String getPlatformName(); + String platformName(); /** * Returns the API version of the docker engine. * @return API version */ - String getApiVersion(); + String apiVersion(); /** * Returns the minimum API version of the docker engine. * @return Minimum API version */ - String getMinApiVersion(); + String minApiVersion(); /** * Returns the OS docker is running on. * @return Name of the OS docker is running on */ - String getOs(); + String os(); /** * Returns the (CPU) architecture docker is running on. * @return The (CPU) architecture docker is running on */ - String getArch(); + String arch(); /** * Reports whether experimental docker features are enabled. * @return Whether experimental docker features are enabled */ - boolean isExperimental(); + boolean experimental(); } diff --git a/src/test/java/com/amihaiemil/docker/RtVersionTestCase.java b/src/test/java/com/amihaiemil/docker/RtVersionTestCase.java index 9b187957..58625558 100644 --- a/src/test/java/com/amihaiemil/docker/RtVersionTestCase.java +++ b/src/test/java/com/amihaiemil/docker/RtVersionTestCase.java @@ -47,13 +47,13 @@ public final void queryDockerVersion() throws IOException { }); Docker docker = new LocalDocker(client, "v1.35"); Version version = docker.version(); - assertEquals("19.03.3", version.getVersion()); - assertEquals("Docker Engine - Community", version.getPlatformName()); - assertEquals("1.40", version.getApiVersion()); - assertEquals("1.12", version.getMinApiVersion()); - assertEquals("linux", version.getOs()); - assertEquals("amd64", version.getArch()); - assertTrue(version.isExperimental()); + assertEquals("19.03.3", version.version()); + assertEquals("Docker Engine - Community", version.platformName()); + assertEquals("1.40", version.apiVersion()); + assertEquals("1.12", version.minApiVersion()); + assertEquals("linux", version.os()); + assertEquals("amd64", version.arch()); + assertTrue(version.experimental()); } } From f58d1b033b876baec6e070e1f60c71dc6a94f839 Mon Sep 17 00:00:00 2001 From: Michael Lux Date: Wed, 19 Feb 2020 16:07:10 +0100 Subject: [PATCH 5/5] Method name fixed according to checkstyle rules --- src/main/java/com/amihaiemil/docker/RtVersion.java | 2 +- src/main/java/com/amihaiemil/docker/Version.java | 2 +- src/test/java/com/amihaiemil/docker/RtVersionTestCase.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/amihaiemil/docker/RtVersion.java b/src/main/java/com/amihaiemil/docker/RtVersion.java index 37e43287..fc9718df 100644 --- a/src/main/java/com/amihaiemil/docker/RtVersion.java +++ b/src/main/java/com/amihaiemil/docker/RtVersion.java @@ -113,7 +113,7 @@ public String minApiVersion() { * @return Name of the OS docker is running on */ @Override - public String os() { + public String osName() { return this.getString("Os"); } diff --git a/src/main/java/com/amihaiemil/docker/Version.java b/src/main/java/com/amihaiemil/docker/Version.java index eef864b8..09601a13 100644 --- a/src/main/java/com/amihaiemil/docker/Version.java +++ b/src/main/java/com/amihaiemil/docker/Version.java @@ -36,7 +36,7 @@ public interface Version extends JsonObject { * Returns the OS docker is running on. * @return Name of the OS docker is running on */ - String os(); + String osName(); /** * Returns the (CPU) architecture docker is running on. diff --git a/src/test/java/com/amihaiemil/docker/RtVersionTestCase.java b/src/test/java/com/amihaiemil/docker/RtVersionTestCase.java index 58625558..a69df7bf 100644 --- a/src/test/java/com/amihaiemil/docker/RtVersionTestCase.java +++ b/src/test/java/com/amihaiemil/docker/RtVersionTestCase.java @@ -51,7 +51,7 @@ public final void queryDockerVersion() throws IOException { assertEquals("Docker Engine - Community", version.platformName()); assertEquals("1.40", version.apiVersion()); assertEquals("1.12", version.minApiVersion()); - assertEquals("linux", version.os()); + assertEquals("linux", version.osName()); assertEquals("amd64", version.arch()); assertTrue(version.experimental()); }