@@ -1391,6 +1391,8 @@ TEST_F(database_queue_tests, push_datawriter)
1391
1391
std::make_pair (EntityId (0 ), EntityId (2 )))));
1392
1392
EXPECT_CALL (database, is_topic_in_database (_, EntityId (2 ))).Times (AnyNumber ())
1393
1393
.WillRepeatedly (Return (true ));
1394
+ EXPECT_CALL (database, is_type_in_database (type_name)).Times (AnyNumber ())
1395
+ .WillRepeatedly (Return (true ));
1394
1396
1395
1397
// Datawriter undiscovery: FAILURE
1396
1398
{
@@ -1625,6 +1627,9 @@ TEST_F(database_queue_tests, push_datawriter_topic_does_not_exist)
1625
1627
EXPECT_CALL (database, get_entities_by_name (EntityKind::TOPIC, topic_name)).Times (AnyNumber ())
1626
1628
.WillOnce (Return (std::vector<std::pair<EntityId, EntityId>>()));
1627
1629
1630
+ EXPECT_CALL (database, is_type_in_database (type_name)).Times (AnyNumber ())
1631
+ .WillRepeatedly (Return (false ));
1632
+
1628
1633
// Datawriter discovery: SUCCESS
1629
1634
{
1630
1635
// Precondition: The writer does not exist
@@ -1681,6 +1686,10 @@ TEST_F(database_queue_tests, push_datawriter_topic_does_not_exist)
1681
1686
EXPECT_CALL (database, insert_new_endpoint (_, _, _, _, _, _, _, _, _, _)).Times (1 )
1682
1687
.WillOnce (Invoke (&insert_datawriter_args, &InsertEndpointArgs::insert));
1683
1688
1689
+ // Expectation: Add the type to the database
1690
+ EXPECT_CALL (database, is_type_in_database (type_name)).Times (1 ).WillOnce (Return (false ));
1691
+ EXPECT_CALL (database, insert_new_type_idl (type_name, " " )).Times (1 );
1692
+
1684
1693
// Expectation: Modify graph and notify user
1685
1694
EXPECT_CALL (database, update_endpoint_in_graph (_, _, _, _)).Times (1 ).WillOnce (Return (true ));
1686
1695
EXPECT_CALL (*details::StatisticsBackendData::get_instance (), on_domain_view_graph_update (_)).Times (1 );
@@ -1746,6 +1755,8 @@ TEST_F(database_queue_tests, push_datareader)
1746
1755
std::make_pair (EntityId (0 ), EntityId (2 )))));
1747
1756
EXPECT_CALL (database, is_topic_in_database (_, EntityId (2 ))).Times (AnyNumber ())
1748
1757
.WillRepeatedly (Return (true ));
1758
+ EXPECT_CALL (database, is_type_in_database (type_name)).Times (AnyNumber ())
1759
+ .WillRepeatedly (Return (true ));
1749
1760
1750
1761
// Datareader undiscovery: FAILURE
1751
1762
{
@@ -1979,6 +1990,8 @@ TEST_F(database_queue_tests, push_datareader_topic_does_not_exist)
1979
1990
// Precondition: The topic does not exist
1980
1991
EXPECT_CALL (database, get_entities_by_name (EntityKind::TOPIC, topic_name)).Times (AnyNumber ())
1981
1992
.WillOnce (Return (std::vector<std::pair<EntityId, EntityId>>()));
1993
+ EXPECT_CALL (database, is_type_in_database (type_name)).Times (AnyNumber ())
1994
+ .WillOnce (Return (false ));
1982
1995
1983
1996
// Datareader discovery: SUCCESS
1984
1997
{
@@ -2036,6 +2049,10 @@ TEST_F(database_queue_tests, push_datareader_topic_does_not_exist)
2036
2049
EXPECT_CALL (database, insert_new_endpoint (_, _, _, _, _, _, _, _, _, _)).Times (1 )
2037
2050
.WillOnce (Invoke (&insert_datareader_args, &InsertEndpointArgs::insert));
2038
2051
2052
+ // Expectation: Add the type to the database
2053
+ EXPECT_CALL (database, is_type_in_database (type_name)).Times (1 ).WillOnce (Return (false ));
2054
+ EXPECT_CALL (database, insert_new_type_idl (type_name, " " )).Times (1 );
2055
+
2039
2056
// Expectation: Modify graph and notify user
2040
2057
EXPECT_CALL (database, update_endpoint_in_graph (_, _, _, _)).Times (1 ).WillOnce (Return (true ));
2041
2058
EXPECT_CALL (*details::StatisticsBackendData::get_instance (), on_domain_view_graph_update (_)).Times (1 );
0 commit comments