-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from The-Huginn/issue-54
Don't require components field in config file
- Loading branch information
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,6 +164,34 @@ public void testAssigningOneIssue() throws Exception { | |
assertEquals(Lottery.createEmailText(email, List.of(ourIssues.get(0))), sent.get(0).getText()); | ||
} | ||
|
||
@Test | ||
public void testAssigningOneIssueOnlyProjectDefined() throws Exception { | ||
String email = "[email protected]"; | ||
String configFile = """ | ||
delay: P14D | ||
participants: | ||
- email: [email protected] | ||
days: [MONDAY] | ||
projects: | ||
- project: WFLY | ||
maxIssues: 5"""; | ||
|
||
LotteryConfig testLotteryConfig = objectMapper.readValue(configFile, LotteryConfig.class); | ||
when(lotteryConfigProducer.getLotteryConfig()).thenReturn(testLotteryConfig); | ||
|
||
StringWriter sw = new StringWriter(); | ||
CommandLine cmd = new CommandLine(app); | ||
cmd.setOut(new PrintWriter(sw)); | ||
|
||
int exitCode = cmd.execute(); | ||
assertEquals(0, exitCode); | ||
|
||
List<Mail> sent = mailbox.getMailsSentTo(email); | ||
assertEquals(1, sent.size()); | ||
assertEquals(Lottery.EMAIL_SUBJECT, sent.get(0).getSubject()); | ||
assertEquals(Lottery.createEmailText(email, List.of(ourIssues.get(0))), sent.get(0).getText()); | ||
} | ||
|
||
@Test | ||
public void testAssigningAllIssues() throws Exception { | ||
String email = "[email protected]"; | ||
|