@@ -0,0 +1,2510 @@
+/** See the file %22LICENSE%22 for the full license governing this code. */%0A%0Apackage au.org.ands.vocabs.toolkit.test.utils;%0A%0Aimport java.lang.invoke.MethodHandles;%0Aimport java.net.URL;%0A%0Aimport javax.ws.rs.client.Client;%0Aimport javax.ws.rs.client.WebTarget;%0Aimport javax.ws.rs.core.MediaType;%0Aimport javax.ws.rs.core.Response;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport au.org.ands.vocabs.toolkit.utils.ToolkitNetUtils;%0A%0A/** Utility methods for testing the toolkit as a remote client. */%0Apublic final class NetClientUtils %7B%0A%0A    /** Logger for this class. */%0A    private static Logger logger;%0A%0A    static %7B%0A        logger = LoggerFactory.getLogger(%0A                MethodHandles.lookup().lookupClass());%0A    %7D%0A%0A    /** Private constructor for a utility class. */%0A    private NetClientUtils() %7B%0A    %7D%0A%0A    /** Perform a GET request of a remote server. No MediaType is%0A     * specified in the request.%0A     * @param baseURL The base URL of the server.%0A     * @param path The path to the request; appended to %7B@code baseURL%7D.%0A     * @return The response from the GET request. It is the responsibility%0A     * of the caller to invoke the %7B@code close()%7D method on the response.%0A     */%0A    public static Response doGet(final URL baseURL,%0A            final String path) %7B%0A        logger.info(%22doGet: baseURL = %22 + baseURL + %22; path = %22 + path);%0A        Client client = ToolkitNetUtils.getClient();%0A        WebTarget target = client.target(baseURL.toString()).%0A                path(path);%0A        Response response = target.request().get();%0A        return response;%0A    %7D%0A%0A    /** Perform a GET request of a remote server.%0A     * @param baseURL The base URL of the server.%0A     * @param path The path to the request; appended to %7B@code baseURL%7D.%0A     * @param responseMediaType The MediaType to be requested of the server.%0A     * @return The response from the GET request. It is the responsibility%0A     * of the caller to invoke the %7B@code close()%7D method on the response.%0A     */%0A    public static Response doGet(final URL baseURL,%0A            final String path, final MediaType responseMediaType) %7B%0A        logger.info(%22doGet: baseURL = %22 + baseURL + %22; path = %22 + path%0A                + %22; responseMediaType = %22 + responseMediaType);%0A        Client client = ToolkitNetUtils.getClient();%0A        WebTarget target = client.target(baseURL.toString()).%0A                path(path);%0A        Response response =%0A                target.request(responseMediaType).get();%0A        return response;%0A    %7D%0A%0A%7D%0A

Add NetClientUtils class for testing