Unblu logo

Unit test example files

When the unit tests are running, the GitLab server is mocked. Wiremock is serving example responses from the src/test/resources/gitlab_template_json folder.

Those files can be generated by the code in the ResetTestExampleFilesMain class.

  • Adjust the location of the GitLab server (URL constant). It can be a local GitLab instance or a remote one like gitlab.com.

  • Adjust the access token (TOKEN constant)

  • The Webhook event is received on a server running on localhost:9999 (started by ResetTestExampleFilesMain).

    • If this server is not accessible by GitLab, start a tool like ngrok (with ngrok http 9999) and adjust the hook server value (HOOK_URL constant)

    • If you decide to use http://localhost:9999 for HOOK_URL (without ngrok), then you might need to change a setting in your local GitLab instance (see Allow webhook and service requests to local network).

    • If your gitlab instance is running in a docker container, be sure to run ResetTestExampleFilesMain in docker as well or make the host network available for the containers.