Skip to content

Commit 5d6ff6e

Browse files
Remove unnecessary IOException declarations (#295)
* Remove unnecessary IOException from 14 test methods Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com> * Remove redundant FileNotFoundException declaration Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
1 parent 833f43c commit 5d6ff6e

8 files changed

Lines changed: 15 additions & 16 deletions

File tree

samples/get-statement-with-attachment/src/main/java/dev/learning/xapi/samples/poststatement/GetStatementWithAttachmentApplication.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import dev.learning.xapi.client.XapiClient;
88
import dev.learning.xapi.model.Statement;
99
import dev.learning.xapi.model.Verb;
10-
import java.io.FileNotFoundException;
1110
import java.io.IOException;
1211
import java.net.URI;
1312
import java.nio.file.Files;
@@ -63,7 +62,7 @@ public void run(String... args) throws Exception {
6362

6463
}
6564

66-
private UUID postStatement() throws FileNotFoundException, IOException {
65+
private UUID postStatement() throws IOException {
6766

6867
// Load jpg attachment from class-path
6968
var data = Files.readAllBytes(ResourceUtils.getFile("classpath:example.jpg").toPath());

xapi-model/src/test/java/dev/learning/xapi/model/AboutTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void whenSerializingAboutWithExtensionsThenResultIsEqualToExpectedJson() throws
138138
}
139139

140140
@Test
141-
void whenCallingToStringThenResultIsExpected() throws IOException {
141+
void whenCallingToStringThenResultIsExpected() {
142142

143143
final var extensions = new LinkedHashMap<URI, Object>();
144144
extensions.put(URI.create("http://url"), "www.example.com");

xapi-model/src/test/java/dev/learning/xapi/model/AccountTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void whenSerializingAccountThenResultIsEqualToExpectedJson() throws IOException
9494
}
9595

9696
@Test
97-
void whenCallingToStringThenResultIsExpected() throws IOException {
97+
void whenCallingToStringThenResultIsExpected() {
9898

9999
final var account = Account.builder()
100100

xapi-model/src/test/java/dev/learning/xapi/model/ActivityTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void whenSerializingActivityThenResultIsEqualToExpectedJson() throws IOException
109109
}
110110

111111
@Test
112-
void whenCallingToStringThenResultIsExpected() throws IOException {
112+
void whenCallingToStringThenResultIsExpected() {
113113

114114
final var activity = Activity.builder()
115115

xapi-model/src/test/java/dev/learning/xapi/model/ContextActivitiesTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void whenCallingToStringThenResultIsExpected() throws IOException {
134134
}
135135

136136
@Test
137-
void whenBuildingContextActivitiesWithTwoParentsThenParentIshasSizeTwo() throws IOException {
137+
void whenBuildingContextActivitiesWithTwoParentsThenParentIshasSizeTwo() {
138138

139139
// When Building ContextActivities With Two Parents
140140
final var contextActivities = ContextActivities.builder()
@@ -151,7 +151,7 @@ void whenBuildingContextActivitiesWithTwoParentsThenParentIshasSizeTwo() throws
151151
}
152152

153153
@Test
154-
void whenBuildingContextActivitiesWithTwoGroupingThenGroupingIshasSizeTwo() throws IOException {
154+
void whenBuildingContextActivitiesWithTwoGroupingThenGroupingIshasSizeTwo() {
155155

156156
// When Building ContextActivities With Two Groupings
157157
final var contextActivities = ContextActivities.builder()
@@ -168,7 +168,7 @@ void whenBuildingContextActivitiesWithTwoGroupingThenGroupingIshasSizeTwo() thro
168168
}
169169

170170
@Test
171-
void whenBuildingContextActivitiesWithTwoOtherThenOtherIshasSizeTwo() throws IOException {
171+
void whenBuildingContextActivitiesWithTwoOtherThenOtherIshasSizeTwo() {
172172

173173
// When Building ContextActivities With Two Others
174174
final var contextActivities = ContextActivities.builder()
@@ -185,7 +185,7 @@ void whenBuildingContextActivitiesWithTwoOtherThenOtherIshasSizeTwo() throws IOE
185185
}
186186

187187
@Test
188-
void whenBuildingContextActivitiesWithTwoCategoriesThenCategoryIshasSizeTwo() throws IOException {
188+
void whenBuildingContextActivitiesWithTwoCategoriesThenCategoryIshasSizeTwo() {
189189

190190
// When Building ContextActivities With Two Categories
191191
final var contextActivities = ContextActivities.builder()

xapi-model/src/test/java/dev/learning/xapi/model/GroupTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void whenCallingToStringThenResultIsExpected() throws IOException {
109109
}
110110

111111
@Test
112-
void givenGroupWithNameAndMembersWhenCallingIsAnonymousThenResultIsTrue() throws IOException {
112+
void givenGroupWithNameAndMembersWhenCallingIsAnonymousThenResultIsTrue() {
113113

114114
// Given Group With Name And Members
115115
final Group group = Group.builder()
@@ -131,7 +131,7 @@ void givenGroupWithNameAndMembersWhenCallingIsAnonymousThenResultIsTrue() throws
131131
}
132132

133133
@Test
134-
void givenGroupWithNameAndNoMembersWhenCallingIsAnonymousThenResultIsFalse() throws IOException {
134+
void givenGroupWithNameAndNoMembersWhenCallingIsAnonymousThenResultIsFalse() {
135135

136136
// Given Group With Name And Empty Members
137137
final Group group = Group.builder()
@@ -172,7 +172,7 @@ void givenGroupWithNameAndNullMembersWhenCallingIsAnonymousThenResultIsFalse()
172172
}
173173

174174
@Test
175-
void givenGroupWithMboxAndMembersWhenCallingIsAnonymousThenResultIsFalse() throws IOException {
175+
void givenGroupWithMboxAndMembersWhenCallingIsAnonymousThenResultIsFalse() {
176176

177177
// Given Group With MBox And Members
178178
final Group group = Group.builder()
@@ -217,7 +217,7 @@ void givenGroupWithMboxSha1sumAndMembersWhenCallingIsAnonymousThenResultIsFalse(
217217
}
218218

219219
@Test
220-
void givenGroupWithOpenIDAndMembersWhenCallingIsAnonymousThenResultIsFalse() throws IOException {
220+
void givenGroupWithOpenIDAndMembersWhenCallingIsAnonymousThenResultIsFalse() {
221221

222222
// Given Group With OpenID And Members
223223
final Group group = Group.builder()
@@ -241,7 +241,7 @@ void givenGroupWithOpenIDAndMembersWhenCallingIsAnonymousThenResultIsFalse() thr
241241

242242

243243
@Test
244-
void givenGroupWithAccountAndMembersWhenCallingIsAnonymousThenResultIsFalse() throws IOException {
244+
void givenGroupWithAccountAndMembersWhenCallingIsAnonymousThenResultIsFalse() {
245245

246246
// Given Group With Account And Members
247247
final Group group = Group.builder()

xapi-model/src/test/java/dev/learning/xapi/model/ResultTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void whenSerializingResultThenResultIsEqualToExpectedJson() throws IOException {
130130
}
131131

132132
@Test
133-
void whenCallingToStringThenResultIsExpected() throws IOException {
133+
void whenCallingToStringThenResultIsExpected() {
134134

135135
final var resultInstance = Result.builder()
136136

xapi-model/src/test/java/dev/learning/xapi/model/StatementResultTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void whenSerializingStatementResultThenResultIsEqualToExpectedJson() throws IOEx
8888
}
8989

9090
@Test
91-
void whenCallingToStringThenResultIsExpected() throws IOException {
91+
void whenCallingToStringThenResultIsExpected() {
9292

9393
final var statementResult = StatementResult.builder()
9494

0 commit comments

Comments
 (0)