From df6d0d371c54aa6e7f27264bcca5900929689547 Mon Sep 17 00:00:00 2001
From: xkollar3 <xkollar3@fi.muni.cz>
Date: Wed, 8 May 2024 14:36:00 +0200
Subject: [PATCH] added locust file, removed show-sql

---
 locustfile.py                                 | 20 +++++++++++++++++++
 .../src/main/resources/application.yml        |  1 -
 2 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 locustfile.py

diff --git a/locustfile.py b/locustfile.py
new file mode 100644
index 0000000..ff454ec
--- /dev/null
+++ b/locustfile.py
@@ -0,0 +1,20 @@
+from locust import HttpUser, task, between
+import json
+
+class ObsUser(HttpUser):
+
+    host = "http://localhost:8082"
+
+    @task
+    def test_task(self):
+        datajson = {
+            "withdrawsFromAccountNumber": "bank-1",
+            "depositsToAccountNumber": "account-1",
+            "withdrawAmount": 1000
+        }
+
+        request = json.dumps(datajson)
+
+        response = self.client.post("/api/transaction-service/v1/transactions/transaction/create", data=request, headers={'Content-Type': 'application/json', 'Accept': 'application/json'})
+
+        print(response.json())
\ No newline at end of file
diff --git a/transaction-service/src/main/resources/application.yml b/transaction-service/src/main/resources/application.yml
index a606be9..72d9d90 100644
--- a/transaction-service/src/main/resources/application.yml
+++ b/transaction-service/src/main/resources/application.yml
@@ -31,7 +31,6 @@ spring:
     database-platform: org.hibernate.dialect.PostgreSQLDialect
     hibernate:
       ddl-auto: validate
-    show-sql: true
   flyway:
     locations: db.migration
     baseline-on-migrate: true
-- 
GitLab