// Path: src/main/java/org/sharedmq/Message.java
// public interface Message {
//     /**
//      * @return The message body as a string.
//      */
//     String asString();
// }
// 
// Path: src/test/java/org/sharedmq/test/CommonTests.java
// public interface CommonTests {
// }
// 
// Path: src/test/java/org/sharedmq/test/TestUtils.java
// public static <T extends Exception> void assertThrows(
//         Class<T> errorClass,
//         String expectedMessagePart,
//         TestedAction action
// ) {
//     try {
//         action.invoke();
//         fail("an exception was expected");
//     } catch (AssertionError e) {
//         throw e;
//     } catch (Throwable e) {
//         if (!errorClass.isInstance(e)) {
//             throw new AssertionError("Expected '" + errorClass.getName() + "'" +
//                     ", but encountered '" + e.getClass().getName() + "'."
//                     , e);
//         }
//         if (expectedMessagePart != null) {
//             String message = e.getMessage();
//             if (message == null || !message.contains(expectedMessagePart)) {
//                 throw new AssertionError("Expected an exception" +
//                         " with the message '..." + expectedMessagePart + "...'" +
//                         ", but encountered '" + e.getMessage() + "'."
//                         , e);
//             }
//         }
//     }
// }


import com.google.common.base.Strings;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mockito.Mockito;
import org.sharedmq.Message;
import org.sharedmq.test.CommonTests;
import java.io.File;
import static org.sharedmq.test.TestUtils.assertThrows;
                () -> QueueParametersValidator.validatePush(1, Strings.repeat("\u044F", 256 * 1024)));
    }

    @Test
    public void testValidatePull() {

        QueueParametersValidator.validatePull(0);
        QueueParametersValidator.validatePull(20000);

        // timeout validation
        assertThrows(IllegalArgumentException.class,
                "timeout in milliseconds must be between 0 and 20000",
                () -> QueueParametersValidator.validatePull(-1));
        assertThrows(IllegalArgumentException.class,
                "timeout in milliseconds must be between 0 and 20000",
                () -> QueueParametersValidator.validatePull(20001));
    }

    @Test
    public void testValidateDelete() {

        QueueParametersValidator.validateDelete(Mockito.mock(SharedQueueMessage.class));

        // message validation
        assertThrows(IllegalArgumentException.class,
                "message parameter cannot be null",
                () -> QueueParametersValidator.validateDelete(null));

        assertThrows(IllegalArgumentException.class,
                "message type does not belong to this message queue",
// Path: src/main/java/org/sharedmq/Message.java
// public interface Message {
//     /**
//      * @return The message body as a string.
//      */
//     String asString();
// }
// 
// Path: src/test/java/org/sharedmq/test/CommonTests.java
// public interface CommonTests {
// }
// 
// Path: src/test/java/org/sharedmq/test/TestUtils.java
// public static <T extends Exception> void assertThrows(
//         Class<T> errorClass,
//         String expectedMessagePart,
//         TestedAction action
// ) {
//     try {
//         action.invoke();
//         fail("an exception was expected");
//     } catch (AssertionError e) {
//         throw e;
//     } catch (Throwable e) {
//         if (!errorClass.isInstance(e)) {
//             throw new AssertionError("Expected '" + errorClass.getName() + "'" +
//                     ", but encountered '" + e.getClass().getName() + "'."
//                     , e);
//         }
//         if (expectedMessagePart != null) {
//             String message = e.getMessage();
//             if (message == null || !message.contains(expectedMessagePart)) {
//                 throw new AssertionError("Expected an exception" +
//                         " with the message '..." + expectedMessagePart + "...'" +
//                         ", but encountered '" + e.getMessage() + "'."
//                         , e);
//             }
//         }
//     }
// }


// Path: src/test/java/org/sharedmq/internals/QueueParametersValidatorTest.java
import com.google.common.base.Strings;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mockito.Mockito;
import org.sharedmq.Message;
import org.sharedmq.test.CommonTests;
import java.io.File;
import static org.sharedmq.test.TestUtils.assertThrows;

                () -> QueueParametersValidator.validatePush(1, Strings.repeat("\u044F", 256 * 1024)));
    }

    @Test
    public void testValidatePull() {

        QueueParametersValidator.validatePull(0);
        QueueParametersValidator.validatePull(20000);

        // timeout validation
        assertThrows(IllegalArgumentException.class,
                "timeout in milliseconds must be between 0 and 20000",
                () -> QueueParametersValidator.validatePull(-1));
        assertThrows(IllegalArgumentException.class,
                "timeout in milliseconds must be between 0 and 20000",
                () -> QueueParametersValidator.validatePull(20001));
    }

    @Test
    public void testValidateDelete() {

        QueueParametersValidator.validateDelete(Mockito.mock(SharedQueueMessage.class));

        // message validation
        assertThrows(IllegalArgumentException.class,
                "message parameter cannot be null",
                () -> QueueParametersValidator.validateDelete(null));

        assertThrows(IllegalArgumentException.class,
                "message type does not belong to this message queue",
                () -> QueueParametersValidator.validateDelete(Mockito.mock(Message.class)));