File tree Expand file tree Collapse file tree 2 files changed +34
-3
lines changed
codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs
core/sdk-core/src/test/java/software/amazon/awssdk/core Expand file tree Collapse file tree 2 files changed +34
-3
lines changed Original file line number Diff line number Diff line change 2424import software .amazon .awssdk .codegen .poet .PoetUtils ;
2525
2626import javax .lang .model .element .Modifier ;
27- import software .amazon .awssdk .core .rules .testing .BaseVersionCompatibilityTest ;
2827
2928public class VersionCompatibilityTestSpec implements ClassSpec {
3029 private final IntermediateModel model ;
@@ -36,7 +35,6 @@ public VersionCompatibilityTestSpec(IntermediateModel model) {
3635 @ Override
3736 public TypeSpec poetSpec () {
3837 return PoetUtils .createClassBuilder (className ())
39- .superclass (BaseVersionCompatibilityTest .class )
4038 .addModifiers (Modifier .PUBLIC )
4139 .addMethod (compatibilityTest ())
4240 .build ();
@@ -53,11 +51,18 @@ private MethodSpec compatibilityTest() {
5351 "ServiceVersionInfo"
5452 );
5553
54+ ClassName versionInfo = ClassName .get ("software.amazon.awssdk.core.util" , "VersionInfo" );
55+ ClassName assertions = ClassName .get ("org.assertj.core.api" , "Assertions" );
56+
5657 return MethodSpec .methodBuilder ("checkCompatibility" )
5758 .addModifiers (Modifier .PUBLIC )
5859 .addAnnotation (Test .class )
5960 .returns (void .class )
60- .addStatement ("verifyVersionCompatibility($T.VERSION)" , serviceVersionInfo )
61+ .addStatement ("$T.assertThat($T.SDK_VERSION).isEqualTo($T.VERSION)" ,
62+ assertions ,
63+ versionInfo ,
64+ serviceVersionInfo )
6165 .build ();
6266 }
67+
6368}
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License").
5+ * You may not use this file except in compliance with the License.
6+ * A copy of the License is located at
7+ *
8+ * http://aws.amazon.com/apache2.0
9+ *
10+ * or in the "license" file accompanying this file. This file is distributed
11+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+ * express or implied. See the License for the specific language governing
13+ * permissions and limitations under the License.
14+ */
15+
16+ package software .amazon .awssdk .core ;
17+
18+ import static org .assertj .core .api .Assertions .assertThat ;
19+
20+ import software .amazon .awssdk .core .util .VersionInfo ;
21+
22+ public class BaseVersionCompatibilityTest {
23+ protected final void verifyVersionCompatibility (String serviceVersion ) {
24+ assertThat (VersionInfo .SDK_VERSION ).isEqualTo (serviceVersion );
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments