File tree Expand file tree Collapse file tree
core/src/test/java/io/snyk/plugins/artifactory/scanner Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,15 +10,16 @@ jobs:
1010 runs-on : ubuntu-latest
1111 steps :
1212 - name : Fetch sources
13- uses : actions/checkout@v2
13+ uses : actions/checkout@v4
1414
1515 - name : Setup JDK 17
16- uses : actions/setup-java@v1
16+ uses : actions/setup-java@v4
1717 with :
18+ distribution : ' temurin'
1819 java-version : 17
1920
2021 - name : Cache local Maven repository
21- uses : actions/cache@v2
22+ uses : actions/cache@v4
2223 with :
2324 path : |
2425 ~/.m2/repository
2829
2930 - name : Configure build metadata
3031 id : metadata
31- run : echo ::set-output name= tag:: ${GITHUB_REF/refs\/tags\//}
32+ run : echo " tag= ${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
3233
3334 - name : Build plugin
3435 env :
Original file line number Diff line number Diff line change @@ -13,15 +13,16 @@ jobs:
1313
1414 steps :
1515 - name : Fetch sources
16- uses : actions/checkout@v2
16+ uses : actions/checkout@v4
1717
1818 - name : Setup JDK 17
19- uses : actions/setup-java@v1
19+ uses : actions/setup-java@v4
2020 with :
21+ distribution : ' temurin'
2122 java-version : 17
2223
2324 - name : Cache local Maven repository
24- uses : actions/cache@v2
25+ uses : actions/cache@v4
2526 with :
2627 path : |
2728 ~/.m2/repository
3132
3233 - name : Configure build metadata
3334 id : metadata
34- run : echo ::set-output name= tag:: 1.0.0
35+ run : echo " tag= 1.0.0" >> $GITHUB_OUTPUT
3536
3637 - name : Build plugin
3738 env :
Original file line number Diff line number Diff line change 88 runs-on : ubuntu-latest
99 strategy :
1010 matrix :
11- java : [17, 20 ]
11+ java : [17, 21 ]
1212 steps :
1313 - name : Fetch sources
14- uses : actions/checkout@v2
14+ uses : actions/checkout@v4
1515
1616 - name : Setup JDK ${{ matrix.java }}
17- uses : actions/setup-java@v1
17+ uses : actions/setup-java@v4
1818 with :
19+ distribution : ' temurin'
1920 java-version : ${{ matrix.java }}
2021
2122 - name : Cache local Maven repository
22- uses : actions/cache@v2
23+ uses : actions/cache@v4
2324 with :
2425 path : |
2526 ~/.m2/repository
Original file line number Diff line number Diff line change 1515import java .util .Properties ;
1616
1717import static io .snyk .plugins .artifactory .configuration .PluginConfiguration .API_ORGANIZATION ;
18+ import static org .assertj .core .api .Assertions .assertThat ;
1819import static org .junit .jupiter .api .Assertions .*;
1920import static org .mockito .Mockito .mock ;
2021import static org .mockito .Mockito .when ;
@@ -39,7 +40,9 @@ void shouldTestPipPackage() throws Exception {
3940 when (fileLayoutInfo .getBaseRevision ()).thenReturn ("1.25.7" );
4041
4142 TestResult result = scanner .scan (fileLayoutInfo , repoPath );
42- assertEquals (6 , result .getVulnSummary ().getTotalCount ());
43+ assertThat (result .getVulnSummary ().getTotalCount ())
44+ .isGreaterThanOrEqualTo (7 )
45+ .withFailMessage ("As of 2025-10-03 urllib3@1.25.7 should have at least 7 vulns" );
4346 assertEquals ("https://security.snyk.io/package/pip/urllib3/1.25.7" , result .getDetailsUrl ().toString ());
4447 }
4548
Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ void whenAValidPackage() {
4242 when (repoPath .getPath ()).thenReturn ("OpenSSL/OpenSSL/tags/1.0.2/OpenSSL-1.0.2.tar.gz" );
4343
4444 TestResult result = scanner .scan (fileLayoutInfo , repoPath );
45- assertThat (result .getVulnSummary ().getCountAtOrAbove (Severity .MEDIUM )).isGreaterThanOrEqualTo (63 );
45+ assertThat (result .getVulnSummary ().getCountAtOrAbove (Severity .MEDIUM ))
46+ .isGreaterThanOrEqualTo (63 )
47+ .withFailMessage ("As of 2025-10-03 OpenSSL@1.0.2 should have at least 63 medium+ vulns" );
4648 assertThat (result .getDetailsUrl ().toString ()).isEqualTo ("https://security.snyk.io/package/cocoapods/OpenSSL/1.0.2" );
4749 }
4850}
Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ void whenAValidNugetPackage() {
4242 when (repoPath .getName ()).thenReturn ("newtonsoft.json.13.0.0.nupkg" );
4343
4444 TestResult result = scanner .scan (fileLayoutInfo , repoPath );
45- assertThat (result .getVulnSummary ().getCountAtOrAbove (Severity .MEDIUM )).isGreaterThanOrEqualTo (1 );
45+ assertThat (result .getVulnSummary ().getCountAtOrAbove (Severity .MEDIUM ))
46+ .isGreaterThanOrEqualTo (1 )
47+ .withFailMessage ("As of 2025-10-03 newtonsoft.json@13.0.0 should have at least 1 medium+ vuln" );
4648 assertThat (result .getDetailsUrl ().toString ()).isEqualTo ("https://security.snyk.io/package/nuget/newtonsoft.json/13.0.0" );
4749 }
4850
Original file line number Diff line number Diff line change @@ -43,7 +43,9 @@ void whenAValidGemPackage() {
4343 when (repoPath .getName ()).thenReturn ("sinatra-2.0.0.gem" );
4444
4545 TestResult result = scanner .scan (fileLayoutInfo , repoPath );
46- assertThat (result .getVulnSummary ().getCountAtOrAbove (Severity .MEDIUM )).isGreaterThanOrEqualTo (5 );
46+ assertThat (result .getVulnSummary ().getCountAtOrAbove (Severity .MEDIUM ))
47+ .isGreaterThanOrEqualTo (5 )
48+ .withFailMessage ("As of 2025-10-03 sinatra@2.0.0 should have at least 5 medium+ vulns" );
4749 assertThat (result .getDetailsUrl ().toString ()).isEqualTo ("https://security.snyk.io/package/rubygems/sinatra/2.0.0" );
4850 }
4951
You can’t perform that action at this time.
0 commit comments