{"id":20741113,"url":"https://github.com/robtimus/junit-support","last_synced_at":"2026-03-06T02:31:29.430Z","repository":{"id":45628648,"uuid":"311374278","full_name":"robtimus/junit-support","owner":"robtimus","description":"Contains interfaces and classes that make it easier to write unit tests with JUnit","archived":false,"fork":false,"pushed_at":"2025-01-13T20:28:55.000Z","size":4150,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T02:53:34.154Z","etag":null,"topics":["java","junit","junit5","testing"],"latest_commit_sha":null,"homepage":"https://robtimus.github.io/junit-support/","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/robtimus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-09T15:01:48.000Z","updated_at":"2025-01-13T20:29:00.000Z","dependencies_parsed_at":"2023-02-16T10:46:30.908Z","dependency_job_id":"338cb69c-1909-4c7c-b682-bf6782b39b9d","html_url":"https://github.com/robtimus/junit-support","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robtimus%2Fjunit-support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robtimus%2Fjunit-support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robtimus%2Fjunit-support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robtimus%2Fjunit-support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robtimus","download_url":"https://codeload.github.com/robtimus/junit-support/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250552037,"owners_count":21449162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["java","junit","junit5","testing"],"created_at":"2024-11-17T06:33:53.498Z","updated_at":"2026-03-06T02:31:24.392Z","avatar_url":"https://github.com/robtimus.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# junit-support\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.robtimus/junit-support)](https://search.maven.org/artifact/com.github.robtimus/junit-support)\n[![Build Status](https://github.com/robtimus/junit-support/actions/workflows/build.yml/badge.svg)](https://github.com/robtimus/junit-support/actions/workflows/build.yml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.github.robtimus%3Ajunit-support\u0026metric=alert_status)](https://sonarcloud.io/summary/overall?id=com.github.robtimus%3Ajunit-support)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.github.robtimus%3Ajunit-support\u0026metric=coverage)](https://sonarcloud.io/summary/overall?id=com.github.robtimus%3Ajunit-support)\n[![Known Vulnerabilities](https://snyk.io/test/github/robtimus/junit-support/badge.svg)](https://snyk.io/test/github/robtimus/junit-support)\n\nContains interfaces and classes that make it easier to write unit tests with [JUnit](https://junit.org/).\n\nA quick overview of the functionality in this library:\n\n## Injecting resources\n\nInstead of having to write a utility method to read the contents of a resource, simply annotate a field, constructor parameter or method parameter with `@TestResource`, and JUnit will inject the resource for you:\n\n```java\n@Test\nvoid testWithResource(@TestResource(\"input.json\") String json) {\n    // use json as needed\n}\n```\n\nSee [@TestResource](https://robtimus.github.io/junit-support/extension/test-resource.html) for more information, including options to configure how the resource is read or how to convert it to an object.\n\n## Reconfigure static loggers\n\nLoggers are often defined as `private static final` fields. That makes them difficult to mock. Using [@TestLogger](https://robtimus.github.io/junit-support/extension/test-logger.html) allows you to reconfigure these for test purposes.\n\n## Disable logging for tests\n\n[@DisableLogging](https://robtimus.github.io/junit-support/extension/disable-logging.html) allows you to suppress logging for tests.\n\n## Disable logging for successful tests\n\n[@LogOnFailure](https://robtimus.github.io/junit-support/extension/log-on-failure.html) allows you to suppress logging for successful tests but not for failed tests.\n\n## Simplify writing JUnit extensions\n\nIf you want to write a JUnit extension that performs method lookups like [@MethodSource](https://junit.org/junit5/docs/current/api/org.junit.jupiter.params/org/junit/jupiter/params/provider/MethodSource.html), [MethodLookup](https://robtimus.github.io/junit-support/extension/method-lookup.html) provides an easy to use API.\n\nIf you want to write a JUnit extension that can inject values into fields, constructor parameters or method parameters, some [base classes](https://robtimus.github.io/junit-support/extension/injecting-extensions.html) are provided that let you focus on what's important - provide the values to inject.\n\n## Predefined tests\n\nThis library mainly contains several [pre-defined tests](https://robtimus.github.io/junit-support/pre-defined-tests.html), defined in interfaces that each test one small aspect of a class or interface, often a single method. This makes it easier to test custom implementations of various common interfaces or base classes. The currently supported list is:\n\n* [Collection](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/collections/CollectionTests.html), both modifiable and unmodifiable\n* [Iterable](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/collections/IterableTests.html)\n* [Iterator](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/collections/IteratorTests.html), both modifiable and unmodifiable\n* [List](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/collections/ListTests.html) and [ListIterator](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/collections/ListIteratorTests.html), both modifiable and unmodifiable\n* [Map](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/collections/MapTests.html) and [Map.Entry](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/collections/MapEntryTests.html), both modifiable and unmodifiable\n* [Set](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/collections/SetTests.html), both modifiable and unmodifiable\n* [Spliterator](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/collections/SpliteratorTests.html)\n* [InputStream, OutputStream, Reader and Writer](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/io/package-summary.html)\n\nIn addition, there are pre-defined tests for [MethodDelegation](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/DelegateTests.html) and [covariant return types](https://robtimus.github.io/junit-support/apidocs/com.github.robtimus.junit.support/com/github/robtimus/junit/support/test/CovariantReturnTests.html).\n\n## Additional assertions\n\nSeveral [additional assertions](https://robtimus.github.io/junit-support/additional-assertions.html) are provided. Some examples:\n\n* alternatives to `assertTrue` and `assertFalse` that provide better failure messages\n* assertions for checking the content of a `Reader` or `InputStream`\n* assertions for `Optional`, `OptionalInt`, `OptionalLong` and `OptionalDouble`\n* assertions for exception causes\n* assertions for code that can can throw more than one different types of exceptions\n* assertions for code that optionally throws an exception\n\n## Parameterized test support\n\n[JUnit Pioneer](https://junit-pioneer.org/) has [@CartesianTest](https://junit-pioneer.org/docs/cartesian-product/) to provide the Cartesian product of sets of arguments. Using `@CartesianTest.MethodFactory` allows you to create argument sets programmatically. It does not provide the possibility to filter out combinations though. Class [ArgumentsCombiner](https://robtimus.github.io/junit-support/parameterized-test-support.html#argumentscombiner) works like JUnit Pioneer's `ArgumentSets` class but allows filtering out combinations.\n\n## Testing concurrent code\n\nSome classes for [testing concurrent code](https://robtimus.github.io/junit-support/testing-concurrent-code.html) are provided.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobtimus%2Fjunit-support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobtimus%2Fjunit-support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobtimus%2Fjunit-support/lists"}