Hamcrest-Matchers

a library containing hamcrest matchers

License

License

GroupId

GroupId

at.meks
ArtifactId

ArtifactId

hamcrest-matchers
Last Version

Last Version

0.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

Hamcrest-Matchers
a library containing hamcrest matchers
Project URL

Project URL

https://github.com/meks77/hamcrest-matchers
Source Code Management

Source Code Management

https://github.com/meks77/hamcrest-matchers

Download hamcrest-matchers

How to add to project

<!-- https://jarcasting.com/artifacts/at.meks/hamcrest-matchers/ -->
<dependency>
    <groupId>at.meks</groupId>
    <artifactId>hamcrest-matchers</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/at.meks/hamcrest-matchers/
implementation 'at.meks:hamcrest-matchers:0.1.1'
// https://jarcasting.com/artifacts/at.meks/hamcrest-matchers/
implementation ("at.meks:hamcrest-matchers:0.1.1")
'at.meks:hamcrest-matchers:jar:0.1.1'
<dependency org="at.meks" name="hamcrest-matchers" rev="0.1.1">
  <artifact name="hamcrest-matchers" type="jar" />
</dependency>
@Grapes(
@Grab(group='at.meks', module='hamcrest-matchers', version='0.1.1')
)
libraryDependencies += "at.meks" % "hamcrest-matchers" % "0.1.1"
[at.meks/hamcrest-matchers "0.1.1"]

Dependencies

runtime (1)

Group / Artifact Type Version
org.hamcrest : hamcrest-core jar 2.1

Project Modules

There are no modules declared in this project.

Sonarcloud Status Sonarcloud Status Sonarcloud Status Sonarcloud Status Sonarcloud Status Sonarcloud Status Sonarcloud Status Sonarcloud Status Sonarcloud Status

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:

<dependency>
    <groupId>at.meks</groupId>
    <artifactId>hamcrest-matchers</artifactId>
    <version>${version}</version>
</dependency>

Pleas replace ${version} with the version you want to use.

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));
    }
    
}

Versions

Version
0.1.1
0.1.0