Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ content:
sources:
- url: .
branches: HEAD
start_path: home
start_paths:
- home
- assertj-joda-time
- assertj-swing
- url: https://github.com/marcphilipp/assertj
branches:
- antora-3.x
Expand Down
11 changes: 11 additions & 0 deletions assertj-joda-time/antora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: assertj-joda-time
title: AssertJ Joda Time
version: ~
nav:
- modules/ROOT/nav.adoc
asciidoc:
attributes:
assertj-joda-time-version: '2.2.0'
assertj-core-javadoc: 'https://www.javadoc.io/doc/org.assertj/assertj-core/3.27.7'
assertj-joda-time-javadoc: 'https://www.javadoc.io/doc/org.assertj/assertj-joda-time/2.2.0'
assertj-examples-base-package: 'https://github.com/assertj/assertj-examples/blob/main/assertions-examples/src/test/java/org/assertj/examples'
3 changes: 3 additions & 0 deletions assertj-joda-time/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* xref:index.adoc[]
* xref:assertions-guide.adoc[]
* xref:release-notes.adoc[]
231 changes: 231 additions & 0 deletions assertj-joda-time/modules/ROOT/pages/assertions-guide.adoc

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions assertj-joda-time/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
= Quick start

This guide is for the AssertJ Joda Time module.

[[get-assertj-joda-time]]
== Get assertj-joda-time library

AssertJ Joda Time artifacts are in the Maven central repository.

[[java-versions]]
=== Supported Java versions

AssertJ Joda Time major versions depend on different Java versions:

* AssertJ Joda Time 2.x requires Java 8 or higher
* AssertJ Joda Time 1.x requires Java 7 or higher

=== Maven

[source,xml,subs=attributes+]
----
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-joda-time</artifactId>
<!-- use 1.1.0 for Java 7 projects -->
<version>{assertj-joda-time-version}</version>
<scope>test</scope>
</dependency>
----

=== Gradle

For Gradle users (using the Maven Central Repository)

[source,java,subs=attributes+]
----
testImplementation("org.assertj:assertj-joda-time:{assertj-joda-time-version}")
----

Or version 1.1.0 for Java 7 projects

[source,java]
----
testImplementation("org.assertj:assertj-joda-time:1.1.0")
----

=== Other build tools

Check this page to find the relevant https://search.maven.org/artifact/org.assertj/assertj-joda-time/{assertj-joda-time-version}/bundle[assertj joda-time dependency declaration].

== Use Assertions class entry point

The `org.assertj.jodatime.api.Assertions` class is the only class you need to start using AssertJ Joda Time.

[source,java]
----
import static org.assertj.jodatime.api.Assertions.assertThat;
----

== Examples

[source,java]
----
assertThat(dateTime).isBefore(firstDateTime);
assertThat(dateTime).isAfterOrEqualTo(secondDateTime);

// you can use Strings in comparisons to avoid a conversion (we do that for you)
assertThat(new DateTime("2000-01-01")).isEqualTo("2000-01-01");

// compare DateTimes ignoring seconds and milliseconds in the comparison
dateTime1 = new DateTime(2000, 1, 1, 23, 50, 0, 0, UTC);
dateTime2 = new DateTime(2000, 1, 1, 23, 50, 10, 456, UTC);
// assertion succeeds
assertThat(dateTime1).isEqualToIgnoringSeconds(dateTime2);
----

For `DateTime` assertions, comparison is performed in the `DateTimeZone` of `DateTime` to test, consequently the following assertion passes:

[source,java]
----
DateTime utcTime = new DateTime(2013, 6, 10, 0, 0, DateTimeZone.UTC);
DateTime cestTime = new DateTime(2013, 6, 10, 2, 0, DateTimeZone.forID("Europe/Berlin"));

assertThat(utcTime).as("in UTC time").isEqualTo(cestTime);
----

You can compare `DateTime` to another `DateTime`, or `LocalDateTime` to `LocalDateTime`, but not `DateTime` to `LocalDateTime`, it doesn't make sense as one is timezone dependent and the other is not.

