Comments (1)
This idea was considered early. But there are a couple of reasons why this design was not implemented
- Just like I mentioned in my comment in #6 AssertJ uses overloads of
assertThat
and allows the type to dictate the assertion strategy. The goal here is to preserve theassertThat(something).customCheck()
template. One idea would be to implement aAbstractCharSequenceAssert
with a.asJsonDocumentContext()
to enable JSON path checks. The downside is you will have to extendorg.assertj.core.api.Assertions
to replace the default string assertion with the custom assertion. - This library was build on top of JsonPath which a highly configurable library. By doing the conversion under the covers this library will have to assume some default configs and allow configuration points. This kind of change would increase the complexity since it would introduce a lot of coupling with JsonPath.
I think the best solution here is to create your own wrapper like I described in item 1
. With that you can write your own abstraction, and make the assertions a lot simpler for your application. There is a balance between integrating multiple libraries together for an app where you can lock down every version, and for a general use utility where you want to keep it simple so more people can use it. I would like to not put effort in glue code because that would introduce integration issues with a lot other libraries and that defeats the purpose of this simple codebase.
from assertj-json.
Related Issues (11)
- Handle json path expression failures
- Cannot decrypt SONATYPE_PASS on Travis HOT 2
- NoSuchMethodError with AssertJ >= 3.11.0
- Equals assert HOT 1
- GsonMappingProvider does not return array of Integers HOT 1
- Jackson should be a test dependency
- NoSuchMethodError using assertJ 3.6.2 HOT 1
- Bad Idea to have assertThat method name HOT 2
- Got exception during array assertion HOT 1
- Missing assert for boolean and null HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assertj-json.