Skip to content
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
60 changes: 60 additions & 0 deletions .github/workflows/verify-examples-and-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Verify Examples and Integration Tests
on:
pull_request:
branches:
- 'main'
jobs:
detect-changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
examples: ${{ steps.filter.outputs.examples }}
integration-tests: ${{ steps.filter.outputs.integration-tests }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
examples:
- 'examples/**'
integration-tests:
- 'tests/integration/**'

verify-examples:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.examples == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: verify examples
working-directory: examples
run: |
mvn verify \
-Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \
-Dcom.expediagroup.xapjavasdk.apisecret="${{ secrets.API_SECRET }}" \
-Dcom.expediagroup.xapjavasdk.vrbokey="${{ secrets.VRBO_KEY }}" \
-Dcom.expediagroup.xapjavasdk.vrbosecret="${{ secrets.VRBO_SECRET }}" \

verify-integration-tests:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.integration-tests == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: verify integration tests
working-directory: tests/integration
run: |
mvn verify \
-Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \
-Dcom.expediagroup.xapjavasdk.apisecret="${{ secrets.API_SECRET }}" \
-Dcom.expediagroup.xapjavasdk.vrbokey="${{ secrets.VRBO_KEY }}" \
-Dcom.expediagroup.xapjavasdk.vrbosecret="${{ secrets.VRBO_SECRET }}"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ and less on the technical details of the API.
You can find code examples for multiple use cases in the [examples](examples) directory.

### Integration Tests
Integration tests are placed in the [integrations](integrations) directory.
Integration tests are placed in the [integrations](tests/integration) directory.

---

Expand All @@ -27,4 +27,4 @@ If you have any questions or need help with XAP, please refer to the
[XAP Support](https://developers.expediagroup.com/xap/support) page.

If you experience any issues with the SDK, please raise an issue on the
[GitHub repository](https://github.com/ExpediaGroup/xap-java-sdk/issues).
[GitHub repository](https://github.com/ExpediaGroup/xap-java-sdk/issues).
2 changes: 1 addition & 1 deletion integrations/README.md → tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ account manager.

## License

This project is licensed under the Apache License v2.0 - see the [LICENSE](../LICENSE) for details.
This project is licensed under the Apache License v2.0 - see the [LICENSE](../../LICENSE) for details.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Extension for setting up the required components for testing.
*/
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public abstract class XapIT {
public abstract class XapIntegrationTests {

protected static XapClient xapClient;
protected static XapClient mockClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* This class is used to test the integration of the Lodging Availability Calendars API.
*/
public class AvailabilityCalendarsIT extends VrboIT {
public class AvailabilityCalendarsIntegrationTests extends VrboIntegrationTests {

@Test
public void testRequest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import com.expediagroup.sdk.core.model.Response;
import com.expediagroup.sdk.xap.integrations.common.Constant;
import com.expediagroup.sdk.xap.integrations.common.XapIT;
import com.expediagroup.sdk.xap.integrations.common.XapIntegrationTests;
import com.expediagroup.sdk.xap.models.AgeClassRestriction;
import com.expediagroup.sdk.xap.models.BedType;
import com.expediagroup.sdk.xap.models.CancellationPolicy;
Expand Down Expand Up @@ -62,7 +62,7 @@
/**
* This class is used to test the integration of the Lodging Listings API.
*/
public class ListingsIT extends XapIT {
public class ListingsIntegrationTests extends XapIntegrationTests {

@Test
public void testRequest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* This class is used to test the integration of the Lodging Quotes API.
*/
public class QuotesIT extends VrboIT {
public class QuotesIntegrationTests extends VrboIntegrationTests {

@Test
public void testRequest() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.expediagroup.sdk.xap.integrations.lodging;

import com.expediagroup.sdk.xap.client.XapClient;
import com.expediagroup.sdk.xap.integrations.common.XapIT;
import com.expediagroup.sdk.xap.integrations.common.XapIntegrationTests;
import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.BeforeAll;

/**
* Extension for setting up the required components for testing, specifically for Vrbo.
*/
public abstract class VrboIT extends XapIT {
public abstract class VrboIntegrationTests extends XapIntegrationTests {

@BeforeAll
static void vrboSetup() {
Expand Down
Loading