Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: adjust RepositoryServiceTest.testInvalidBranch #400

Merged
merged 2 commits into from
Mar 19, 2024
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
7 changes: 1 addition & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
name: Application build and test
on:
push:
branches:
- "main"
pull_request_target:
branches:
- "main"

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand All @@ -32,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
if: |
github.actor != 'dependabot[bot]' ||
(github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target')
(github.actor == 'dependabot[bot]' && github.ref != 'refs/heads/main')
outputs:
has_changes: ${{ steps.changed-files.outputs.any_changed }}
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ void testCommandCreation() {

@ParameterizedTest
@CsvSource({
"heubeck/examiner, refs/heads/main, pom.xml",
"jug-in/jug-in.bayern, refs/heads/master, README.md",
"heubeck/examiner, refs/heads/main, pom.xml",
"jug-in/jug-in.bayern, refs/heads/master, README.md",
"jug-in/jug-in.bayern, refs/heads/gh-pages, index.html"
})
void testSuccessfulCheckout(String repoName, String branch, String checkFile) throws IOException {
Expand Down Expand Up @@ -82,9 +82,12 @@ void testInvalidBranch() throws IOException {


// Then
assertThat(result).isInstanceOfSatisfying(Result.Failure.class, failure -> {
assertThat(failure.cause().toString()).hasToString("org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/heubeck/examiner/zipball/never/ever 404: Not Found");
});
assertThat(result).isInstanceOfSatisfying(Result.Failure.class, failure ->
assertThat(failure.cause().toString())
.startsWith("org.kohsuke.github.GHFileNotFoundException: https://")
.contains("/heubeck/examiner/")
.endsWith("/never/ever 404: Not Found")
);
}

}
Loading