百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

assertj-examples

> 编程语言
开源

说明 AssertJ 断言的示例

399 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

说明 AssertJ 断言的示例

AssertJ examples

AssertJ examples is divided in two : assertions-examples (core, guava and joda assertions) and AssertJ swing modules.

The main branch contains examples with the latest released version of AssertJ modules (for Java 8).

There are several branches that contain examples for the ongoing development versions of AssertJ modules. That means you have to build the according AssertJ modules by your own before new features compile. The following table contains these special branches that are merged into the main each time the module is released.

Branch Modules
with-latest-snapshot-versions Core 3.x for Java 8
with-latest-swing-snapshot Swing

AssertJ assertions examples

assertj-examples/assertions-examples contains executable AssertJ assertions examples that you can run as JUnit tests. Please have a look at assertions examples sources.

The main branch contains examples with the latest released version of AssertJ modules for Java 8, similarly the java-7 branch contains examples of AssertJ modules for Java 7. You should be able to build those two branches with mvn clean install command.

In your IDE, add src/test/generated-assertions to the project java test sources otherwise you will have errors/missing classes. This is the folder where custom assertions classes are generated by default by the maven assertions generator plugin. Note that Intellij Idea wrongly adds src/test/generated-assertions to the production sources when it should be added the test sources, you will have to fix that in your module/project settings.

Building with-latest-snapshot-versions is a little more complicated :

  • you need to build the needed SNAPSHOT dependencies before - most probably assertj-core and maybe other modules.
  • run mvn clean install in assertj-examples/assertions-examples.
  • In your IDE, add src/test/generated-assertions to the project java sources if you IDE shows errors/missing classes.

AssertJ-Swing examples

The main branch contains examples with the latest released version of AssertJ modules => you should be able to build it with mvn clean install command.

assertj-swing-aut contains the AUT (application under test) that is tested by the examples.

assertj-swing-junit-examples contains executable AssertJ-Swing examples that you can inspect and run as JUnit tests. Please have a look at swing-junit-examples sources.

assertj-swing-testng-examples contains executable AssertJ-Swing examples that you can inspect and run as TestNG tests. Please have a look at swing-testng-examples sources.

Contributing

Contributing is easy, only two rules to follow :

  • Checkout the snapshot branch corresponding to your examples, it should be with-latest-snapshot-versions most of the time (not main!)
  • Use AssertJ code Eclipse formatting preferences (for Idea users, it is possible to import it)
  • Add FUN examples ! ;-)

Thanks !

Issues· 4 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javaassertjassertj-assertionsjava

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言