|
| 1 | +/* |
| 2 | + * Copyright 2024 the original author or authors. |
| 3 | + * <p> |
| 4 | + * Licensed under the Moderne Source Available License (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * <p> |
| 8 | + * https://docs.moderne.io/licensing/moderne-source-available-license |
| 9 | + * <p> |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +package org.openrewrite.java.migrate.jakarta; |
| 17 | + |
| 18 | +import org.junit.jupiter.api.Test; |
| 19 | +import org.openrewrite.test.RewriteTest; |
| 20 | + |
| 21 | +import static org.openrewrite.maven.Assertions.pomXml; |
| 22 | + |
| 23 | +class JakartaEE10Test implements RewriteTest { |
| 24 | + |
| 25 | + @Override |
| 26 | + public void defaults(RecipeSpec spec) { |
| 27 | + spec.recipeFromResources("org.openrewrite.java.migrate.jakarta.JakartaEE10"); |
| 28 | + } |
| 29 | + |
| 30 | + @DocumentExample |
| 31 | + @Test |
| 32 | + void chainedJettyUpgradeEE10() { |
| 33 | + rewriteRun( |
| 34 | + pomXml( |
| 35 | + """ |
| 36 | + <project> |
| 37 | + <modelVersion>4.0.0</modelVersion> |
| 38 | + <groupId>com.example</groupId> |
| 39 | + <artifactId>demo</artifactId> |
| 40 | + <version>0.0.1-SNAPSHOT</version> |
| 41 | + <dependencies> |
| 42 | + <dependency> |
| 43 | + <groupId>org.eclipse.jetty.websocket</groupId> |
| 44 | + <artifactId>websocket-server</artifactId> |
| 45 | + <version>9.4.58.v20250814</version> |
| 46 | + </dependency> |
| 47 | + </dependencies> |
| 48 | + </project> |
| 49 | + """, |
| 50 | + """ |
| 51 | + <project> |
| 52 | + <modelVersion>4.0.0</modelVersion> |
| 53 | + <groupId>com.example</groupId> |
| 54 | + <artifactId>demo</artifactId> |
| 55 | + <version>0.0.1-SNAPSHOT</version> |
| 56 | + <dependencies> |
| 57 | + <dependency> |
| 58 | + <groupId>org.eclipse.jetty.ee10.websocket</groupId> |
| 59 | + <artifactId>jetty-ee10-websocket-jetty-server</artifactId> |
| 60 | + <version>12.1.3</version> |
| 61 | + </dependency> |
| 62 | + </dependencies> |
| 63 | + </project> |
| 64 | + """ |
| 65 | + ) |
| 66 | + ); |
| 67 | + } |
| 68 | +} |
0 commit comments