diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..1531e21 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,25 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Java CI with Maven + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + - name: Build with Maven + run: mvn -B package --file pom.xml diff --git a/pom.xml b/pom.xml index ed6eb25..5510dab 100644 --- a/pom.xml +++ b/pom.xml @@ -75,6 +75,19 @@ json 20180813 + + + org.junit.jupiter + junit-jupiter-api + 5.7.2 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.7.2 + test + @@ -130,6 +143,14 @@ deploy + + maven-surefire-plugin + 2.22.2 + + + maven-failsafe-plugin + 2.22.2 + diff --git a/src/main/java/com/clickntap/vimeo/Vimeo.java b/src/main/java/com/clickntap/vimeo/Vimeo.java index 3da1620..71be026 100644 --- a/src/main/java/com/clickntap/vimeo/Vimeo.java +++ b/src/main/java/com/clickntap/vimeo/Vimeo.java @@ -7,6 +7,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLEncoder; import java.util.ArrayList; @@ -27,6 +28,7 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.client.utils.URIBuilder; import org.apache.http.entity.ContentType; import org.apache.http.entity.InputStreamEntity; import org.apache.http.impl.client.CloseableHttpClient; @@ -109,7 +111,7 @@ public VimeoResponse addVideoPrivacyDomain(String videoEndpoint, String domain) } public VimeoResponse getVideoPrivacyDomains(String videoEndpoint) throws IOException { - return apiRequest(new StringBuffer(videoEndpoint).append("/privacy/domains").toString(), HttpGet.METHOD_NAME, null, null); + return apiRequest(new StringBuffer(videoEndpoint).append("/privacy/domains").toString(), HttpGet.METHOD_NAME, null, null); } public VimeoResponse removeVideo(String videoEndpoint) throws IOException { @@ -291,8 +293,8 @@ protected VimeoResponse apiRequest(String endpoint, String methodName, Map postParameters = new ArrayList(); if (params != null) { - ArrayList postParameters = new ArrayList(); for (String key : params.keySet()) { postParameters.add(new BasicNameValuePair(key, params.get(key))); } @@ -301,6 +303,21 @@ protected VimeoResponse apiRequest(String endpoint, String methodName, Map