Class OpenAssertions

java.lang.Object
cloud.opencode.base.test.assertion.OpenAssertions

public final class OpenAssertions extends Object
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: