@@ -27,7 +27,7 @@ public class JavaSnippetTest {
27
27
public void generatesPlainSnippet () {
28
28
String expected = "" +
29
29
"@Given(\" ^I have (\\ \\ d+) cukes in my \\ \" ([^\\ \" ]*)\\ \" belly$\" )\n " +
30
- "public void i_have_cukes_in_my_belly(int arg1, String arg2) throws Throwable {\n " +
30
+ "public void i_have_cukes_in_my_belly(int arg1, String arg2) throws Exception {\n " +
31
31
" // Write code here that turns the phrase above into concrete actions\n " +
32
32
" throw new PendingException();\n " +
33
33
"}\n " ;
@@ -38,7 +38,7 @@ public void generatesPlainSnippet() {
38
38
public void generatesCopyPasteReadyStepSnippetForNumberParameters () throws Exception {
39
39
String expected = "" +
40
40
"@Given(\" ^before (\\ \\ d+) after$\" )\n " +
41
- "public void before_after(int arg1) throws Throwable {\n " +
41
+ "public void before_after(int arg1) throws Exception {\n " +
42
42
" // Write code here that turns the phrase above into concrete actions\n " +
43
43
" throw new PendingException();\n " +
44
44
"}\n " ;
@@ -50,7 +50,7 @@ public void generatesCopyPasteReadyStepSnippetForNumberParameters() throws Excep
50
50
public void generatesCopyPasteReadySnippetWhenStepHasIllegalJavaIdentifierChars () {
51
51
String expected = "" +
52
52
"@Given(\" ^I have (\\ \\ d+) cukes in: my \\ \" ([^\\ \" ]*)\\ \" red-belly!$\" )\n " +
53
- "public void i_have_cukes_in_my_red_belly(int arg1, String arg2) throws Throwable {\n " +
53
+ "public void i_have_cukes_in_my_red_belly(int arg1, String arg2) throws Exception {\n " +
54
54
" // Write code here that turns the phrase above into concrete actions\n " +
55
55
" throw new PendingException();\n " +
56
56
"}\n " ;
@@ -61,7 +61,7 @@ public void generatesCopyPasteReadySnippetWhenStepHasIllegalJavaIdentifierChars(
61
61
public void generatesCopyPasteReadySnippetWhenStepHasIntegersInsideStringParameter () {
62
62
String expected = "" +
63
63
"@Given(\" ^the DI system receives a message saying \\ \" ([^\\ \" ]*)\\ \" $\" )\n " +
64
- "public void the_DI_system_receives_a_message_saying(String arg1) throws Throwable {\n " +
64
+ "public void the_DI_system_receives_a_message_saying(String arg1) throws Exception {\n " +
65
65
" // Write code here that turns the phrase above into concrete actions\n " +
66
66
" throw new PendingException();\n " +
67
67
"}\n " ;
@@ -72,7 +72,7 @@ public void generatesCopyPasteReadySnippetWhenStepHasIntegersInsideStringParamet
72
72
public void generatesSnippetWithEscapedDollarSigns () {
73
73
String expected = "" +
74
74
"@Given(\" ^I have \\ \\ $(\\ \\ d+)$\" )\n " +
75
- "public void i_have_$(int arg1) throws Throwable {\n " +
75
+ "public void i_have_$(int arg1) throws Exception {\n " +
76
76
" // Write code here that turns the phrase above into concrete actions\n " +
77
77
" throw new PendingException();\n " +
78
78
"}\n " ;
@@ -83,7 +83,7 @@ public void generatesSnippetWithEscapedDollarSigns() {
83
83
public void generatesSnippetWithEscapedQuestionMarks () {
84
84
String expected = "" +
85
85
"@Given(\" ^is there an error\\ \\ ?:$\" )\n " +
86
- "public void is_there_an_error() throws Throwable {\n " +
86
+ "public void is_there_an_error() throws Exception {\n " +
87
87
" // Write code here that turns the phrase above into concrete actions\n " +
88
88
" throw new PendingException();\n " +
89
89
"}\n " ;
@@ -94,7 +94,7 @@ public void generatesSnippetWithEscapedQuestionMarks() {
94
94
public void generatesSnippetWithLotsOfEscapes () {
95
95
String expected = "" +
96
96
"@Given(\" ^\\ \\ ^\\ \\ (\\ \\ [a-z\\ \\ ]\\ \\ *\\ \\ )\\ \\ ?\\ \\ .\\ \\ +\\ \\ $$\" )\n " +
97
- "public void a_z_$() throws Throwable {\n " +
97
+ "public void a_z_$() throws Exception {\n " +
98
98
" // Write code here that turns the phrase above into concrete actions\n " +
99
99
" throw new PendingException();\n " +
100
100
"}\n " ;
@@ -105,7 +105,7 @@ public void generatesSnippetWithLotsOfEscapes() {
105
105
public void generatesSnippetWithEscapedParentheses () {
106
106
String expected = "" +
107
107
"@Given(\" ^I have (\\ \\ d+) cukes \\ \\ (maybe more\\ \\ )$\" )\n " +
108
- "public void i_have_cukes_maybe_more(int arg1) throws Throwable {\n " +
108
+ "public void i_have_cukes_maybe_more(int arg1) throws Exception {\n " +
109
109
" // Write code here that turns the phrase above into concrete actions\n " +
110
110
" throw new PendingException();\n " +
111
111
"}\n " ;
@@ -116,7 +116,7 @@ public void generatesSnippetWithEscapedParentheses() {
116
116
public void generatesSnippetWithEscapedBrackets () {
117
117
String expected = "" +
118
118
"@Given(\" ^I have (\\ \\ d+) cukes \\ \\ [maybe more\\ \\ ]$\" )\n " +
119
- "public void i_have_cukes_maybe_more(int arg1) throws Throwable {\n " +
119
+ "public void i_have_cukes_maybe_more(int arg1) throws Exception {\n " +
120
120
" // Write code here that turns the phrase above into concrete actions\n " +
121
121
" throw new PendingException();\n " +
122
122
"}\n " ;
@@ -127,7 +127,7 @@ public void generatesSnippetWithEscapedBrackets() {
127
127
public void generatesSnippetWithDocString () {
128
128
String expected = "" +
129
129
"@Given(\" ^I have:$\" )\n " +
130
- "public void i_have(String arg1) throws Throwable {\n " +
130
+ "public void i_have(String arg1) throws Exception {\n " +
131
131
" // Write code here that turns the phrase above into concrete actions\n " +
132
132
" throw new PendingException();\n " +
133
133
"}\n " ;
@@ -139,7 +139,7 @@ public void generatesSnippetWithDocString() {
139
139
public void recognisesWordWithNumbers () {
140
140
String expected = "" +
141
141
"@Given(\" ^Then it responds ([^\\ \" ]*)$\" )\n " +
142
- "public void Then_it_responds(String arg1) throws Throwable {\n " +
142
+ "public void Then_it_responds(String arg1) throws Exception {\n " +
143
143
" // Write code here that turns the phrase above into concrete actions\n " +
144
144
"}\n " ;
145
145
assertEquals (expected , snippetFor ("Then it responds UTF-8" ));
@@ -149,7 +149,7 @@ public void recognisesWordWithNumbers() {
149
149
public void generatesSnippetWithDataTable () {
150
150
String expected = "" +
151
151
"@Given(\" ^I have:$\" )\n " +
152
- "public void i_have(DataTable arg1) throws Throwable {\n " +
152
+ "public void i_have(DataTable arg1) throws Exception {\n " +
153
153
" // Write code here that turns the phrase above into concrete actions\n " +
154
154
" // For automatic transformation, change DataTable to one of\n " +
155
155
" // List<YourType>, List<List<E>>, List<Map<K,V>> or Map<K,V>.\n " +
@@ -164,7 +164,7 @@ public void generatesSnippetWithDataTable() {
164
164
public void generateSnippetWithOutlineParam () {
165
165
String expected = "" +
166
166
"@Given(\" ^Then it responds (.*)$\" )\n " +
167
- "public void then_it_responds(String arg1) throws Throwable {\n " +
167
+ "public void then_it_responds(String arg1) throws Exception {\n " +
168
168
" // Write code here that turns the phrase above into concrete actions\n " +
169
169
" throw new PendingException();\n " +
170
170
"}\n " ;
0 commit comments