diff --git a/CMakeLists.txt b/CMakeLists.txt
index 064babcb4e6d32dd0d5ead89d548575c76629716..681fb8661d4a5dfdb29a0f4a341a7c20d09649f5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,3 +49,14 @@ add_compile_options(-Wno-unused-parameter -Wno-unused-result -g)
 set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
 enable_testing()
 add_subdirectory(test)
+
+
+#######################################################
+### code formatting with clang-format
+#######################################################
+option(AUTOFORMATTING "call clang-format at configure time" ON)
+if(AUTOFORMATTING)
+    file(GLOB format_test_sources test/*.cpp test/*.h)
+    execute_process(COMMAND clang-format -i --verbose ${format_test_sources}
+        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+endif()
diff --git a/README.md b/README.md
index e7c36706ff028c94bc881889267cf3f0123a0409..551117a3b4eb123829e43fb3cefc15d04d8fc19c 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,14 @@
 
 Integration tests for caosdb-cpplib and the caosdb-server
 
+# Dependencies
+
+* clang-tidy
+* clang-format
+* include-what-you-use
+* cmake
+* conan
+
 # Run tests
 
 1. `mkdir build && cd build/`
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2e3479793ae3280025dd2b3c059aae29d0e74173..82c8411e772a7ad095710487582630768efdadb9 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -23,6 +23,7 @@
 #######################################################################
 set(test_cases
     test_connection
+    test_transaction
     )
 
 #######################################################
diff --git a/test/caosdb_test_utility.h b/test/caosdb_test_utility.h
index da0ddb34764b168e5d9b630b6b0fdb15bf746ef1..4c97c203a8ab55c9d239d824cd274fe3b99aa60b 100644
--- a/test/caosdb_test_utility.h
+++ b/test/caosdb_test_utility.h
@@ -31,18 +31,18 @@
  * @author Timm Fitschen
  * @date 2021-07-07
  */
-#define EXPECT_THROW_MESSAGE(statement, exeption_type, message) EXPECT_THROW( \
-    try { \
-        statement; \
-    } catch (const exeption_type& e) { \
-        EXPECT_EQ(std::string(e.what()), message); \
-        throw; \
-    }, exeption_type)
-#define ASSERT_THROW_MESSAGE(statement, exeption_type, message) ASSERT_THROW( \
-    try { \
-        statement; \
-    } catch (const exeption_type& e) { \
-        ASSERT_EQ(std::string(e.what()), message); \
-        throw; \
-    }, exeption_type)
+#define EXPECT_THROW_MESSAGE(statement, exeption_type, message)                \
+  EXPECT_THROW(                                                                \
+    try { statement; } catch (const exeption_type &e) {                        \
+      EXPECT_EQ(std::string(e.what()), message);                               \
+      throw;                                                                   \
+    },                                                                         \
+    exeption_type)
+#define ASSERT_THROW_MESSAGE(statement, exeption_type, message)                \
+  ASSERT_THROW(                                                                \
+    try { statement; } catch (const exeption_type &e) {                        \
+      ASSERT_EQ(std::string(e.what()), message);                               \
+      throw;                                                                   \
+    },                                                                         \
+    exeption_type)
 #endif
diff --git a/test/test_connection.cpp b/test/test_connection.cpp
index 5609ac4e311422ae52cb83c1f341690a258de595..7540a9042337b3da996dd61a9603741ab18b9320 100644
--- a/test/test_connection.cpp
+++ b/test/test_connection.cpp
@@ -19,21 +19,22 @@
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
  *
  */
