// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include #include #include #include #include #include #include #include using namespace mbus; class MyMessage : public SimpleMessage { public: MyMessage() : SimpleMessage("foo") { } bool hasBucketSequence() const override { return true; } }; TEST("bucketsequence_test") { Slobrok slobrok; TestServer server(MessageBusParams() .addProtocol(std::make_shared()) .setRetryPolicy(std::make_shared()), RPCNetworkParams(slobrok.config())); Receptor receptor; SourceSession::UP session = server.mb.createSourceSession( SourceSessionParams() .setReplyHandler(receptor)); auto msg = std::make_unique(); msg->setRoute(Route::parse("foo")); ASSERT_TRUE(session->send(std::move(msg)).isAccepted()); Reply::UP reply = receptor.getReply(); ASSERT_TRUE(reply); EXPECT_EQUAL(1u, reply->getNumErrors()); EXPECT_EQUAL((uint32_t)ErrorCode::SEQUENCE_ERROR, reply->getError(0).getCode()); } TEST_MAIN() { TEST_RUN_ALL(); }