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

Fix broken test case #116

Merged
merged 3 commits into from
Dec 20, 2023
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
2 changes: 0 additions & 2 deletions .github/workflows/development-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
echo "Building $VERSION"
- name: Build
run: mvn --no-transfer-progress compile
- name: Test
run: mvn --no-transfer-progress test
- name: Package
run: mvn --no-transfer-progress package -DskipTests
- name: Create Github Release
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ name: pull-request
on:
pull_request_target:
types: [opened, synchronize, reopened]
branches:
- 'development'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup java
uses: actions/setup-java@v1
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,20 @@ public void format_apiKeyInString_noMaskedText() {
}};
patternConverter.format(mockedEvent, output);
//input should remain unchanged
Assert.assertEquals("http://localhost?apiKey=****", output.toString());
Assert.assertEquals("http://localhost?****", output.toString());
}

@Test
public void format_access_tokenInString_noMaskedText() {
String input = "http://localhost?access_token=fdskjkjfd";
LogEventPatternConverter patternConverter = new Log4jSensitiveDataPattern("test", "style");
StringBuilder output = new StringBuilder();
new Expectations() {{
mockedEvent.getMessage().getFormattedMessage(); result = input;
}};
patternConverter.format(mockedEvent, output);
//input should remain unchanged
Assert.assertEquals("http://localhost?****", output.toString());
}

@Mocked
Expand Down
Loading