|
1 | | -# elegant |
2 | | -This is a pre-configured template for your projects in Java, you can use it with any language, [more about it](https://h1alexbel.github.io/2023/01/21/maintainable-project-template.html) |
3 | | - |
4 | | -## Tools: |
5 | | - - [Rultor](https://www.rultor.com/) for CI/CD. |
6 | | - - [0pdd](https://www.0pdd.com/) for issue management. |
7 | | - - [Renovate](https://www.mend.io/free-developer-tools/renovate/) for dependency control. |
8 | | - - [xcop](https://www.yegor256.com/2017/08/29/xcop.html) GitHub action for XML style check. |
9 | | - |
10 | | -## How to use? |
11 | | - - Configure actions in `workflows` folder. |
12 | | - - [Configure](https://doc.rultor.com/reference.html) the `@rultor`. |
13 | | - - [Configure](https://www.yegor256.com/2017/04/05/pdd-in-action.html) the `0pdd`. |
14 | | - - [Configure](https://github.com/marketplace/renovate) the `renovate`. |
15 | | - |
16 | | -And you're good to go! |
| 1 | +<img alt="logo" src="https://eo-cqrs.github.io/.github/eo-cqrs.svg" height="100px" /> |
| 2 | + |
| 3 | +[](https://self-xdsd.com/p/eo-cqrs/json-matchers?provider=github) |
| 4 | + |
| 5 | +[](https://www.elegantobjects.org) |
| 6 | +[](https://www.rultor.com/p/eo-cqrs/json-matchers) |
| 7 | +[](https://www.jetbrains.com/idea/) |
| 8 | +<br> |
| 9 | + |
| 10 | +[](https://github.com/eo-cqrs/json-matchers/actions/workflows/mvn.yaml) |
| 11 | +[](https://search.maven.org/artifact/io.github.eo-cqrs/json-matchers) |
| 12 | +[](https://javadoc.io/doc/io.github.eo-cqrs/json-matchers) |
| 13 | +[](https://codecov.io/gh/eo-cqrs/json-matchers) |
| 14 | + |
| 15 | +[](https://hitsofcode.com/view/github/eo-cqrs/json-matchers) |
| 16 | +[](https://github.com/eo-cqrs/json-matchers) |
| 17 | +[](http://www.0pdd.com/p?name=eo-cqrs/json-matchers) |
| 18 | +[](https://github.com/eo-cqrs/json-matchers/blob/master/LICENSE.txt) |
| 19 | + |
| 20 | +Project architect: [@h1alexbel](https://github.com/h1alexbel) |
| 21 | + |
| 22 | +Hamcrest JSON Matchers. |
| 23 | + |
| 24 | +**Motivation**. We are not happy dealing with JSON matching and assertions in procedural way. |
| 25 | +<br> |
| 26 | +We offer everything through simple, declarative Hamcrest Matchers. |
| 27 | + |
| 28 | +**Principles**. These are the [design principles](https://www.elegantobjects.org/#principles) behind EOkson. |
| 29 | + |
| 30 | +**How to use**. All you need is this (get the latest |
| 31 | +version [here](https://search.maven.org/artifact/io.github.eo-cqrs/json-matchers)): |
| 32 | + |
| 33 | +Maven: |
| 34 | +```xml |
| 35 | +<dependency> |
| 36 | + <groupId>io.github.eo-cqrs</groupId> |
| 37 | + <artifactId>json-matchers</artifactId> |
| 38 | + <scope>test</scope> |
| 39 | +</dependency> |
| 40 | +``` |
| 41 | + |
| 42 | +Gradle: |
| 43 | +```groovy |
| 44 | +dependencies { |
| 45 | + testCompile 'io.github.eo-cqrs:json-matchers:<version>' |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +### `JsonEqualTo` |
| 50 | +Simple, Equality Matcher: |
| 51 | + |
| 52 | +```java |
| 53 | +new JsonEqualTo(json) |
| 54 | + .matches("{\"test\": \"123\"}") |
| 55 | +); |
| 56 | +``` |
| 57 | +```java |
| 58 | +final String compare = new SmartJson( |
| 59 | +new MutableJson() |
| 60 | + .with("test", "123") |
| 61 | + .with("test-node", "true") |
| 62 | +).pretty(); |
| 63 | +new JsonEqualTo(json) |
| 64 | + .matches(compare); |
| 65 | +``` |
| 66 | + |
| 67 | +Each submitted JSON to `JsonEqualTo` transformed into **pretty string**. |
| 68 | + |
| 69 | +## How to Contribute |
| 70 | + |
| 71 | +Fork repository, make changes, send us a [pull request](https://www.yegor256.com/2014/04/15/github-guidelines.html). |
| 72 | +We will review your changes and apply them to the `master` branch shortly, |
| 73 | +provided they don't violate our quality standards. To avoid frustration, |
| 74 | +before sending us your pull request please run full Maven build: |
| 75 | + |
| 76 | +```bash |
| 77 | +$ mvn clean install |
| 78 | +``` |
| 79 | + |
| 80 | +You will need Maven 3.8.7+ and Java 17+. |
| 81 | + |
| 82 | +Our [rultor image](https://github.com/eo-cqrs/eo-kafka-rultor-image) for CI/CD. |
0 commit comments