{"id":37423915,"url":"https://github.com/bbobcik/auderis-test-extra","last_synced_at":"2026-01-16T06:10:41.700Z","repository":{"id":35426607,"uuid":"39691962","full_name":"bbobcik/auderis-test-extra","owner":"bbobcik","description":"Useful additions for JUnit/Hamcrest testing environment","archived":false,"fork":false,"pushed_at":"2018-06-13T23:40:09.000Z","size":270,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-27T18:09:07.585Z","etag":null,"topics":["behavior-driven-development","hamcrest","hamcrest-matchers","java","junit-rule","junit4","junitparams","test-assertion","test-parameter","unit-testing"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbobcik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-25T15:39:22.000Z","updated_at":"2017-05-11T10:18:26.000Z","dependencies_parsed_at":"2022-09-07T20:31:14.605Z","dependency_job_id":null,"html_url":"https://github.com/bbobcik/auderis-test-extra","commit_stats":null,"previous_names":[],"tags_count":22,"template":null,"template_full_name":null,"purl":"pkg:github/bbobcik/auderis-test-extra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbobcik%2Fauderis-test-extra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbobcik%2Fauderis-test-extra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbobcik%2Fauderis-test-extra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbobcik%2Fauderis-test-extra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbobcik","download_url":"https://codeload.github.com/bbobcik/auderis-test-extra/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbobcik%2Fauderis-test-extra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["behavior-driven-development","hamcrest","hamcrest-matchers","java","junit-rule","junit4","junitparams","test-assertion","test-parameter","unit-testing"],"created_at":"2026-01-16T06:10:40.943Z","updated_at":"2026-01-16T06:10:41.688Z","avatar_url":"https://github.com/bbobcik.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# auderis-test-extra \u0026mdash; Comfortable unit testing\n\nUseful additions to JUnit/Hamcrest/JUnitParams testing environment. You will reduce most of unit test boilerplate\nsignificantly:\n* Test cases can receive parameters of various types, as complex as needed.\n* Test assertions will be almost perfectly human-readable, providing natural constraints for tested objects\n* Creation of additional object matchers is simplified by `MultiPropertyMatcher`\n\nAs a result, many test cases shrink to a couple of lines of code (excluding parameter definition). Following\nthe [Given-When-Then](https://martinfowler.com/bliki/GivenWhenThen.html) (also known as \"Arrange-Act-Assert\")\ntest style, you'll notice that *Given* section will be often empty and each of sections *When*, *Then* may\nconsist of a single line of code. \n\nKeywords: `Unit tests`, `Hamcrest`, `JUnitParams`\n\n[![Build Status](https://travis-ci.org/bbobcik/auderis-test-extra.svg?branch=master)](https://travis-ci.org/bbobcik/auderis-test-extra)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/cz.auderis/auderis-test-extra/badge.svg)](https://maven-badges.herokuapp.com/maven-central/cz.auderis/auderis-test-extra)\n\n\n## Changelog\n\n### 1.3.7\n* `AbstractKeyValueConverter` supports additional methods how to set a property to a bean;\n  if the property delegate class offers method `setExtraProperty(bean, propertyName, textValue)`,\n  it is used as one of fallback methods. Subclasses can provide their own property setting code.\n\n### 1.3.6\n* `MultiPropertyMatcher` supports description contexts, where description providers are informed\n  about object that is a subject of testing.\n\n### 1.3.5\n* More flexible initialization of files in `WorkFolder`, using `InitialContentProvider` interface.\n  Useful utility providers (such as `lines()`, `bytes()` and `serializedForm()`) are prepared\n  in `ContentProviders` class.\n* `WorkFolder` can provide a ClassLoader that looks up resources within the work folder space.\n  The classloader can be obtained via `getClassLoaderForResources()`; when needed, it can be\n  installed as current thread's context classloader by calling `installContextClassLoaderForResources()`.\n\n### 1.3.4\n* Fix: `WorkFolder` did not create correct subfolder structure.\n\n### 1.3.3\n* Extracted `AbstractKeyValueConverter` that does not implement `Converter` interface\n  so that class signatures do not clash\n\n### 1.3.2\n* Parameter converter `KeyValueBeanAnnotationConverter` can become a base for specialized\n  annotation converters\n\n### 1.3.1\n* Parameter annotation `@KeyValueBean` facilitates creation and initialization of simple beans.\n  The parameter text should be a whitespace-separated list of `key=value` pairs; the keys are then\n  interpreted either as property names (in JavaBean sense) or as field names.\n* `@KeyValueBean` supports so-called property delegates, where setters are looked-up in a different\n  class. These \"delegate setters\" require two arguments \u0026ndash; a target bean reference and the actual property\n  value. The delegate setters can be static.\n* To facilitate special conversion needs when using a `@KeyValueBean` delegate setter, the property value\n  argument can be a `String` instance \u0026ndash; in this case the delegate setter is responsible for\n  appropriate parsing and conversion.\n* Property editors for `BigDecimal` and `BigInteger` added (registered either directly or via\n  `AdditionalPropertyEditors.register()`)\n\n### 1.3.0\n* `ArrayPartMatcher` implemented\n\n### 1.2.9\n* (Bug) Incorrect handling of parameter annotation `@BigInt` fixed \n\n### 1.2.8\n* File handling interface `WorkFolderInterface` provided for `WorkFolder` as well as for\n  its subfolders.\n* `FileMatchers` can match file attributes, using a new matcher `FileFlagMatcher`\n\n### 1.2.7\n* Functionality of `MultiPropertyMatcher` improved to simplify an instance construction\n\n### 1.2.6\n* To simplify creation of dedicated multi-property matchers that tend to follow a common pattern,\n  `MultiPropertyMatcher` class was added\n* Natural list joining facility `NaturalDescriptionJoiner` added support for functional\n  description generation; in Java 8, lambda construction can be efficiently used.\n\n### 1.2.5\n* Natural list joining facility `NaturalDescriptionJoiner` has better support for\n  Hamcrest-related activities: descriptions of matchers' mismatches can be added to the\n  result list (items where the matcher is either `null` or matches the provided value are\n  omitted from the result).\n\n### 1.2.4\n* Parameter annotation `@HexBuffer` can optionally specify desired buffer capacity as well as whether\n  to skip the rewinding of the produced `ByteBuffer`\n* Parameter annotation `@HexArray` can optionally specify desired size of produced byte array\n* New matchers targetting `ByteBuffer`s were added\n* Parameter annotations `@BigDec` and `@BigInt` can produce `null` values from the text source,\n  using appropriate annotation argument \n* `ByteSequenceFormatSupport` allows to format byte sequences into a readable form, typically\n  into hexadecimal chunks\n* Added utility class `NaturalDescriptionJoiner` that facilitates construction of natural language item lists \n\n### 1.2.3\n* Support for JUnitParams \"metaconversion\"\n  * Annotation `@UsingPropertyEditor` will delegate parameter conversion to an appropriate\n    JavaBeans `PropertyEditor` implementation\n  * A factory method can be used for String-to-Target conversion using annotation\n    `@UsingFactory`\n\n### 1.2.2\n* Build platform switched from Maven to Gradle\n* Logging output testing extended\n  * Added support for [Log4J 1.2.x](http://logging.apache.org/log4j/1.2)\n  * Multiple logging frameworks can be captured at the same time (e.g. using `LogFramework.everything()`)\n  * When requested logging framework is not on classpath, its capturing is disabled\n\n### 1.2.1\n* Support for tests of multidimensional arrays\n  * `ArrayDimensionMatcher` with matcher factory methods for checking array dimensions\n  * JUnitParams annotations `@MultiArray` and `@MultiArrayInt` facilitating easy generation of multidimensional\n    arrays as unit test's arguments. `@MultiArray` can work with arbitrary array item types, including\n    all primitive types and with support for selected built-in types (e.g. `java.math.BigDecimal`).\n\n### 1.2.0\n* Tools for testing logging output\n  * Normal output of a logging framework is redirected to memory buffer, preventing disk/network activity outside of\n    the scope of unit tests \n  * Frameworks currently supported: [SLF4J](http://www.slf4j.org) and [JBoss Logging](https://github.com/jboss-logging/jboss-logging)\n  * Logging framework intercepted by applying class rule `@LogFramework` in a test class\n  * Test rule `@LogBuffer` facilitates filtering and collection of log messages stored as `cz.auderis.test.logging.LogRecord` instances\n  * Hamcrest matchers for `LogRecord` allow detailed inspection of captured log output\n\n### 1.1.0\n* Support for [JUnitParams 1.0.5](https://github.com/Pragmatists/JUnitParams) annotation-based converters\n  * `@BigDec` for `java.math.BigDecimal` objects\n  * `@BigInt` for `java.math.BigInteger` objects\n  * `@DateParam` and `@CalendarParam` for legacy temporal classes `java.util.Date` and `java.util.Calendar`\n  * `@HexArray` and `@HexBuffer` for arbitrary byte sequences, producing `byte[]` and `java.nio.ByteBuffer` objects, respectively\n  * `@XmlText` wraps text into `javax.xml.transform.Source` for further XML processing\n  * Utility converter `@Guid` for UUID objects\n* Additional Hamcrest matchers for text, date and raw array validation\n* Hamcrest matchers for `java.math.BigDecimal`\n  * Matchers for numeric properties (scale, precision)\n  * Matchers working with rounded values\n\n### 1.0.1\n* Added various type converters for [JUnitParams](https://github.com/Pragmatists/JUnitParams) library.\n\n\n\n## Usage examples\n\n### Testing log output - SLF4J\n\n```java\n    public class LoggingTest {\n        @ClassRule\n        public static LogFramework logFramework = LogFramework.slf4j();\n\n        @Rule\n        public LogBuffer logBuffer = new LogBuffer();\n\n        @Test\n        public void testOfLogging() throws Exception {\n            // GIVEN\n            logBuffer.levels().enableOnly( LogLevel.INFO.plusHigherLevels() );\n            // WHEN\n            Logger log = LoggerFactory.getLogger(\"x\");\n            log.info( \"This is a log\" );\n            // THEN\n            final List\u003cLogRecord\u003e infoRecords = logBuffer.getRecords();\n            assertThat( infoRecords, hasSize(1) );\n            final LogRecord logRecord = infoRecords.get(0);\n            assertThat( logRecord, hasLevel(LogLevel.INFO) );\n            assertThat( logRecord, hasMessage(\"This is a log\") );\n        }\n    }\n```\n\n### Multidimensional arrays\n\nThe following tests demonstrate:\n* Conversion of flat parameter lists into multidimensional arrays (see `@MultiArray` JavaDoc for details)\n* Usage of specialized Hamcrest matcher that checks multidimensional array dimensions\n\n```java\n    @RunWith(JUnitParamsRunner.class)\n    public class MultiDimTest {\n            \n        @Test\n        @Parameters({\n            \"2x2x2 : 1 2 -3 -4 -5 -6 7 8 | 2 * 2 * 2\",\n            \"3 : 9 8 7                   | 3\",\n            \"4x0 :                       | 4 X 0\"\n        })\n        public void testPrimitiveIntArray(@MultiArray(int.class) Object intArray, String expectedDimension) throws Exception {\n            assertThat( intArray, is( arrayWithDimensions( expectedDimension )));\n        }\n        \n        @Test\n        @Parameters({\n            \"2x1x2 : -5.009 -6.999 7.432 8.977131 | 2 * 1 * 2\",\n            \"3 : 9 8 7                   | 3\",\n            \"4x0 :                       | 4 X 0\"\n        })\n        public void testBigDecimalArray(@MultiArray(BigDecimal.class) Object bigDecArray, String expectedDimension) throws Exception {\n            assertThat( bigDecArray, is( arrayWithDimensions( expectedDimension )));\n        }\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbobcik%2Fauderis-test-extra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbobcik%2Fauderis-test-extra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbobcik%2Fauderis-test-extra/lists"}