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 24
24
import software .amazon .awssdk .codegen .poet .PoetUtils ;
25
25
26
26
import javax .lang .model .element .Modifier ;
27
- import software .amazon .awssdk .core .rules .testing .BaseVersionCompatibilityTest ;
28
27
29
28
public class VersionCompatibilityTestSpec implements ClassSpec {
30
29
private final IntermediateModel model ;
@@ -36,7 +35,6 @@ public VersionCompatibilityTestSpec(IntermediateModel model) {
36
35
@ Override
37
36
public TypeSpec poetSpec () {
38
37
return PoetUtils .createClassBuilder (className ())
39
- .superclass (BaseVersionCompatibilityTest .class )
40
38
.addModifiers (Modifier .PUBLIC )
41
39
.addMethod (compatibilityTest ())
42
40
.build ();
@@ -53,11 +51,18 @@ private MethodSpec compatibilityTest() {
53
51
"ServiceVersionInfo"
54
52
);
55
53
54
+ ClassName versionInfo = ClassName .get ("software.amazon.awssdk.core.util" , "VersionInfo" );
55
+ ClassName assertions = ClassName .get ("org.assertj.core.api" , "Assertions" );
56
+
56
57
return MethodSpec .methodBuilder ("checkCompatibility" )
57
58
.addModifiers (Modifier .PUBLIC )
58
59
.addAnnotation (Test .class )
59
60
.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 )
61
65
.build ();
62
66
}
67
+
63
68
}
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