Skip to content

Commit 5503299

Browse files
authored
Fix package/file naming and test (#5426)
1 parent ae31d77 commit 5503299

File tree

6 files changed

+7
-10
lines changed

6 files changed

+7
-10
lines changed

test/v2-migration-tests/src/test/resources/maven/after/src/main/java/foo/bar/Application.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private static Path downloadFile(S3Client s3, String bucket, String key, Path ds
9595
}
9696

9797
private static PutObjectResponse uploadFile(S3Client s3, String bucket, String key, Path source) throws IOException {
98-
PutObjectResponse result = s3.putObject(PutObjectRequest.builder()
98+
PutObjectResponse result = s3.putObject(PutObjectRequest.builder().bucket(bucket).key(key)
9999
.build(), RequestBody.fromFile(source.toFile()));
100100

101101
return result;

v2-migration/src/main/resources/META-INF/rewrite/s3-getobject-constructor-to-fluent.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
---
1616
type: specs.openrewrite.org/v1beta/recipe
1717
name: software.amazon.awssdk.v2migration.S3GetObjectConstructorToFluent
18-
displayName: Change auth related classes
18+
displayName: Change GetObject constructors to fluent builder calls
1919
recipeList:
2020
- software.amazon.awssdk.v2migration.ConstructorToFluent:
2121
clzzFqcn: com.amazonaws.services.s3.model.GetObjectRequest

v2-migration/src/main/resources/META-INF/rewrite/s3-putbject-constructor-to-fluent.yml renamed to v2-migration/src/main/resources/META-INF/rewrite/s3-putobject-constructor-to-fluent.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#
1515
---
1616
type: specs.openrewrite.org/v1beta/recipe
17-
name: software.amazon.awssdk.S3PutObjectConstructorToFluent
17+
name: software.amazon.awssdk.v2migration.S3PutObjectConstructorToFluent
1818
displayName: Change PutObject constructors to fluent builder calls
1919
recipeList:
20-
- software.amazon.awssdk.migration.internal.recipe.ConstructorToFluent:
20+
- software.amazon.awssdk.v2migration.ConstructorToFluent:
2121
clzzFqcn: com.amazonaws.services.s3.model.PutObjectRequest
2222
parameterTypes:
2323
- java.lang.String
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.v2migration.internal.recipe;
16+
package software.amazon.awssdk.v2migration;
1717

1818
import static org.assertj.core.api.Assertions.assertThatThrownBy;
1919
import static org.openrewrite.java.Assertions.java;
@@ -26,7 +26,6 @@
2626
import org.openrewrite.java.Java8Parser;
2727
import org.openrewrite.test.RecipeSpec;
2828
import org.openrewrite.test.RewriteTest;
29-
import software.amazon.awssdk.v2migration.ConstructorToFluent;
3029

3130
/**
3231
* Recipe that remaps invocations of model constructors that take some members as constructor parameters, so that the
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.v2migration.internal.recipe;
16+
package software.amazon.awssdk.v2migration;
1717

1818
import static org.openrewrite.java.Assertions.java;
1919

@@ -23,7 +23,6 @@
2323
import org.junit.jupiter.api.condition.JRE;
2424
import org.openrewrite.java.Java8Parser;
2525
import org.openrewrite.test.RewriteTest;
26-
import software.amazon.awssdk.v2migration.NumberToDuration;
2726

2827
public class NumberToDurationTest implements RewriteTest {
2928

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
package software.amazon.awssdk.v2migration.internal.recipe;
16+
package software.amazon.awssdk.v2migration;
1717

1818
import static org.openrewrite.java.Assertions.java;
1919

@@ -23,7 +23,6 @@
2323
import org.openrewrite.java.Java8Parser;
2424
import org.openrewrite.test.RecipeSpec;
2525
import org.openrewrite.test.RewriteTest;
26-
import software.amazon.awssdk.v2migration.S3StreamingResponseToV2;
2726

2827
public class S3StreamingResponseToV2Test implements RewriteTest {
2928
@Override

0 commit comments

Comments
 (0)