Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub workflows #3

Merged
merged 4 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
32 changes: 32 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -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
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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";
Expand All @@ -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";
Expand Down