|
15 | 15 | */ |
16 | 16 | package org.openrewrite.java.migrate; |
17 | 17 |
|
18 | | -import org.junit.jupiter.api.Nested; |
19 | 18 | import org.junit.jupiter.api.Test; |
20 | 19 | import org.openrewrite.DocumentExample; |
21 | | -import org.openrewrite.Recipe; |
22 | 20 | import org.openrewrite.java.JavaParser; |
23 | | -import org.openrewrite.java.tree.J; |
24 | | -import org.openrewrite.java.tree.JavaSourceFile; |
25 | 21 | import org.openrewrite.test.RecipeSpec; |
26 | 22 | import org.openrewrite.test.RewriteTest; |
27 | 23 |
|
28 | | -import java.util.List; |
29 | | - |
30 | | -import static org.assertj.core.api.Assertions.assertThat; |
31 | 24 | import static org.openrewrite.java.Assertions.java; |
32 | 25 |
|
33 | 26 | class InlineMethodCallsTest implements RewriteTest { |
@@ -444,77 +437,4 @@ void foo(Builder builder) { |
444 | 437 | ) |
445 | 438 | ); |
446 | 439 | } |
447 | | - |
448 | | - @Nested |
449 | | - class Guava { |
450 | | - @Test |
451 | | - void stringsRegular() { |
452 | | - rewriteRun( |
453 | | - java( |
454 | | - """ |
455 | | - import com.google.common.base.Strings; |
456 | | - class Regular { |
457 | | - String repeatString(String s, int n) { |
458 | | - return Strings.repeat(s, n); |
459 | | - } |
460 | | - } |
461 | | - """, |
462 | | - """ |
463 | | - class Regular { |
464 | | - String repeatString(String s, int n) { |
465 | | - return s.repeat(n); |
466 | | - } |
467 | | - } |
468 | | - """ |
469 | | - ) |
470 | | - ); |
471 | | - } |
472 | | - |
473 | | - @Test |
474 | | - void stringsStaticImport() { |
475 | | - rewriteRun( |
476 | | - java( |
477 | | - """ |
478 | | - import static com.google.common.base.Strings.repeat; |
479 | | - class StaticImport { |
480 | | - String repeatString(String s, int n) { |
481 | | - return repeat(s, n); |
482 | | - } |
483 | | - } |
484 | | - """, |
485 | | - """ |
486 | | - class StaticImport { |
487 | | - String repeatString(String s, int n) { |
488 | | - return s.repeat(n); |
489 | | - } |
490 | | - } |
491 | | - """ |
492 | | - ) |
493 | | - ); |
494 | | - } |
495 | | - |
496 | | - @Test |
497 | | - void methodTypeParameterNames() { |
498 | | - rewriteRun( |
499 | | - spec -> spec.beforeRecipe(list -> { |
500 | | - JavaSourceFile first = (JavaSourceFile) list.getFirst(); |
501 | | - J.MethodDeclaration foo = (J.MethodDeclaration) first.getClasses().getFirst().getBody().getStatements().getFirst(); |
502 | | - J.MethodInvocation repeat = (J.MethodInvocation) foo.getBody().getStatements().getFirst(); |
503 | | - List<String> parameterNames = repeat.getMethodType().getParameterNames(); |
504 | | - assertThat(parameterNames).containsExactly("string", "count"); |
505 | | - }) |
506 | | - .recipe(Recipe.noop()), |
507 | | - java( |
508 | | - """ |
509 | | - import com.google.common.base.Strings; |
510 | | - class Foo { |
511 | | - void foo(String s, int n) { |
512 | | - Strings.repeat(s, n); |
513 | | - } |
514 | | - } |
515 | | - """ |
516 | | - ) |
517 | | - ); |
518 | | - } |
519 | | - } |
520 | 440 | } |
0 commit comments