Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meks77/hamcrest-matchers
A collection of matchers for hamcrest assertions. Currently only a zip file matcher
https://github.com/meks77/hamcrest-matchers
Last synced: about 2 months ago
JSON representation
A collection of matchers for hamcrest assertions. Currently only a zip file matcher
- Host: GitHub
- URL: https://github.com/meks77/hamcrest-matchers
- Owner: meks77
- License: apache-2.0
- Created: 2019-03-21T15:57:55.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-03T20:57:26.000Z (over 5 years ago)
- Last Synced: 2023-07-28T00:11:08.071Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 80.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=at.meks%3Ahamcrest-matchers&metric=alert_status)](https://sonarcloud.io/dashboard?id=at.meks%3Ahamcrest-matchers)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=at.meks%3Ahamcrest-matchers&metric=bugs)](https://sonarcloud.io/dashboard?id=at.meks%3Ahamcrest-matchers)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=at.meks%3Ahamcrest-matchers&metric=code_smells)](https://sonarcloud.io/dashboard?id=at.meks%3Ahamcrest-matchers)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=at.meks%3Ahamcrest-matchers&metric=coverage)](https://sonarcloud.io/dashboard?id=at.meks%3Ahamcrest-matchers)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=at.meks%3Ahamcrest-matchers&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=at.meks%3Ahamcrest-matchers)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=at.meks%3Ahamcrest-matchers&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=at.meks%3Ahamcrest-matchers)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=at.meks%3Ahamcrest-matchers&metric=sqale_index)](https://sonarcloud.io/dashboard?id=at.meks%3Ahamcrest-matchers)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=at.meks%3Ahamcrest-matchers&metric=security_rating)](https://sonarcloud.io/dashboard?id=at.meks%3Ahamcrest-matchers)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=at.meks%3Ahamcrest-matchers&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=at.meks%3Ahamcrest-matchers)
# hamcrest-matchers
A collection of matchers for hamcrest assertions.
Currently it's not started. But soon it will provide the possibility to assert the content of a zip file.## Matchers
### Zip File matcher
In the first step only the file structure(directories and filenames), the size, last modified date and the content of the file are compared.
The diff of the content is only provided by an sha1 string. Providing the content a byte array or encoded string isn't that usefull.#### Usage
Maven Dependency:
```xmlat.meks
hamcrest-matchers
${version}```
Pleas replace ${version} with the version you want to use.
```java
import at.meks.hamcrest.matchers.zip.ZipFileMatcher;public class ExampleTest {
@Test
public void testZipFile() {
Path expectedZip = Paths.get(getClass().getResource("/expected.zip").toURI());
Path actualZip = Paths.get(getClass().getResource("/compared.zip").toURI());
assertThat(actual, ZipFileMatcher.matchesWithNameLastModifiedAndContent(expected));
}
}
```