Skip to content

Commit

Permalink
Keep skipped packages test and add Lambda invoke class
Browse files Browse the repository at this point in the history
  • Loading branch information
davidh44 committed Sep 16, 2024
1 parent 111f67a commit aa7e116
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
22 changes: 22 additions & 0 deletions v2-migration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,28 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-dynamodb</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-lambda</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-maven</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class ChangeSdkTypeTest implements RewriteTest {

@Override
public void defaults(RecipeSpec spec) {
spec.recipe(new ChangeSdkType()).parser(Java8Parser.builder().classpath("aws-java-sdk-sqs", "sqs"));
spec.recipe(new ChangeSdkType()).parser(Java8Parser.builder().classpath("aws-java-sdk-sqs", "sqs", "aws-java-sdk-s3",
"aws-java-sdk-dynamodb", "aws-java-sdk-lambda"));
}

@Test
Expand Down Expand Up @@ -215,4 +216,34 @@ void shouldChangeFieldsInInnerClass() {
)
);
}

@Test
@EnabledOnJre({JRE.JAVA_8})
void hasUnsupportedFeature_shouldSkip() {
rewriteRun(
java(
"import com.amazonaws.services.s3.transfer.TransferManager;\n" +
"import com.amazonaws.services.sqs.model.DeleteQueueRequest;\n" +
"import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;\n" +
"import com.amazonaws.services.lambda.invoke.LambdaFunction;\n" +
"class Test {\n" +
" private TransferManager transferManager;\n" +
" private DeleteQueueRequest deleteQueue;\n" +
" private DynamoDBMapper ddbMapper;\n" +
" private LambdaFunction lambdaFunction;\n" +
"}\n",
"import com.amazonaws.services.s3.transfer.TransferManager;\n"
+ "import software.amazon.awssdk.services.sqs.model.DeleteQueueRequest;\n"
+ "import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;\n"
+ "import com.amazonaws.services.lambda.invoke.LambdaFunction;\n"
+ "\n"
+ "class Test {\n"
+ " private TransferManager transferManager;\n"
+ " private DeleteQueueRequest deleteQueue;\n"
+ " private DynamoDBMapper ddbMapper;\n"
+ " private LambdaFunction lambdaFunction;\n"
+ "}"
)
);
}
}

0 comments on commit aa7e116

Please sign in to comment.