diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..68b79a0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "gradle" + directory: "/" # Location of package manifests + schedule: + interval: "monthly" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..c1491bb --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,32 @@ +name: build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: corretto + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: wrapper + + - name: Execute Gradle Build + run: ./gradlew clean build --scan diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/src/test/java/uk/co/conoregan/watch2getherapi/Watch2GetherApiTest.java b/src/test/java/uk/co/conoregan/watch2getherapi/Watch2GetherApiTest.java index a8de4d8..c9a93bc 100644 --- a/src/test/java/uk/co/conoregan/watch2getherapi/Watch2GetherApiTest.java +++ b/src/test/java/uk/co/conoregan/watch2getherapi/Watch2GetherApiTest.java @@ -17,8 +17,14 @@ import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; import static org.junit.jupiter.api.Assertions.assertNotNull; +/** + * Tests for {@link Watch2GetherApi}. + */ @WireMockTest public class Watch2GetherApiTest { + /** + * Tests {@link Watch2GetherApi#createRoom(String, String, Integer)} with an expected result. + */ @Test public void testCreateRoom(WireMockRuntimeInfo wmRuntimeInfo) throws W2GException, IOException { String responseBody = TestUtils.readTestFile("api_responses/create_room.json"); @@ -29,6 +35,9 @@ public void testCreateRoom(WireMockRuntimeInfo wmRuntimeInfo) throws W2GExceptio assertNotNull(createRoomResponse); } + /** + * Tests {@link Watch2GetherApi#shareItem(String, String)} with an expected result. + */ @Test public void testShareItem(WireMockRuntimeInfo wmRuntimeInfo) throws W2GException { String streamKey = "streamKey"; @@ -38,6 +47,9 @@ public void testShareItem(WireMockRuntimeInfo wmRuntimeInfo) throws W2GException api.shareItem(streamKey, "https://www.youtube.com/watch?v=dQw4w9WgXcQ"); } + /** + * Tests {@link Watch2GetherApi#addToPlaylist(String, List)} with an expected result. + */ @Test public void testAddToPlaylist(WireMockRuntimeInfo wmRuntimeInfo) throws W2GException { String streamKey = "streamKey";