diff --git a/pom.xml b/pom.xml index 4fc48b5b9..c48e504c4 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ -LOCAL - 2.7.1 + 3.0.0 bentobox-world https://sonarcloud.io ${project.basedir}/lib diff --git a/src/test/java/world/bentobox/bentobox/AbstractCommonSetup.java b/src/test/java/world/bentobox/bentobox/AbstractCommonSetup.java index 73596f4d4..59d49a543 100644 --- a/src/test/java/world/bentobox/bentobox/AbstractCommonSetup.java +++ b/src/test/java/world/bentobox/bentobox/AbstractCommonSetup.java @@ -241,42 +241,6 @@ public abstract class AbstractCommonSetup { checkSpigotMessage(expectedMessage, 1); } - /* - public void checkSpigotMessage(String expectedMessage, boolean shouldBePresent) { - // Capture the argument passed to spigot().sendMessage(...) if messages are sent - ArgumentCaptor captor = ArgumentCaptor.forClass(TextComponent.class); - - if (shouldBePresent) { - // If we expect a message to be present, verify that sendMessage() was called at least once - verify(spigot, atLeastOnce()).sendMessage(captor.capture()); - - // Get all captured TextComponents - List capturedMessages = captor.getAllValues(); - - // Check if any captured message contains the expected text - boolean messageFound = capturedMessages.stream() - .map(component -> component.toPlainText()) // Convert each TextComponent to plain text - .anyMatch(messageText -> messageText.contains(expectedMessage)); // Check if the expected message is present - - // Assert that the message was found - assertTrue("Expected message not found: " + expectedMessage, messageFound); - - } else { - // If we expect no messages with this text, capture any sent messages to ensure none match the given message - verify(spigot, atLeast(0)).sendMessage(captor.capture()); - - // Get all captured TextComponents - List capturedMessages = captor.getAllValues(); - - // Check that none of the captured messages contain the forbidden text - boolean messageFound = capturedMessages.stream().map(component -> component.toPlainText()) // Convert each TextComponent to plain text - .anyMatch(messageText -> messageText.contains(expectedMessage)); // Check if the message is present - - // Assert that the message was NOT found - assertFalse("Unexpected message found: " + expectedMessage, messageFound); - } - }*/ - public void checkSpigotMessage(String expectedMessage, int expectedOccurrences) { // Capture the argument passed to spigot().sendMessage(...) if messages are sent ArgumentCaptor captor = ArgumentCaptor.forClass(TextComponent.class);