{"id":20772413,"url":"https://github.com/assertj/assertj-arrow-core","last_synced_at":"2026-01-18T08:31:03.273Z","repository":{"id":82060468,"uuid":"602952402","full_name":"rcardin/assertj-arrow-core","owner":"rcardin","description":"Assertions for Types Defined in Arrow Kt Core LIbrary","archived":false,"fork":false,"pushed_at":"2025-04-11T18:37:50.000Z","size":197,"stargazers_count":12,"open_issues_count":12,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-11T19:48:03.788Z","etag":null,"topics":["arrow-kt","assertj","kotlin","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/rcardin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-17T09:50:47.000Z","updated_at":"2024-11-18T10:28:09.000Z","dependencies_parsed_at":"2023-12-31T17:30:35.594Z","dependency_job_id":"cf1e252b-9d69-4392-bc11-19189fbcd4ad","html_url":"https://github.com/rcardin/assertj-arrow-core","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcardin%2Fassertj-arrow-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcardin%2Fassertj-arrow-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcardin%2Fassertj-arrow-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcardin%2Fassertj-arrow-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcardin","download_url":"https://codeload.github.com/rcardin/assertj-arrow-core/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251722718,"owners_count":21633001,"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":["arrow-kt","assertj","kotlin","testing-tools"],"created_at":"2024-11-17T12:21:00.896Z","updated_at":"2026-01-18T08:31:03.263Z","avatar_url":"https://github.com/rcardin.png","language":"Kotlin","readme":"![Kotlin Version](https://img.shields.io/badge/Kotlin-2.2.20-blue?style=flat\u0026logo=kotlin)\n![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/rcardin/assertj-arrow-core/ci.yml?branch=main)\n![Maven Central](https://img.shields.io/maven-central/v/in.rcard/assertj-arrow-core)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/rcardin/assertj-arrow-core)\n[![javadoc](https://javadoc.io/badge2/in.rcard/assertj-arrow-core/javadoc.svg)](https://javadoc.io/doc/in.rcard/assertj-arrow-core)\n\u003ca href=\"https://pinterest.github.io/ktlint/\"\u003e\u003cimg src=\"https://img.shields.io/badge/code%20style-%E2%9D%A4-FF4081.svg\" alt=\"ktlint\"\u003e\u003c/a\u003e\n\n# assertj-arrow-core\n\nThis project provides a set of [AssertJ](https://assertj.github.io/doc/) assertions for\nthe [Arrow](https://arrow-kt.io/) library. In detail, the project provides assertions for the following Arrow types:\n\n- [x] `Either\u003cE, A\u003e`\n- [x] `Option\u003cA\u003e`\n- [x] `Raise\u003cE\u003e.() -\u003e A`\n- [x] `NonEmptyList\u003cA\u003e`\n\nMaybe you're asking yourself: \"Why do we need AssertJ assertions for Arrow types?\". The answer is simple: We often use\nKotlin and Arrow Kt inside a Java project using Spring Boot. In this case, we already have AssertJ in the classpath as\nan assertion library. So, why not use it to assert Arrow types?\n\n## Usage\n\nThe library is available on Maven Central. To use it, add the following dependency to your `pom.xml` file:\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ein.rcard\u003c/groupId\u003e\n    \u003cartifactId\u003eassertj-arrow-core\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.0\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nOtherwise, if you're using Gradle, add the following dependency to your `build.gradle.kts` file:\n\n```kotlin\ntestImplementation(\"in.rcard:assertj-arrow-core:2.0.0\")\n```\n\n## Assertions Guide\n\nThis section describes the assertions provided by the `assertj-arrow-core` library.\n\n### `Option\u003cA\u003e`\n\nUse the `in.rcard.assertj.arrowcore.OptionAssert` class as an entry point to assert `Option\u003cA\u003e` instances.\n\n| Assertions           | Description                                                                                                                                               |\n|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `isEmpty`            | Verifies that the actual `Option` is empty.                                                                                                               |\n| `contains`           | Verifies that the actual `Option` contains the given value.                                                                                               |\n| `containsInstanceOf` | Verifies that the actual `Option` contains a value that is an instance of the argument.                                                                   |\n| `get`                | Verifies that the actual Option is not null and not empty and returns an Object assertion that allows chaining (object) assertions on the optional value. |\n| `isDefined`          | Verifies that there is a value present in the actual `Option`.                                                                                            |\n\n### `Either\u003cE, A\u003e`\n\nUse the `in.rcard.assertj.arrowcore.EitherAssert` class as an entry point to assert `Either\u003cE, A\u003e` instances.\n\n| Assertions                | Description                                                                                                                                                               |\n|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `isRight`                 | Verifies that the actual `Either` is right.                                                                                                                               |\n| `isLeft`                  | Verifies that the actual `Either` is left.                                                                                                                                |\n| `containsOnRight`         | Verifies that the actual `Either` is `Either.Right` and contains the given value.                                                                                         |\n| `containsRightInstanceOf` | Verifies that the actual right-sided `Either` contains a value that is an instance of the argument.                                                                       |\n| `asRight`                 | Verifies that the actual `Either` is not `null` and contains a right-sided value and returns an `Object` assertion that allows chaining (object) assertions on the value. |\n| `containsOnLeft`          | Verifies that the actual `Either` is `Either.Left` and contains the given value.                                                                                          |\n| `containsLeftInstanceOf`  | Verifies that the actual left-sided `Either` contains a value that is an instance of the argument.                                                                        |\n| `asLeft`                  | Verifies that the actual `Either` is not `null` and contains a left-sided value and returns an `Object` assertion that allows chaining (object) assertions on the value.  |\n\n### `Raise\u003cE\u003e.() -\u003e A`\n\nUse the `in.rcard.assertj.arrowcore.RaiseAssert` class as an entry point to assert `Raise\u003cE\u003e.() -\u003e A` instances. There\nare many different entry points, all of them available boh for regular and `suspend` functions:\n\n| Entry Point          | Description                                                                                                                 |\n|----------------------|-----------------------------------------------------------------------------------------------------------------------------|\n| `assertThat`         | Entry point to assert a `Raise\u003cE\u003e.() -\u003e A` instance.                                                                        |\n| `assertThatThrownBy` | Verifies that the function in the `Raise` context throws an exception and let chaining assertion on the thrown exception    |\n| `assertThatRaisedBy` | Verifies that the function in the `Raise` context raises a logic-typed error and let chaining assertion on the raised error |\n\nThe available assertions are:\n\n| Assertions     | Description                                                                                                                                                         |\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `succeedsWith` | Verifies that the function in the `Raise` context succeeds with the given value.                                                                                    |\n| `succeeds`     | Verifies that the function in the `Raise` context succeeded. No check on the value returned by the function is performed.                                           |\n| `raises`       | Verifies that the function in the Raise context fails with the given error.                                                                                         |\n| `fails`        | Verifies that the function in the Raise context fails, no matter the type of the logical error.                                                                     |\n| `result`       | Verifies that the actual function in the `Raise` context succeeds and returns an `Object` assertion that allows chaining (object) assertions on the returned value. |\n| `error`        | Verifies that the actual function in the Raise context fails and returns an Object assertion that allows chaining (object) assertions on the raised error.          |\n\n### `NonEmptyList\u003cA\u003e`\n\nUse the `in.rcard.assertj.arrowcore.NonEmptyListAssert` class as an entry point to assert `NonEmptyList\u003cA\u003e` instances.\n\n| Assertions                        | Description                                                                                                                                                               |\n|-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `shouldContain`                   | Verifies that the actual `NonEmptyList` contains the expected element.                                                                                                    |                           \n| `shouldContainAll`                | Verifies that the actual `NonEmptyList` contains all the expected elements.                                                                                               |\n| `shouldContainNoNulls`            | Verifies that the actual `NonEmptyList` does not contain null.                                                                                                            |\n| `shouldContainOnlyNulls`          | Verifies that the actual `NonEmptyList` contains only null.                                                                                                               |\n| `shouldContainNull`               | Verifies that the actual `NonEmptyList` contains null.                                                                                                                    |\n| `shouldHaveDuplicates`            | Verifies that the actual `NonEmptyList` contains at least one duplicate.                                                                                                  |\n| `shouldBeSingleElement`           | Verifies that the actual `NonEmptyList` has a single element which is expected element.                                                                                   |\n| `shouldBeSorted`                  | Verifies that the actual `NonEmptyList` is sorted.                                                                                                                        |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassertj%2Fassertj-arrow-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassertj%2Fassertj-arrow-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassertj%2Fassertj-arrow-core/lists"}