X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=include%2Fprivate%2Ftst%2Fsyncstorageimplmock.hpp;fp=include%2Fprivate%2Ftst%2Fsyncstorageimplmock.hpp;h=6d1b6771607d61b296997a36679374b5a017db36;hb=faf9fc79e58fa4ace9b0ef317b741afb2c1a8abe;hp=0000000000000000000000000000000000000000;hpb=6e77ef4f748bdfa40505fc11c0a190e7a40fdb46;p=ric-plt%2Fsdl.git diff --git a/include/private/tst/syncstorageimplmock.hpp b/include/private/tst/syncstorageimplmock.hpp new file mode 100644 index 0000000..6d1b677 --- /dev/null +++ b/include/private/tst/syncstorageimplmock.hpp @@ -0,0 +1,69 @@ +/* + Copyright (c) 2018-2021 Nokia. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This source code is part of the near-RT RIC (RAN Intelligent Controller) + * platform project (RICP). +*/ + +#ifndef SHAREDDATALAYER_TST_SYNCSTORAGEIMPLMOCK_HPP_ +#define SHAREDDATALAYER_TST_SYNCSTORAGEIMPLMOCK_HPP_ + +#include "config.h" +#include "private/syncstorageimpl.hpp" +#include + +namespace shareddatalayer +{ + namespace tst + { + class SyncStorageImplMock: public SyncStorageImpl + { + public: + SyncStorageImplMock(std::unique_ptr asyncStorageImpl): + SyncStorageImpl(std::move(asyncStorageImpl)) {} + + MOCK_METHOD2(set, + void(const Namespace& ns, const DataMap& dataMap)); + + MOCK_METHOD4(setIf, + bool(const Namespace& ns, const Key& key, const Data& oldData, const Data& newData)); + + MOCK_METHOD4(setIf, + bool(const Namespace& ns, const DataMap& dataToBeChecked, const Keys& keysWhichShouldNotExist, const DataMap& dataToBeWritten)); + + MOCK_METHOD3(setIfNotExists, + bool(const Namespace& ns, const Key& key, const Data& data)); + + MOCK_METHOD2(get, + DataMap(const Namespace& ns, const Keys& keys)); + + MOCK_METHOD2(remove, + void(const Namespace& ns, const Keys& keys)); + + MOCK_METHOD3(removeIf, + bool(const Namespace& ns, const Key& key, const Data& data)); + + MOCK_METHOD2(findKeys, + Keys(const Namespace& ns, const std::string& keyPrefix)); + + MOCK_METHOD1(removeAll, + void(const Namespace& ns)); + }; + } +} + +#endif