...internal.Iterables is used in Asserts generated by assertj-assertions-generator (java9)
还没有人认领这个 Issue。
评估
调研方向
首先检查生成 org.assertj.core.internal.Iterables 导入的断言生成路径,然后在 Java 9+ 模块化项目中复现生成代码的编译失败。完成标准是生成的断言不再依赖未导出的内部类,并且能够在 Java 9 及更高版本上成功编译。
由索引模型根据 Issue 内容生成。
描述
Summary
Hi,
I am migrating from java 8 to 17 and had big trouble getting the generated assertions to work (actually is does not work at all, is it dead?)
But even with great hacks I cannot get arround that the generated code imports the internal class org.assertj.core.internal.Iterables which is (of course) not exported by assertj-core. Could this become public? Or could the code-generator be updated? Which btw has medium CVEs in it's dependencies.
Example
import org.assertj.core.internal.Iterables;
//this is part of the generated code
public YAssert hasXs(X... xs) {
// check that actual Y we want to make assertions on is not null.
isNotNull();
// check that given X varargs is not null.
if (x== null) failWithMessage("Expecting x parameter not to be null.");
// check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
Iterables.instance().assertContains(info, actual.getX(), xs);
// return the current assertion for method chaining
return this;
}
Package 'org.assertj.core.internal' is declared in module 'org.assertj.core', which does not export it to module 'my.assertions'
In other words: Is does not compile in Java > 8 which renders the complete code generation useless.
- 主要语言
- Java
- 星标
- 72
- 派生
- 47
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
assertj/assertj-generator 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
assertj/assertj-generator#278 ·
-
难度 5/5 一周以上 新手友好度 30/100
assertj/assertj-generator#220 ·
-
难度 5/5 一周以上 新手友好度 35/100
assertj/assertj-generator#219 ·
-
难度 5/5 一周以上 新手友好度 35/100
assertj/assertj-generator#204 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 35/100
assertj/assertj-generator#196 ·
查看 assertj/assertj-generator 的全部 Issue
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 65/100
inu-appcenter/memorIN-backend#288 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
frontend maui-pilot pilot-ask question
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
area/plugin
难度 2/5 1-3 小时 新手友好度 75/100
kestra-io/plugin-kestra#190 ·