Skip to content

Commit

Permalink
Java: consolidate transaction tests into a single tests run (valkey-i…
Browse files Browse the repository at this point in the history
…o#983)

* Java: consolidate transaction tests into a single tests run (#91)

Signed-off-by: Andrew Carbonetto <[email protected]>

* Fix init call for TransactionTests.java

Signed-off-by: Andrew Carbonetto <[email protected]>

---------

Signed-off-by: Andrew Carbonetto <[email protected]>
  • Loading branch information
acarbonetto authored Feb 21, 2024
1 parent 38544ea commit 9b11e19
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 143 deletions.

This file was deleted.

14 changes: 10 additions & 4 deletions java/client/src/test/java/glide/api/models/TransactionTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import org.apache.commons.lang3.tuple.Pair;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import redis_request.RedisRequestOuterClass.Command;
import redis_request.RedisRequestOuterClass.Command.ArgsArray;
import redis_request.RedisRequestOuterClass.RequestType;

public class TransactionTests {
@Test
public void transaction_builds_protobuf_request() {
Transaction transaction = new Transaction();
private static Stream<Arguments> getTransactionBuilders() {
return Stream.of(Arguments.of(new Transaction()), Arguments.of(new ClusterTransaction()));
}

@ParameterizedTest
@MethodSource("getTransactionBuilders")
public void transaction_builds_protobuf_request(BaseTransaction<?> transaction) {
List<Pair<RequestType, ArgsArray>> results = new LinkedList<>();

transaction.get("key");
Expand Down

0 comments on commit 9b11e19

Please sign in to comment.