From c201d42430b807817ba26b8a75030573a356cbab Mon Sep 17 00:00:00 2001 From: Jamie Townsend Date: Thu, 8 Jul 2021 18:21:02 +0200 Subject: [PATCH 1/4] Create maven.yml --- .github/workflows/maven.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/maven.yml 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 From 1964187528bacd8421d48ac9628826de211c7a36 Mon Sep 17 00:00:00 2001 From: Jamie Townsend Date: Thu, 8 Jul 2021 18:21:02 +0200 Subject: [PATCH 2/4] Enable automatic builds on github --- .github/workflows/maven.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/maven.yml 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 From d102352a41123ecb13ea3279cad29adf828e2357 Mon Sep 17 00:00:00 2001 From: Jamie Townsend Date: Thu, 8 Jul 2021 18:37:45 +0200 Subject: [PATCH 3/4] Add support for JUnit tests --- pom.xml | 21 +++++++++++++++++++ .../java/com/clickntap/vimeo/VimeoTest.java | 13 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/test/java/com/clickntap/vimeo/VimeoTest.java 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/test/java/com/clickntap/vimeo/VimeoTest.java b/src/test/java/com/clickntap/vimeo/VimeoTest.java new file mode 100644 index 0000000..17666e9 --- /dev/null +++ b/src/test/java/com/clickntap/vimeo/VimeoTest.java @@ -0,0 +1,13 @@ +package com.clickntap.vimeo; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +public class VimeoTest { + + @Test + void testJUnit() { + assertTrue(true); + } +} From f8449d53940d14ae61e2049312f2468de3aa68ab Mon Sep 17 00:00:00 2001 From: Jamie Townsend Date: Fri, 9 Jul 2021 13:54:37 +0200 Subject: [PATCH 4/4] Query Parameters not being passed to GET requests --- src/main/java/com/clickntap/vimeo/Vimeo.java | 21 ++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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