Skip to content

Commit 17b8073

Browse files
tastybentoclaude
andcommitted
Use assertDoesNotThrow for no-assertion tests in AcidIslandTest
Replaces bare method calls with assertDoesNotThrow() to make the "should not throw" intent explicit and satisfy SonarCloud's "add at least one assertion" rule. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b4db0ab commit 17b8073

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/test/java/world/bentobox/acidisland/AcidIslandTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package world.bentobox.acidisland;
22

3+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
34
import static org.junit.jupiter.api.Assertions.assertEquals;
45
import static org.junit.jupiter.api.Assertions.assertFalse;
56
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -305,7 +306,7 @@ void testAllLoaded() {
305306
*/
306307
@Test
307308
void testSaveWorldSettings() {
308-
addon.saveWorldSettings();
309+
assertDoesNotThrow(() -> addon.saveWorldSettings());
309310
}
310311

311312
/**
@@ -314,18 +315,15 @@ void testSaveWorldSettings() {
314315
@Test
315316
void testOnDisable() {
316317
testOnEnable();
317-
addon.onDisable();
318-
// Should not throw - acidTask.cancelTasks() is called
318+
assertDoesNotThrow(() -> addon.onDisable());
319319
}
320320

321321
/**
322322
* Test onDisable when acidTask is null (no prior onEnable).
323323
*/
324324
@Test
325325
void testOnDisableNoTask() {
326-
// No onEnable called, acidTask is null
327-
addon.onDisable();
328-
// Should not throw
326+
assertDoesNotThrow(() -> addon.onDisable());
329327
}
330328

331329
/**

0 commit comments

Comments
 (0)