package cz.moneta.test.system.messaging.imq;

import java.util.List;

import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;
import cz.moneta.test.harness.endpoints.imq.ImqFirstVisionQueue;
import cz.moneta.test.harness.support.messaging.ReceivedMessage;

@TestScenario(name = "IBM MQ Browse Test")
public class ImqBrowseTest {

	@TestCase(name = "Browse messages in queue")
	public void browseMessagesInQueue(cz.moneta.test.dsl.Harness harness) {
		List<ReceivedMessage> peeked = harness.withImqFirstVision().fromQueue(ImqFirstVisionQueue.PAYMENT_NOTIFICATIONS)
				.browse(10);
		assert !peeked.isEmpty() : "Expected to find messages in the queue, but it was empty.";
	}
}
