Skip to content

Commit

Permalink
Merge pull request #31 from gsmet/test-branches
Browse files Browse the repository at this point in the history
Add a test for Branches
  • Loading branch information
gsmet authored Dec 15, 2023
2 parents 78b43ef + 016bcaa commit 284ac1c
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/test/java/io/quarkus/bot/release/BranchesTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package io.quarkus.bot.release;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

import io.quarkus.bot.release.util.Branches;
import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest
public class BranchesTest {

@Test
void testPreviewRelease() {
ReleaseInformation releaseInformation = new ReleaseInformation("3.6.0.CR1", "3.6", "CR1", false);

assertThat(Branches.getPlatformPreparationBranch(releaseInformation)).isEqualTo(Branches.MAIN);
assertThat(Branches.getPlatformReleaseBranch(releaseInformation)).isEqualTo(Branches.MAIN);
}

@Test
void testFirstFinalRelease() {
ReleaseInformation releaseInformation = new ReleaseInformation("3.6.0", "3.6", null, false);

assertThat(Branches.getPlatformPreparationBranch(releaseInformation)).isEqualTo(Branches.MAIN);
assertThat(Branches.getPlatformReleaseBranch(releaseInformation)).isEqualTo("3.6");
}

@Test
void testBugfixFinalRelease() {
ReleaseInformation releaseInformation = new ReleaseInformation("3.6.1", "3.6", null, false);

assertThat(Branches.getPlatformPreparationBranch(releaseInformation)).isEqualTo("3.6");
assertThat(Branches.getPlatformReleaseBranch(releaseInformation)).isEqualTo("3.6");
}
}

0 comments on commit 284ac1c

Please sign in to comment.