Skip to content

Commit 72b3f06

Browse files
authored
Move tests to their recipe's package and name them after it (K10 of #1330) (#1358)
* Move tests into the package of the recipe they test `AddTableGeneratorTest` and `MigrateJaxwsMavenPluginTest` move to `javax`, `ApacheDefaultProviderTest` and `ServletIsRequestedSessionIdFromURLTest` to `javaee8`, `OpenJPAPersistenceProviderTest` to `javaee7`, and `MigrateZipErrorToZipExceptionTest` to the root package. * Name tests after the recipe they run Rename tests whose class name pointed at a different recipe, and retarget `UpgradeSpringBootParentForJava25Test` and `AddJakartaXmlBindRuntimeTest` at the recipe they mostly exercise, keeping the end-to-end cases on the composite. Split the Log4j2, JUL, JBoss and Commons Logging cases out of `UseSlf4jTest` into one test class per recipe, and fold the `NoGuava` integration tests for `Predicates.equalTo` and `Sets.filter` into `NoGuavaTest`: their sub-recipes on their own produce different output. * Load declarative recipes with `recipeFromResources` in tests Replace `Environment.builder().scanRuntimeClasspath(..)` in `UseVarKeywordTest`, `JavaLangAPIsTest` and `PreferJavaUtilOptionalTest`. `PreferJavaUtilOptionalTest` now runs `PreferJavaUtilOptional` rather than all of `NoGuava`; the one case that also relies on the `Supplier` type change adds `PreferJavaUtilSupplier`. Drop the second `@DocumentExample`, which sat on an `@ExpectedToFail` test.
1 parent 89037b6 commit 72b3f06

24 files changed

Lines changed: 452 additions & 418 deletions

src/test/java/org/openrewrite/java/migrate/lang/MigrateZipErrorToZipExceptionTest.java renamed to src/test/java/org/openrewrite/java/migrate/MigrateZipErrorToZipExceptionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.openrewrite.java.migrate.lang;
16+
package org.openrewrite.java.migrate;
1717

1818
import org.junit.jupiter.api.Test;
1919
import org.openrewrite.DocumentExample;

src/test/java/org/openrewrite/java/migrate/UpgradeSpringBootForJava25Test.java renamed to src/test/java/org/openrewrite/java/migrate/UpgradeSpringBootParentForJava25Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
import static org.assertj.core.api.Assertions.assertThat;
2626
import static org.openrewrite.maven.Assertions.pomXml;
2727

28-
class UpgradeSpringBootForJava25Test implements RewriteTest {
28+
class UpgradeSpringBootParentForJava25Test implements RewriteTest {
2929
@Override
3030
public void defaults(RecipeSpec spec) {
31-
spec.recipeFromResources("org.openrewrite.java.migrate.UpgradePluginsForJava25");
31+
spec.recipeFromResources("org.openrewrite.java.migrate.UpgradeSpringBootParentForJava25");
3232
}
3333

3434
@DocumentExample

‎src/test/java/org/openrewrite/java/migrate/guava/NoGuavaPredicatesEqualToTest.java‎

Lines changed: 0 additions & 132 deletions
This file was deleted.

‎src/test/java/org/openrewrite/java/migrate/guava/NoGuavaSetsFilterTest.java‎

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)