We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using the latest version from the tip of GitHub's main branch.
main
Add the below test case to org.openrewrite.java.style.ImportLayoutStyleTest
org.openrewrite.java.style.ImportLayoutStyleTest
@Test void testAddImport() { ImportLayoutStyle style = new ImportLayoutStyle( Integer.MAX_VALUE, Integer.MAX_VALUE, Collections.emptyList(), Collections.emptyList()); JRightPadded<J.Import> import1 = new JRightPadded<>( new J.Import( randomId(), Space.EMPTY, Markers.EMPTY, new JLeftPadded<>(Space.SINGLE_SPACE, true, Markers.EMPTY), TypeTree.build("pkg.Clazz.MEMBER_1").withPrefix(Space.SINGLE_SPACE), null), Space.EMPTY, Markers.EMPTY); JRightPadded<J.Import> import2 = new JRightPadded<>( new J.Import( randomId(), Space.EMPTY, Markers.EMPTY, new JLeftPadded<>(Space.SINGLE_SPACE, true, Markers.EMPTY), TypeTree.build("pkg.Clazz.MEMBER_1").withPrefix(Space.SINGLE_SPACE), null), Space.EMPTY, Markers.EMPTY); J.Import importToAdd = new J.Import( randomId(), Space.EMPTY, Markers.EMPTY, new JLeftPadded<>(Space.SINGLE_SPACE, true, Markers.EMPTY), TypeTree.build("pkg.Clazz.MEMBER_2").withPrefix(Space.SINGLE_SPACE), null); assertThat(style.addImport(List.of(import1, import2), importToAdd, null, Collections.emptyList())) .containsExactlyInAnyOrder(import1, import1, new JRightPadded<>(importToAdd, Space.EMPTY, Markers.EMPTY)); }
containsExactlyInAnyOrder(import1, import1, new JRightPadded<>(importToAdd, Space.EMPTY, Markers.EMPTY))
containsExactlyInAnyOrder(import1, import1)
The text was updated successfully, but these errors were encountered:
nguyenhoan
Successfully merging a pull request may close this issue.
What version of OpenRewrite are you using?
I am using the latest version from the tip of GitHub's
main
branch.How are you running OpenRewrite?
What is the smallest, simplest way to reproduce the problem?
Add the below test case to
org.openrewrite.java.style.ImportLayoutStyleTest
What did you expect to see?
What did you see instead?
What is the full stack trace of any errors you encountered?
Are you interested in contributing a fix to OpenRewrite?
The text was updated successfully, but these errors were encountered: