From d339edfe217a64cac7268dd6612022cb08cf5c61 Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 11 Nov 2024 09:14:18 -0800 Subject: [PATCH] Change to 3.0.0 --- pom.xml | 2 +- .../bentobox/AbstractCommonSetup.java | 36 ------------------- 2 files changed, 1 insertion(+), 37 deletions(-) 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);