File tree Expand file tree Collapse file tree 6 files changed +24
-12
lines changed
src/main/java/com/switcherapi/client/test Expand file tree Collapse file tree 6 files changed +24
-12
lines changed Original file line number Diff line number Diff line change 3434 strategy :
3535 fail-fast : false
3636 matrix :
37- java : ['11', ' 17', '21', '25']
37+ java : ['17', '21', '25']
3838 os : [ubuntu-latest, windows-latest]
3939 runs-on : ${{ matrix.os }}
4040
Original file line number Diff line number Diff line change 1010 strategy :
1111 fail-fast : false
1212 matrix :
13- java : ['11', ' 17', '21', '25']
13+ java : ['17', '21', '25']
1414 os : [ubuntu-latest, windows-latest]
1515 runs-on : ${{ matrix.os }}
1616
4747 uses : actions/setup-java@v5
4848 with :
4949 distribution : ' temurin'
50- java-version : ' 11 '
50+ java-version : ' 17 '
5151 server-id : central
5252 server-username : CENTRAL_USERNAME
5353 server-password : CENTRAL_TOKEN
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ A Java SDK for Switcher API
99<div align =" center " >
1010
1111[ ![ Master CI] ( https://github.com/switcherapi/switcher-client-java/actions/workflows/master-2.yml/badge.svg )] ( https://github.com/switcherapi/switcher-client-java/actions/workflows/master-2.yml )
12- [ ![ Quality Gate Status] ( https://sonarcloud.io/api/project_badges/measure?project=switcherapi_switcher-client&metric=alert_status )] ( https://sonarcloud.io/dashboard ?id=switcherapi_switcher-client )
12+ [ ![ Quality Gate Status] ( https://sonarcloud.io/api/project_badges/measure?project=switcherapi_switcher-client&branch=master-2&& metric=alert_status )] ( https://sonarcloud.io/summary/overall ?id=switcherapi_switcher-client&branch=master-2 )
1313[ ![ Known Vulnerabilities] ( https://snyk.io/test/github/switcherapi/switcher-client-java/badge.svg?targetFile=pom.xml )] ( https://snyk.io/test/github/switcherapi/switcher-client-java?targetFile=pom.xml )
1414[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT )
1515[ ![ Maven Central] ( https://img.shields.io/maven-central/v/com.switcherapi/switcher-client.svg?label=Maven%20Central )] ( https://central.sonatype.com/artifact/com.switcherapi/switcher-client )
@@ -44,9 +44,9 @@ https://github.com/switcherapi/switcher-api
4444</dependency >
4545```
4646
47- ### Compatibility with Jakarta EE 9
48- Use SDK v1.x for applications not using Jakarta EE 9.<br >
49- Use SDK v2.x for Jakarta EE 9 based applications.
47+ ### Compatibility with Jakarta EE 9 and Java versions
48+ Use SDK v1.x for applications not using Jakarta EE 9 (requires Java 8+) .<br >
49+ Use SDK v2.x for Jakarta EE 9+ based applications (requires Java 17+) .
5050
5151## Client Context Properties - SwitcherContext
5252
Original file line number Diff line number Diff line change 4646 <properties >
4747 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
4848 <project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
49- <java .version>11 </java .version>
49+ <java .version>17 </java .version>
5050 <maven .compiler.source>${java.version} </maven .compiler.source>
5151 <maven .compiler.target>${java.version} </maven .compiler.target>
5252 <argLine />
5858 <slf4j-api .version>2.0.17</slf4j-api .version>
5959
6060 <!-- test -->
61- <okhttp .version>5.1 .0</okhttp .version>
62- <junit-jupiter .version>5.14 .0</junit-jupiter .version>
61+ <okhttp .version>5.2 .0</okhttp .version>
62+ <junit-jupiter .version>6.0 .0</junit-jupiter .version>
6363 <junit-pioneer .version>2.3.0</junit-pioneer .version>
64- <junit-platform-launcher .version>1.14 .0</junit-platform-launcher .version>
64+ <junit-platform-launcher .version>6.0 .0</junit-platform-launcher .version>
6565
6666 <!-- Plugins -->
6767 <maven-compiler-plugin .version>3.14.1</maven-compiler-plugin .version>
227227 <groupId >org.apache.maven.plugins</groupId >
228228 <artifactId >maven-javadoc-plugin</artifactId >
229229 <version >${maven-javadoc-plugin.version} </version >
230+ <configuration >
231+ <doclint >all,-missing</doclint >
232+ <additionalJOptions >
233+ <additionalJOption >-Xdoclint:all,-missing</additionalJOption >
234+ </additionalJOptions >
235+ </configuration >
230236 <executions >
231237 <execution >
232238 <id >attach-javadocs</id >
Original file line number Diff line number Diff line change 22
33import com .switcherapi .client .model .SwitcherResult ;
44import org .apache .commons .lang3 .ArrayUtils ;
5+ import org .jspecify .annotations .NullMarked ;
56import org .junit .jupiter .api .extension .*;
67import org .junit .jupiter .api .extension .ExtensionContext .Namespace ;
78import org .junit .jupiter .api .extension .ExtensionContext .Store ;
89
910import java .util .Arrays ;
11+ import java .util .Optional ;
1012import java .util .stream .Stream ;
1113
1214/**
@@ -29,6 +31,7 @@ public boolean supportsTestTemplate(ExtensionContext context) {
2931 }
3032
3133 @ Override
34+ @ NullMarked
3235 public Stream <TestTemplateInvocationContext > provideTestTemplateInvocationContexts (ExtensionContext context ) {
3336 SwitcherTest switcherTest = context .getRequiredTestMethod ().getAnnotation (SwitcherTest .class );
3437
@@ -58,9 +61,10 @@ public void beforeTestExecution(ExtensionContext context) {
5861 }
5962
6063 @ Override
64+ @ NullMarked
6165 public void afterTestExecution (ExtensionContext context ) {
6266 Store store = getStore (context );
63- String [] keys = store .remove (STORE_KEYS , String [].class );
67+ String [] keys = Optional . ofNullable ( store .remove (STORE_KEYS , String [].class )). orElse ( new String [ 0 ] );
6468
6569 if (ArrayUtils .isNotEmpty (keys )) {
6670 for (String keyStored : keys ) {
Original file line number Diff line number Diff line change 11package com .switcherapi .client .test ;
22
33import org .apache .commons .lang3 .ArrayUtils ;
4+ import org .jspecify .annotations .NullMarked ;
45import org .junit .jupiter .api .extension .TestTemplateInvocationContext ;
56
67import java .util .Arrays ;
@@ -25,6 +26,7 @@ class SwitcherTestTemplate implements TestTemplateInvocationContext {
2526 }
2627
2728 @ Override
29+ @ NullMarked
2830 public String getDisplayName (int invocationIndex ) {
2931 SwitcherTestValue [] switcherTestValues = switcherTest .switchers ();
3032
You can’t perform that action at this time.
0 commit comments