Note that you can find more working examples in the {assertj-examples-base-package}/JodaTimeAssertionsExamples.java[JodaTimeAssertionsExamples.java] class of the assertj-examples project.

[[ide]]
== IDE configuration

You can configure your IDE so that when you start typing `as` and trigger code completion `assertThat` will show up in the suggested completions.

Eclipse:

. Go to Window > Preferences > Java > Editor > Content Assist > Favorites > New Type.
. Enter `org.assertj.jodatime.api.Assertions` and click OK.
. Check that you see `org.assertj.jodatime.api.Assertions.*` in Favorites.

Intellij Idea: No special configuration is needed, just start typing `asser` and then invoke completion (Ctrl-Space) twice.
121 changes: 121 additions & 0 deletions assertj-joda-time/modules/ROOT/pages/release-notes.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
= Release Notes

The Javadoc for this release can be found here: https://www.javadoc.io/doc/org.assertj/assertj-joda-time/2.2.0/index.html

[[v2-2-0-release-notes]]
== AssertJ Joda Time 2.2.0

Release date: 2018-06-15

[[v2.2.0-contributors]]
[.release-note-category]#icon:user[] Contributors#

Thanks to Eugene Strepetov for his contribution.

[[v2.2.0-new-features]]
[.release-note-category]#icon:plus-circle[] New features#

Add `LocalDate` assertions providing the following ones (Eugene Strepetov):

- `hasYear`: Verifies that the year of the actual LocalDate is equal to the given year.
- `hasMonthOfYear`: Verifies that the month of the actual LocalDate is equal to the given month
- `hasDayOfMonth`: Verifies that the day of month of the actual LocalDate is equal to the given day
- `isBefore`: Verifies that the actual LocalDate is strictly before the given one.
- `isBeforeOrEqualTo`: Verifies that the actual LocalDate is before or equals to the given one.
- `isEqualTo`: Same assertion as `AbstractAssert.isEqualTo(Object...)` but to be used with `LocalDate` String representation.
- `isAfter`: Verifies that the actual LocalDate is strictly after the given one.
- `isAfterOrEqualTo`: Verifies that the actual LocalDate is after or equals to the given one.
- `isIn`: Same assertion as `AbstractAssert.isIn(Object...)` but to be used with `LocalDate` String representation.
- `isNotIn`: Same assertion as `AbstractAssert.isNotIn(Object...)` but to be used with `LocalDate` String representation.

The assertions taking `String` parameter(s) can be used with `LocalDate` String representation: `yyyy-MM-dd`.

Examples:
[source,java]
----
LocalDate localDate = new LocalDate(2000, 1, 1);

assertThat(localDate).hasYear(2000)
.hasMonthOfYear(1)
.hasDayOfMonth(1)
.isBefore(new LocalDate(2000, 1, 2))
.isBefore("2000-01-02")
.isBeforeOrEqualTo(new LocalDate(2000, 1, 1))
.isBeforeOrEqualTo("2000-01-01")
.isBeforeOrEqualTo(new LocalDate(2000, 1, 2))
.isBeforeOrEqualTo("2000-01-02")
.isEqualTo(new LocalDate(2000, 1, 1))
.isEqualTo("2000-01-01")
.isAfterOrEqualTo(new LocalDate(2000, 1, 1))
.isAfterOrEqualTo("2000-01-01")
.isAfterOrEqualTo(new LocalDate(1999, 12, 31))
.isAfterOrEqualTo("1999-12-31")
.isAfter(new LocalDate(1999, 12, 31))
.isAfter("1999-12-31")
.isNotEqualTo("2000-01-15")
.isNotEqualTo(new LocalDate(2000, 1, 15))
.isIn(new LocalDate(1999, 12, 31), new LocalDate(2000, 1, 1))
.isIn("1999-12-31", "2000-01-01")
.isNotIn(new LocalDate(1999, 12, 31), new LocalDate(2000, 1, 2))
.isNotIn("1999-12-31", "2000-01-02");
----


[[v2-1-0-release-notes]]
== AssertJ Joda Time 2.1.0

