diff --git a/README.md b/README.md index b9deec7..f9884c0 100644 --- a/README.md +++ b/README.md @@ -53,17 +53,20 @@ Fork this repository to your GitHub account. + Integer, mandatory, no default. + 2. Commit and push the changes to your forked repository. -### Configure Application Properties -1. Change the value of `jira-issue-lottery.config-file-repo` in the `application.properties` file to point to a public repository with a valid config file according to first step in [Configuration section](#configure-jira-lottery) such as `https://github.com/jboss-set/jira-issue-lottery`. ### Create .env File 1. Create a `.env` file in the main directory of your app. -2. Create a Jira Personal Access Token ([Guide on how to create the token](https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html)) -3. Add the following variable to the `.env` file: +2. Add the value of `%DEV_JIRA_ISSUE_LOTTERY_CONFIG_FILE_REPO` in the `.env` file to point to a public repository with a valid config file according to first step in [Configuration section](#configure-jira-lottery) such as `https://github.com/jboss-set/jira-issue-lottery`. + ```env + %DEV_JIRA_ISSUE_LOTTERY_CONFIG_FILE_REPO= +> **NOTE** This will override the default value of specified in `application.properties` file. If you override the value for all modes (dev, test, prod, when you don't prepend a mode, such as `%dev`), then one of the tests will fail, as it expects the original value. +3. Create a Jira Personal Access Token ([Guide on how to create the token](https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html)) +4. Add the following variable to the `.env` file: ```env - jira-issue-lottery.access-token= + JIRA_ISSUE_LOTTERY_ACCESS_TOKEN= QUARKUS_MAILER_FROM= QUARKUS_MAILER_USERNAME= QUARKUS_MAILER_PASSWORD= diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index ae69b8e..3895f4f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ camel.component.jira.jira-url=https://issues.redhat.com/ %test.jira-issue-lottery.access-token=ignored -jira-issue-lottery.config-file-repo=https://github.com/The-Huginn/jira-issue-lottery jira-issue-lottery.max-results=1000 +jira-issue-lottery.config-file-repo=https://github.com/jboss-set/jira-issue-lottery quarkus.kubernetes.deployment-kind=cron-job # Cron expression to run the job every Monday see https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#writing-a-cronjob-spec quarkus.kubernetes.cron-job.schedule=0 0 * * 1 diff --git a/src/test/java/org/jboss/set/draw/LotteryDrawingTest.java b/src/test/java/org/jboss/set/draw/LotteryDrawingTest.java index 3343321..ba614e6 100644 --- a/src/test/java/org/jboss/set/draw/LotteryDrawingTest.java +++ b/src/test/java/org/jboss/set/draw/LotteryDrawingTest.java @@ -148,9 +148,11 @@ public void testAppendingRepositoryForUnsubcription() throws Exception { List sent = mailbox.getMailsSentTo(email); assertEquals(1, sent.size()); - // Check directly for this URL as we know it is valid one. Using templates might result in a corrupted URL overall - assertTrue(sent.get(0).getText() - .contains("https://github.com/The-Huginn/jira-issue-lottery/blob/main/.github/jira-issue-lottery.yml")); + String emailText = sent.get(0).getText(); + + //Checks only if email message is correctly formatted. The URL is only for test purpose and may be invalid. + String expectedUrl = "https://github.com/jboss-set/jira-issue-lottery/blob/main/.github/jira-issue-lottery.yml"; + assertTrue(emailText.contains(expectedUrl)); } @Test