File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
tck/tck-tests/src/main/java/ee/jakarta/tck/jsonp/api/provider Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 3434import jakarta .json .stream .JsonGeneratorFactory ;
3535import jakarta .json .stream .JsonParser ;
3636import jakarta .json .stream .JsonParserFactory ;
37+ import org .junit .jupiter .api .AfterEach ;
38+ import org .junit .jupiter .api .BeforeEach ;
3739import org .junit .jupiter .api .Test ;
3840
3941import static org .junit .jupiter .api .Assertions .assertEquals ;
@@ -46,7 +48,23 @@ public class JsonProviderTest {
4648
4749 private static final String JSONP_PROVIDER_FACTORY = "jakarta.json.provider" ;
4850
49-
51+ private String factoryValue ;
52+
53+ @ BeforeEach
54+ public void setUp () {
55+ factoryValue = System .getProperty (JSONP_PROVIDER_FACTORY );
56+ System .clearProperty (JSONP_PROVIDER_FACTORY );
57+ }
58+
59+ @ AfterEach
60+ public void reset () {
61+ if (factoryValue != null ) {
62+ System .setProperty (JSONP_PROVIDER_FACTORY , factoryValue );
63+ } else {
64+ System .clearProperty (JSONP_PROVIDER_FACTORY );
65+ }
66+ }
67+
5068 /**
5169 * Verifies it is possible to obtain the JsonProvider implementation from a System property.
5270 */
You can’t perform that action at this time.
0 commit comments