Release date: 2018-05-27

[[v2.1.0-contributors]]
[.release-note-category]#icon:user[] Contributors#

Thanks to John Killmer for his contribution.

[[v2.1.0-new-features]]
[.release-note-category]#icon:plus-circle[] New features#

Add `LocalDateTime` assertions providing the following ones (John Killmer):

- `hasYear`: Verifies that the year of the actual LocalDateTime is equal to the given year.
- `hasMonthOfYear`: Verifies that the month of the actual LocalDateTime is equal to the given month
- `hasDayOfMonth`: Verifies that the day of month of the actual LocalDateTime is equal to the given day of month
- `hasHourOfDay`: Verifies that the hour of the actual DateTime is equal to the given hour
- `hasMinuteOfHour`: Verifies that the minute of the actual LocalDateTime is equal to the given minute
- `hasSecondOfMinute`: Verifies that the seconds of the actual LocalDateTime is equal to the given seconds
- `hasMillisOfSecond`: Verifies that the milliseconds of the actual LocalDateTime is equal to the given milliseconds

Examples:
[source,java]
----
DateTime dateTime = new DateTime(1999, 12, 31, 23, 59, 59, 999, DateTimeZone.UTC);

assertThat(dateTime).hasYear(1999)
.hasMonthOfYear(12)
.hasDayOfMonth(31)
.hasHourOfDay(23)
.hasMinuteOfHour(59)
.hasSecondOfMinute(59)
.hasMillisOfSecond(999);
----

[[v2-0-0-release-notes]]
== AssertJ Joda Time 2.0.0

Release date: 2016-04-10

[[v2.0.0-contributors]]
[.release-note-category]#icon:user[] Contributors#

Thanks to Pascal Schumacher and David Simmons for their contributions.

[[v2-0-0-breaking-changes]]
[.release-note-category]#icon:exclamation-triangle[] Breaking changes#

AssertJ Joda Time 2.0.0 requires Java 8 as it relies on AssertJ Core 3.x, use 1.1.0 version if you are still using Java 7.

[[v2-0-0-improvements]]
[.release-note-category]#icon:arrow-circle-up[] Improvements#

* DateTime assertion: better handling of null in assertions. (David Simmons)
* To be OS agnostic, replace `\n` with `%n` in error messages. (Pascal Schumacher)
* Better spacing in Javadoc code examples. (Pascal Schumacher)
8 changes: 8 additions & 0 deletions assertj-swing/antora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: assertj-swing
title: AssertJ Swing
version: ~
nav:
- modules/ROOT/nav.adoc
asciidoc:
attributes:
assertj-swing-github: 'https://github.com/assertj/assertj-swing'
1 change: 1 addition & 0 deletions assertj-swing/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* xref:index.adoc[]
30 changes: 30 additions & 0 deletions assertj-swing/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
= Release Notes

NOTE: AssertJ Swing would not exist without its contributors, you can find them all {assertj-swing-github}/graphs/contributors[directly on GitHub].

Older release notes can be found in the old site: https://joel-costigliola.github.io/assertj/assertj-swing-news.html, this is important to be aware of breaking changes if you are migrating from an old version.

[[v3-17-0-release-notes]]
== AssertJ Swing 3.17.0

Release date: 2020-09-13

[[v3.17.0-contributors]]
[.release-note-category]#icon:user[] Contributors#

Thanks to all the contributors of this release: diba1013, Stefano Cordio and Edwin Stang.

[[v3.17.0-breaking-changes]]
[.release-note-category]#icon:exclamation-triangle[] Breaking changes#

* Change of AssertJ Core from 3.11.1 to 3.17.0

[[v3.17.0-improvements]]
[.release-note-category]#icon:arrow-circle-up[] Improvements#

* Allow exceptions to be thrown for smaller test-code footprint.

[[v3.17.0-fixed]]
[.release-note-category]#icon:wrench[] Fixed#

* Fix: NPE on invoking JFrames with tray within AssertJSwingJUnitTestCase. (Edwin Stang)
Loading