diff --git a/src/caosdb/transaction.cpp b/src/caosdb/transaction.cpp index 3dd8056c6b20ec1efe72a4c03c38651695bae980..ae9ddd2b45c36b272ffcb62c6239a1ccb891bb5c 100644 --- a/src/caosdb/transaction.cpp +++ b/src/caosdb/transaction.cpp @@ -165,8 +165,9 @@ auto Transaction::UpdateEntity(Entity *entity) noexcept -> StatusCode { auto Transaction::Execute() -> TransactionStatus { ExecuteAsynchronously(); - this->status.ThrowExceptionIfError(); - return this->status; + auto status = WaitForIt(); + status.ThrowExceptionIfError(); + return status; } auto Transaction::ExecuteAsynchronously() noexcept -> StatusCode { diff --git a/test/test_entity.cpp b/test/test_entity.cpp index 8d2ce296820bcac501922363c4347a6bfd867477..56d3c2ab38d7bf300e329d1214d102510729e992 100644 --- a/test/test_entity.cpp +++ b/test/test_entity.cpp @@ -106,7 +106,7 @@ TEST(test_entity, test_append_property) { // NOLINT TEST(test_entity, test_copy_to) { auto entity = Entity(); - entity.SetId("original_id"); + entity.SetRole("original_role"); entity.SetName("orignial_name"); auto parent = Parent(); @@ -126,7 +126,7 @@ TEST(test_entity, test_copy_to) { entity.CopyTo(proto_copy); auto copied = Entity(proto_copy); - EXPECT_EQ(entity.GetId(), copied.GetId()); + EXPECT_EQ(entity.GetRole(), copied.GetRole()); EXPECT_EQ(entity.GetName(), copied.GetName()); EXPECT_EQ(copied.GetParents().At(0).GetId(), parent.GetId()); EXPECT_EQ(copied.GetParents().At(0).GetName(), parent.GetName()); @@ -177,7 +177,7 @@ TEST(test_entity, test_insert_with_parent) { std::shared_ptr<transaction::EntityTransactionService::Stub>(nullptr)); auto entity = Entity(); - entity.SetId("entity_id"); + entity.SetName("entity_name"); auto parent = Parent(); parent.SetId("parent_id"); @@ -190,7 +190,7 @@ TEST(test_entity, test_insert_with_parent) { transaction.InsertEntity(&entity); std::cout << entity.ToString() << std::endl; - EXPECT_EQ(entity.GetId(), "entity_id"); + EXPECT_EQ(entity.GetName(), "entity_name"); EXPECT_EQ(entity.GetParents().Size(), 1); auto inserted_parent = entity.GetParents().At(0); EXPECT_EQ(inserted_parent.GetId(), parent.GetId()); @@ -203,7 +203,7 @@ TEST(test_entity, test_insert_with_property) { // NOLINT std::shared_ptr<transaction::EntityTransactionService::Stub>(nullptr)); auto entity = Entity(); - entity.SetId("entity_id"); + entity.SetName("entity_name"); auto prop = Property(); prop.SetName("prop_name");