-#include <gtest/gtest-message.h>    // for Message
-#include <gtest/gtest-test-part.h>  // for SuiteApiResolver, TestPartResult
-#include <memory>                   // for make_shared, allocator, shared_ptr
-#include <string>                   // for string
-#include "caosdb/authentication.h"  // for PlainPasswordAuthenticator
-#include "caosdb/connection.h"      // for InsecureCaosDBConnectionConfig
-#include "caosdb/exceptions.h"      // for AuthenticationError, ConnectionError
-#include "caosdb/info.h"            // for VersionInfo
-#include "caosdb/utils.h"           // for get_env_var
-#include "gtest/gtest_pred_impl.h"  // for Test, TEST, EXPECT_EQ, EXPECT_THROW
+#include <gtest/gtest-message.h>   // for Message
+#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestPartResult
+#include <memory>                  // for make_shared, allocator, shared_ptr
+#include <string>                  // for string
+#include "caosdb/authentication.h" // for PlainPasswordAuthenticator
+#include "caosdb/connection.h"     // for InsecureCaosDBConnectionConfig
+#include "caosdb/exceptions.h"     // for AuthenticationError, ConnectionError
+#include "caosdb/info.h"           // for VersionInfo
+#include "caosdb/utils.h"          // for get_env_var
+#include "gtest/gtest_pred_impl.h" // for Test, TEST, EXPECT_EQ, EXPECT_THROW
+#include "caosdb_test_utility.h"
 
 namespace caosdb::connection {
+using caosdb::authentication::PlainPasswordAuthenticator;
 using caosdb::exceptions::AuthenticationError;
 using caosdb::exceptions::ConnectionError;
-using caosdb::authentication::PlainPasswordAuthenticator;
 
 TEST(test_connection, config_somehost_25323) {
   auto port = 25323;
@@ -53,26 +54,12 @@ TEST(test_connection, connect_somehost_42347_fails) {
   EXPECT_THROW(connection.GetVersionInfo(), ConnectionError);
 }
 
-TEST(test_connection, connection_insecure_authentication_error_wrong_credentials) {
-  auto port_str = caosdb::utils::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTP", "8080");
-  auto port = std::stoi(port_str);
-  const auto host = caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost");
-
-  const auto *const user = "not-a-user-23461237";
-  const auto *const password = "very-c-cred";
-
-  auto auth = std::make_shared<PlainPasswordAuthenticator>(user, password);
-  auto config = std::make_shared<InsecureCaosDBConnectionConfig>(host, port, auth);
-  auto connection = CaosDBConnection(config);
-
-  EXPECT_THROW(connection.GetVersionInfo(), AuthenticationError);
-}
-
-
 TEST(test_connection, connection_insecure_authentication_error_anonymous) {
-  auto port_str = caosdb::utils::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTP", "8080");
+  auto port_str =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTP", "8080");
   auto port = std::stoi(port_str);
-  const auto host = caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost");
+  const auto host =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost");
 
   auto config = std::make_shared<InsecureCaosDBConnectionConfig>(host, port);
   auto connection = CaosDBConnection(config);
@@ -81,39 +68,52 @@ TEST(test_connection, connection_insecure_authentication_error_anonymous) {
 }
 
 TEST(test_connection, connection_ssl_authentication_error_anonymous) {
-  auto port_str = caosdb::utils::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTPS", "8443");
+  auto port_str =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTPS", "8443");
   auto port = std::stoi(port_str);
-  const auto host = caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost");
-  const auto path = caosdb::utils::get_env_var("CAOSDB_SERVER_CA_PEM", std::string());
+  const auto host =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost");
+  const auto path =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_CA_PEM", std::string());
 
   auto ssloptions = std::make_shared<PemFileCACertProvider>(path);
-  auto config = std::make_shared<SslCaosDBConnectionConfig>(host, port, ssloptions);
+  auto config =
+    std::make_shared<SslCaosDBConnectionConfig>(host, port, ssloptions);
   auto connection = CaosDBConnection(config);
 
-  EXPECT_THROW(connection.GetVersionInfo(), AuthenticationError);
+  EXPECT_THROW_MESSAGE(connection.GetVersionInfo(), AuthenticationError,
+                       "Please Login.");
 }
 
 TEST(test_connection, connection_ssl_authentication_error_wrong_credentials) {
-  auto port_str = caosdb::utils::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTPS", "8443");
+  auto port_str =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTPS", "8443");
   auto port = std::stoi(port_str);
-  const auto host = caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost");
-  const auto path = caosdb::utils::get_env_var("CAOSDB_SERVER_CA_PEM", std::string());
+  const auto host =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost");
+  const auto path =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_CA_PEM", std::string());
   const auto *const user = "not-a-user-23461237";
   const auto *const password = "very-c-cred";
 
   auto auth = std::make_shared<PlainPasswordAuthenticator>(user, password);
   auto ssloptions = std::make_shared<PemFileCACertProvider>(path);
-  auto config = std::make_shared<SslCaosDBConnectionConfig>(host, port, ssloptions, auth);
+  auto config =
+    std::make_shared<SslCaosDBConnectionConfig>(host, port, ssloptions, auth);
   auto connection = CaosDBConnection(config);
 
-  EXPECT_THROW(connection.GetVersionInfo(), AuthenticationError);
+  EXPECT_THROW_MESSAGE(connection.GetVersionInfo(), AuthenticationError,
+                       "Authentication failed. Username or password wrong.");
 }
 
 TEST(test_connection, connection_ssl_authentication_success) {
-  auto port_str = caosdb::utils::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTPS", "8443");
+  auto port_str =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTPS", "8443");
   auto port = std::stoi(port_str);
-  const auto host = caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost");
-  const auto path = caosdb::utils::get_env_var("CAOSDB_SERVER_CA_PEM", std::string());
+  const auto host =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost");
+  const auto path =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_CA_PEM", std::string());
   const auto user = caosdb::utils::get_env_var("CAOSDB_USER", "admin");
   const auto password = caosdb::utils::get_env_var("CAOSDB_PASSWORD", "caosdb");
 
@@ -123,7 +123,8 @@ TEST(test_connection, connection_ssl_authentication_success) {
 
   auto auth = std::make_shared<PlainPasswordAuthenticator>(user, password);
   auto ssloptions = std::make_shared<PemFileCACertProvider>(path);
-  auto config = std::make_shared<SslCaosDBConnectionConfig>(host, port, ssloptions, auth);
+  auto config =
+    std::make_shared<SslCaosDBConnectionConfig>(host, port, ssloptions, auth);
   auto connection = CaosDBConnection(config);
 
   auto v_info = connection.GetVersionInfo();
@@ -132,4 +133,4 @@ TEST(test_connection, connection_ssl_authentication_success) {
   EXPECT_EQ(pre_release, v_info->GetPreRelease());
 }
 
-} //namespace caosdb::connection
+} // namespace caosdb::connection
diff --git a/test/test_transaction.cpp b/test/test_transaction.cpp
index 99f50467063814390ee611baa0b1ba7a38adb6dc..e02dd7f156146656dc8c990aa893dc93fca3331a 100644
--- a/test/test_transaction.cpp
+++ b/test/test_transaction.cpp
@@ -18,30 +18,36 @@
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
  *
  */
-#include "caosdb/transaction.h"
-#include <gtest/gtest-message.h>    // for Message
-#include <gtest/gtest-test-part.h>  // for SuiteApiResolver, TestPartResult
-#include <memory>                   // for make_shared, allocator, shared_ptr
-#include <string>                   // for string
-#include "caosdb/authentication.h"  // for PlainPasswordAuthenticator
-#include "caosdb/connection.h"      // for InsecureCaosDBConnectionConfig
-#include "caosdb/exceptions.h"      // for AuthenticationError, ConnectionError
-#include "caosdb/utils.h"           // for get_env_var
-#include "gtest/gtest_pred_impl.h"  // for Test, TEST, EXPECT_EQ, EXPECT_THROW
+#include <gtest/gtest-message.h>   // for Message
+#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl
+#include <memory>                  // for allocator, make_shared, static_po...
+#include <string>                  // for stoi
+#include "caosdb/authentication.h" // for PlainPasswordAuthenticator
+#include "caosdb/connection.h"     // for InsecureCaosDBConnectionConfig
+#include "caosdb/entity.h"         // for Entity, EntityID
+#include "caosdb/transaction.h"    // for Transaction, UniqueResult, Entity
+#include "caosdb/utils.h"          // for get_env_var
+#include "gtest/gtest_pred_impl.h" // for Test, TestInfo, EXPECT_EQ, TEST
 
 namespace caosdb::transaction {
+using caosdb::authentication::PlainPasswordAuthenticator;
+using caosdb::connection::CaosDBConnection;
+using caosdb::connection::InsecureCaosDBConnectionConfig;
 
 TEST(test_transaction, first_test) {
-  auto port_str = caosdb::utils::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTP", "8080");
+  auto port_str =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTP", "8080");
   auto port = std::stoi(port_str);
-  const auto host = caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost");
+  const auto host =
+    caosdb::utils::get_env_var("CAOSDB_SERVER_HOST", "localhost");
   const auto user = caosdb::utils::get_env_var("CAOSDB_USER", "admin");
   const auto password = caosdb::utils::get_env_var("CAOSDB_PASSWORD", "caosdb");
 
   const auto *const description = "This is an entity";
 
   auto auth = std::make_shared<PlainPasswordAuthenticator>(user, password);
-  auto config = std::make_shared<SslCaosDBConnectionConfig>(host, port, auth);
+  auto config =
+    std::make_shared<InsecureCaosDBConnectionConfig>(host, port, auth);
   auto connection = CaosDBConnection(config);
 
   auto transaction(connection.CreateTransaction());
@@ -53,4 +59,4 @@ TEST(test_transaction, first_test) {
   EXPECT_EQ(description, result_set->GetEntity().GetDescription());
 }
 
-} //namespace caosdb::connection
+} // namespace caosdb::transaction