Class OpenAssertions
java.lang.Object
cloud.opencode.base.test.assertion.OpenAssertions
Open Assertions
开放断言
Fluent assertion utilities for testing.
用于测试的流式断言工具。
Features | 主要功能:
- Fluent assertion API - 流式断言API
- Object, string, collection, number assertions - 对象、字符串、集合、数值断言
Usage Examples | 使用示例:
assertThat("hello").isNotBlank().contains("ell");
assertThat(List.of(1, 2, 3)).hasSize(3).contains(2);
assertThatThrownBy(() -> { throw new RuntimeException(); })
.isInstanceOf(RuntimeException.class);
Security | 安全性:
- Thread-safe: Yes (stateless) - 线程安全: 是(无状态)
- Since:
- JDK 25, opencode-base-test V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionassertThat(Boolean actual) assertThat(Number actual) assertThat(String actual) static <T> OpenAssertions.CollectionAssertion<T> assertThat(Collection<T> actual) static <K,V> OpenAssertions.MapAssertion <K, V> assertThat(Map<K, V> actual) static <T> OpenAssertions.ObjectAssertion<T> assertThat(T actual) static voidassertThatCode(Runnable runnable) assertThatThrownBy(Runnable runnable)
-
Method Details
-
assertThat
-
assertThat
-
assertThat
-
assertThat
-
assertThat
-
assertThat
-
assertThatThrownBy
-
assertThatCode
-