// Path: src/main/java/com/tomtom/services/configuration/dto/VersionDTO.java
// @SuppressWarnings({"EqualsWhichDoesntCheckParameterClass", "squid:S2160"})
// @JsonInclude(Include.NON_EMPTY)
// @XmlRootElement(name = "version")
// @XmlAccessorType(XmlAccessType.FIELD)
// public final class VersionDTO extends ApiDTO {
//     public static final int API_VERSION_MAX_LENGTH = 25;
//     public static final int API_VERSION_MIN_LENGTH = 0;
// 
//     /**
//      * Version string of service. No assumptions can be made on its format.
//      */
//     @JsonProperty("version")
//     @XmlElement(name = "version")
//     @Nullable
//     private String version;
// 
//     /**
//      * The URI of the startup configuration, which was read during startup of the service.
//      * If not start configuration was specified, this element is empty.
//      */
//     @XmlElement(name = "startupConfigurationURI")
//     @Nullable
//     private String startupConfigurationURI;
// 
//     public VersionDTO(
//             @Nonnull final String version,
//             @Nullable final String startupConfigurationURI) {
//         super();
//         setVersion(version);
//         setStartupConfigurationURI(startupConfigurationURI);
//     }
// 
//     @SuppressWarnings({"UnusedDeclaration", "squid:MissingDeprecatedCheck", "squid:S1133"})
//     @Deprecated
//     VersionDTO() {
//         // Default constructor required by JAX-B.
//         super();
//     }
// 
//     /**
//      * For an explanation of validate(), see {@link NodeDTO}.
//      */
//     @Override
//     public void validate() {
//         validator().start();
//         validator().checkString(true, "version", version,
//                 API_VERSION_MIN_LENGTH, API_VERSION_MAX_LENGTH);
//         validator().checkString(false, "startupConfigurationURI", startupConfigurationURI,
//                 0, Integer.MAX_VALUE);
//         validator().done();
//     }
// 
//     @Nonnull
//     public String getVersion() {
//         beforeGet();
//         //noinspection ConstantConditions
//         return version;                             // Cannot be null after validation.
//     }
// 
//     public void setVersion(@Nonnull final String version) {
//         beforeSet();
//         this.version = StringUtils.trim(version);
//     }
// 
//     @Nullable
//     public String getStartupConfigurationURI() {
//         beforeGet();
//         return startupConfigurationURI;
//     }
// 
//     public void setStartupConfigurationURI(@Nullable final String startupConfigurationURI) {
//         beforeSet();
//         this.startupConfigurationURI = StringUtils.emptyToNull(StringUtils.trim(startupConfigurationURI));
//     }
// }


import com.google.gson.Gson;
import com.tomtom.services.configuration.dto.VersionDTO;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
    }

    @Test
    public void checkStatusOK() {
        LOG.info("checkStatusOK");
        final Response r = new ResteasyClientBuilder().build().
                target(server.getHost() + "/status").
                request().
                get();
        Assert.assertNotNull(r);
        final int status = r.getStatus();
        LOG.info("status = {}", status);
        Assert.assertEquals(200, status);
    }

    @Test
    public void checkVersionWithParameters() {
        LOG.info("checkVersionWithParameters");
        final Response r = new ResteasyClientBuilder().build().
                target(server.getHost() + "/version?x=1&y=2").
                request().
                get();
        Assert.assertNotNull(r);
        final int status = r.getStatus();
        LOG.info("status = {}", status);
        Assert.assertEquals(200, status);
        final String s = r.readEntity(String.class);
        Assert.assertEquals("{\"version\":\"1.0.0-TEST\",\"startupConfigurationURI\":\"classpath:example.json\"}",
                s);

// Path: src/main/java/com/tomtom/services/configuration/dto/VersionDTO.java
// @SuppressWarnings({"EqualsWhichDoesntCheckParameterClass", "squid:S2160"})
// @JsonInclude(Include.NON_EMPTY)
// @XmlRootElement(name = "version")
// @XmlAccessorType(XmlAccessType.FIELD)
// public final class VersionDTO extends ApiDTO {
//     public static final int API_VERSION_MAX_LENGTH = 25;
//     public static final int API_VERSION_MIN_LENGTH = 0;
// 
//     /**
//      * Version string of service. No assumptions can be made on its format.
//      */
//     @JsonProperty("version")
//     @XmlElement(name = "version")
//     @Nullable
//     private String version;
// 
//     /**
//      * The URI of the startup configuration, which was read during startup of the service.
//      * If not start configuration was specified, this element is empty.
//      */
//     @XmlElement(name = "startupConfigurationURI")
//     @Nullable
//     private String startupConfigurationURI;
// 
//     public VersionDTO(
//             @Nonnull final String version,
//             @Nullable final String startupConfigurationURI) {
//         super();
//         setVersion(version);
//         setStartupConfigurationURI(startupConfigurationURI);
//     }
// 
//     @SuppressWarnings({"UnusedDeclaration", "squid:MissingDeprecatedCheck", "squid:S1133"})
//     @Deprecated
//     VersionDTO() {
//         // Default constructor required by JAX-B.
//         super();
//     }
// 
//     /**
//      * For an explanation of validate(), see {@link NodeDTO}.
//      */
//     @Override
//     public void validate() {
//         validator().start();
//         validator().checkString(true, "version", version,
//                 API_VERSION_MIN_LENGTH, API_VERSION_MAX_LENGTH);
//         validator().checkString(false, "startupConfigurationURI", startupConfigurationURI,
//                 0, Integer.MAX_VALUE);
//         validator().done();
//     }
// 
//     @Nonnull
//     public String getVersion() {
//         beforeGet();
//         //noinspection ConstantConditions
//         return version;                             // Cannot be null after validation.
//     }
// 
//     public void setVersion(@Nonnull final String version) {
//         beforeSet();
//         this.version = StringUtils.trim(version);
//     }
// 
//     @Nullable
//     public String getStartupConfigurationURI() {
//         beforeGet();
//         return startupConfigurationURI;
//     }
// 
//     public void setStartupConfigurationURI(@Nullable final String startupConfigurationURI) {
//         beforeSet();
//         this.startupConfigurationURI = StringUtils.emptyToNull(StringUtils.trim(startupConfigurationURI));
//     }
// }


// Path: src/test/java/com/tomtom/services/configuration/implementation/ApiHelperMethodsTest.java
import com.google.gson.Gson;
import com.tomtom.services.configuration.dto.VersionDTO;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

    }

    @Test
    public void checkStatusOK() {
        LOG.info("checkStatusOK");
        final Response r = new ResteasyClientBuilder().build().
                target(server.getHost() + "/status").
                request().
                get();
        Assert.assertNotNull(r);
        final int status = r.getStatus();
        LOG.info("status = {}", status);
        Assert.assertEquals(200, status);
    }

    @Test
    public void checkVersionWithParameters() {
        LOG.info("checkVersionWithParameters");
        final Response r = new ResteasyClientBuilder().build().
                target(server.getHost() + "/version?x=1&y=2").
                request().
                get();
        Assert.assertNotNull(r);
        final int status = r.getStatus();
        LOG.info("status = {}", status);
        Assert.assertEquals(200, status);
        final String s = r.readEntity(String.class);
        Assert.assertEquals("{\"version\":\"1.0.0-TEST\",\"startupConfigurationURI\":\"classpath:example.json\"}",
                s);

        final VersionDTO x = new Gson().fromJson(s, VersionDTO.class);