diff --git a/frameworks/wantagent/test/unittest/want_agent_helper_test/want_agent_helper_test.cpp b/frameworks/wantagent/test/unittest/want_agent_helper_test/want_agent_helper_test.cpp index 156b5dd3a8d3101f31464684f5cd549406ba5422..32776ba988df14c949fc07fb36714a7d6e0ad7b5 100644 --- a/frameworks/wantagent/test/unittest/want_agent_helper_test/want_agent_helper_test.cpp +++ b/frameworks/wantagent/test/unittest/want_agent_helper_test/want_agent_helper_test.cpp @@ -506,9 +506,8 @@ HWTEST_F(WantAgentHelperTest, WantAgentHelper_2200, Function | MediumTest | Leve HWTEST_F(WantAgentHelperTest, WantAgentHelper_2300, Function | MediumTest | Level1) { std::shared_ptr wantAgentHelper = std::make_shared(); - sptr target(new (std::nothrow) WantSender()); - std::shared_ptr pendingWant = std::make_shared(target); - std::shared_ptr wantAgent = std::make_shared(pendingWant); + WantAgentInfo wantAgentInfo; + auto wantAgent = wantAgentHelper->GetWantAgent(nullptr, wantAgentInfo); auto type = wantAgentHelper->GetType(wantAgent); EXPECT_EQ(type, WantAgentConstant::OperationType::UNKNOWN_TYPE); }