• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <gtest/gtest.h>
17 
18 #define private public
19 #include "sa_interceptor_proxy.h"
20 #undef private
21 #include "ipc_types.h"
22 #include "message_parcel.h"
23 #include "mock_sa_interceptor_stub.h"
24 #include "rule.h"
25 
26 using namespace testing::ext;
27 using namespace testing;
28 
29 namespace OHOS {
30 namespace AbilityRuntime {
31 class SAInterceptorProxyTest : public testing::Test {
32 public:
33     static void SetUpTestCase(void);
34     static void TearDownTestCase(void);
35     void SetUp();
36     void TearDown();
37 };
38 
SetUpTestCase(void)39 void SAInterceptorProxyTest::SetUpTestCase(void)
40 {}
TearDownTestCase(void)41 void SAInterceptorProxyTest::TearDownTestCase(void)
42 {}
TearDown(void)43 void SAInterceptorProxyTest::TearDown(void)
44 {}
SetUp()45 void SAInterceptorProxyTest::SetUp()
46 {}
47 
48 /*
49  * @tc.number: OnCheckStarting_001
50  * @tc.name: OnCheckStarting
51  * @tc.desc: Verify OnCheckStarting functionality
52  */
53 HWTEST_F(SAInterceptorProxyTest, OnCheckStarting_001, TestSize.Level1)
54 {
55     sptr<SAInterceptorStub> sAInterceptorStub(new MockSAInterceptorStub(0));
56     sptr<SAInterceptorProxy> proxy(new SAInterceptorProxy(sAInterceptorStub));
57     Rule rule;
58     std::string params = "";
59     auto result = proxy->OnCheckStarting(params, rule);
60     EXPECT_EQ(result, NO_ERROR);
61 }
62 }  // namespace AbilityRuntime
63 }  // namespace OHOS
64