AssertJ (Java): Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Die Seite wurde neu angelegt: „== Dependency == <pre> <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> <version>3.11.1</version> <scope>test</scope…“) |
|||
Zeile 1: | Zeile 1: | ||
== Beispiel == | |||
<pre> | |||
assertThat(frodo) | |||
.isNotEqualTo(sauron) | |||
.isIn(fellowshipOfTheRing); | |||
assertThat(frodo.getName()) | |||
.startsWith("Fro") | |||
.endsWith("do") | |||
.isEqualToIgnoringCase("frodo"); | |||
assertThat(fellowshipOfTheRing) | |||
.hasSize(9) | |||
.contains(frodo, sam) | |||
.doesNotContain(sauron); | |||
</pre> | |||
== Dependency == | == Dependency == | ||
Aktuelle Version vom 28. April 2019, 11:37 Uhr
Beispiel
assertThat(frodo) .isNotEqualTo(sauron) .isIn(fellowshipOfTheRing); assertThat(frodo.getName()) .startsWith("Fro") .endsWith("do") .isEqualToIgnoringCase("frodo"); assertThat(fellowshipOfTheRing) .hasSize(9) .contains(frodo, sam) .doesNotContain(sauron);
Dependency
<dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> <version>3.11.1</version> <scope>test</scope> </dependency>
Links
https://www.baeldung.com/introduction-to-assertj
Zurück zu Java