- All Known Implementing Classes:
Jackson2JsonProvider,Jackson3JsonProvider
public interface JsonProvider
A dependency-aware
Json provider.
Cucumber creates reports using JSON but Java doesn't have a standard JSON implementation and the JSR 353 jsonb-api doesn't seem to be going anywhere yet. As a testing library Cucumber also can't just depend on Jackson, Gson or any other library. It might influence the system under test. As such Cucumber has to use what is available.
A JsonProvider can be used through SPI and may optionally provide a
Json implementation if the dependencies for that implementation are
available on the class or module path.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionThe dependencies that should be available on the class or module path required to provide a workingJsoninstance.instance()Provides aJsoninstance if thedependencies()are available on the class or module path.name()Name of the Json library used.
-
Method Details
-
instance
Provides aJsoninstance if thedependencies()are available on the class or module path. Otherwise, empty. -
dependencies
List<JsonProvider.Dependency> dependencies()The dependencies that should be available on the class or module path required to provide a workingJsoninstance.- Returns:
- dependencies that should be available on the class or module path.
-
name
String name()Name of the Json library used. E.g.Jackson 2orJackson 3.
-