Skip to content

Commit

Permalink
Merge pull request #95 from soramitsu/query_with_reports
Browse files Browse the repository at this point in the history
Dockerfile was added
  • Loading branch information
adaagava authored Jun 28, 2024
2 parents f141645 + 1ad1c33 commit 620335c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/test/java/requests/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import jp.co.soramitsu.iroha2.generated.Name;

import java.security.KeyPair;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.UUID;

import static io.gatling.javaapi.core.CoreDsl.csv;
Expand All @@ -29,4 +32,5 @@ public class Constants {
public static final DomainId NEW_DOMAIN_ID = new DomainId(new Name("new_domain_name"));
public static final UUID CHAIN_ID = UUID.fromString("00000000-0000-0000-0000-000000000000");
public static FeederBuilder<String> CSV_FEEDER = csv("preconditionList.csv").circular();
public static FeederBuilder<String> PEERS_FEEDER = csv("peers.csv").circular();
}
13 changes: 8 additions & 5 deletions src/test/java/requests/Queries.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
import jp.co.soramitsu.iroha2.generated.SignedQuery;
import jp.co.soramitsu.iroha2.query.QueryBuilder;

import java.util.List;

import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.http;
import static io.gatling.javaapi.http.HttpDsl.status;

public class Queries extends Constants {

public static ChainBuilder queryPostFindAllDomains = exec(feed(CSV_FEEDER))
public static ChainBuilder queryPostFindAllDomains = exec(feed(CSV_FEEDER)).exec(feed(PEERS_FEEDER))
.exec(

http("findAllDomains query")
.post(Constants.URL_QUERY)
.post(session -> {return session.getString("peer");})
.body(ByteArrayBody(session -> {
return SignedQuery.Companion.encode(QueryBuilder
.findAllDomains()
Expand All @@ -28,7 +31,7 @@ public class Queries extends Constants {
public static ChainBuilder queryPostFindAccountsByDomainId = exec(feed(CSV_FEEDER))
.exec(
http("findAccountsByDomainId query")
.post(Constants.URL_QUERY)
.post(session -> {return session.getString("peer");})
.body(ByteArrayBody(session -> {
return SignedQuery.Companion.encode(QueryBuilder
.findAccountsByDomainId(ExtensionsKt.asDomainId(session.getString("domainIdSender")))
Expand All @@ -43,7 +46,7 @@ public class Queries extends Constants {
public static ChainBuilder queryPostFindAllAssets = exec(feed(CSV_FEEDER))
.exec(
http("findAllAssets query")
.post(Constants.URL_QUERY)
.post(session -> {return session.getString("peer");})
.body(ByteArrayBody(session -> {
return SignedQuery.Companion.encode(QueryBuilder
.findAllAssets()
Expand All @@ -57,7 +60,7 @@ public class Queries extends Constants {
public static ChainBuilder queryPostFindAllTransactions = exec(feed(CSV_FEEDER))
.exec(
http("findAllTransactions query")
.post(Constants.URL_QUERY)
.post(session -> {return session.getString("peer");})
.body(ByteArrayBody(session -> {
return SignedQuery.Companion.encode(QueryBuilder
.findAllTransactions(null)
Expand Down
6 changes: 6 additions & 0 deletions src/test/resources/peers.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
peer
/peer-0/query
/peer-1/query
/peer-2/query
/peer-3/query
/peer-4/query

0 comments on commit 620335c

Please sign in to comment.