3
3
import static org .hamcrest .MatcherAssert .assertThat ;
4
4
import static org .hamcrest .Matchers .containsString ;
5
5
import static org .hamcrest .Matchers .equalTo ;
6
+ import static org .junit .jupiter .api .Assertions .assertTrue ;
6
7
7
8
import java .util .Optional ;
8
- import org .junit .jupiter .api .Assertions ;
9
9
import org .junit .jupiter .api .Test ;
10
10
import software .amazon .smithy .build .MockManifest ;
11
11
import software .amazon .smithy .build .PluginContext ;
12
- import software .amazon .smithy .codegen .core .CodegenException ;
13
12
import software .amazon .smithy .model .Model ;
14
13
import software .amazon .smithy .model .node .Node ;
15
14
import software .amazon .smithy .model .node .ObjectNode ;
@@ -36,10 +35,10 @@ public void generatesRuntimeConfigFiles() {
36
35
37
36
// Did we generate the runtime config files?
38
37
// note that asserting the contents of runtime config files is handled in its own unit tests.
39
- Assertions . assertTrue (manifest .hasFile ("package.json" ));
40
- Assertions . assertTrue (manifest .hasFile (CodegenUtils .SOURCE_FOLDER + "/runtimeConfig.browser.ts" ));
41
- Assertions . assertTrue (manifest .hasFile (CodegenUtils .SOURCE_FOLDER + "/runtimeConfig.ts" ));
42
- Assertions . assertTrue (manifest .hasFile (CodegenUtils .SOURCE_FOLDER + "/index.ts" ));
38
+ assertTrue (manifest .hasFile ("package.json" ));
39
+ assertTrue (manifest .hasFile (CodegenUtils .SOURCE_FOLDER + "/runtimeConfig.browser.ts" ));
40
+ assertTrue (manifest .hasFile (CodegenUtils .SOURCE_FOLDER + "/runtimeConfig.ts" ));
41
+ assertTrue (manifest .hasFile (CodegenUtils .SOURCE_FOLDER + "/index.ts" ));
43
42
44
43
// Does the package.json file point to the runtime config?
45
44
String packageJsonContents = manifest .getFileString ("package.json" ).get ();
@@ -69,8 +68,8 @@ public void decoratesSymbolProvider() {
69
68
70
69
new TypeScriptCodegenPlugin ().execute (context );
71
70
72
- Assertions . assertTrue (manifest .hasFile (CodegenUtils . SOURCE_FOLDER + "/ Foo.ts" ));
73
- assertThat (manifest .getFileString (CodegenUtils . SOURCE_FOLDER + "/ Foo.ts" ).get (), containsString ("export class Foo" ));
71
+ assertTrue (manifest .hasFile (" Foo.ts" ));
72
+ assertThat (manifest .getFileString (" Foo.ts" ).get (), containsString ("export class Foo" ));
74
73
}
75
74
76
75
@ Test
@@ -91,11 +90,11 @@ public void generatesServiceClients() {
91
90
.build ();
92
91
new TypeScriptCodegenPlugin ().execute (context );
93
92
94
- Assertions . assertTrue (manifest .hasFile (CodegenUtils .SOURCE_FOLDER + "/Example.ts" ));
93
+ assertTrue (manifest .hasFile (CodegenUtils .SOURCE_FOLDER + "/Example.ts" ));
95
94
assertThat (manifest .getFileString (CodegenUtils .SOURCE_FOLDER + "/Example.ts" ).get (),
96
95
containsString ("export class Example extends ExampleClient" ));
97
96
98
- Assertions . assertTrue (manifest .hasFile (CodegenUtils .SOURCE_FOLDER + "/ExampleClient.ts" ));
97
+ assertTrue (manifest .hasFile (CodegenUtils .SOURCE_FOLDER + "/ExampleClient.ts" ));
99
98
assertThat (manifest .getFileString (CodegenUtils .SOURCE_FOLDER + "/ExampleClient.ts" ).get (), containsString ("export class ExampleClient" ));
100
99
}
101
100
0 commit comments