Skip to content

Commit

Permalink
port java samples to junit5
Browse files Browse the repository at this point in the history
  • Loading branch information
octonato committed Nov 21, 2023
1 parent 6bf1409 commit 6df437b
Show file tree
Hide file tree
Showing 64 changed files with 187 additions and 187 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import customer.action.CustomerStateSubscriptionAction;
import customer.action.CustomerStateSubscriptionActionTestKit;
import customer.domain.CustomerDomain;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

// This class was initially generated based on the .proto definition by Kalix tooling.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import scala.jdk.javaapi.CollectionConverters;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

public class CustomerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import customer.Main;
import customer.api.CustomerApi;
import customer.api.CustomerService;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.Test;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

// This class was initially generated based on the .proto definition by Kalix tooling.
//
Expand All @@ -23,7 +23,7 @@ public class CustomerIntegrationTest {
/**
* The test kit starts both the service container and the Kalix proxy.
*/
@ClassRule
@RegisterExtension
public static final KalixTestKitResource testKit =
new KalixTestKitResource(Main.createKalix());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import scala.jdk.javaapi.CollectionConverters;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

public class CustomerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import customer.Main;
import customer.api.CustomerApi;
import customer.api.CustomerService;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.Test;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

// This class was initially generated based on the .proto definition by Kalix tooling.
//
Expand All @@ -23,7 +23,7 @@ public class CustomerIntegrationTest {
/**
* The test kit starts both the service container and the Kalix proxy.
*/
@ClassRule
@RegisterExtension
public static final KalixTestKitResource testKit =
new KalixTestKitResource(Main.createKalix());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import customer.Main;
import customer.api.CustomerApi;
import customer.api.CustomerService;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.Test;

import java.util.UUID;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.awaitility.Awaitility.await;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

// Example of an integration test calling our service via the Kalix proxy
// Run all test classes ending with "IntegrationTest" using `mvn verify -Pit`
Expand All @@ -24,7 +24,7 @@ public class CustomerByEmailIntegrationTest {
/**
* The test kit starts both the service container and the Kalix proxy.
*/
@ClassRule
@RegisterExtension
public static final KalixTestKitResource testKit =
new KalixTestKitResource(Main.createKalix());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import customer.Main;
import customer.api.CustomerApi;
import customer.api.CustomerService;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.Test;

import java.util.Arrays;
import java.util.HashSet;
Expand All @@ -19,7 +19,7 @@

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.awaitility.Awaitility.await;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

// Example of an integration test calling our service via the Kalix proxy
// Run all test classes ending with "IntegrationTest" using `mvn verify -Pit`
Expand All @@ -28,7 +28,7 @@ public class CustomerByNameIntegrationTest {
/**
* The test kit starts both the service container and the Kalix proxy.
*/
@ClassRule
@RegisterExtension
public static final KalixTestKitResource testKit =
new KalixTestKitResource(Main.createKalix());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import scala.jdk.javaapi.CollectionConverters;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

public class CustomerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import kalix.javasdk.Metadata;
import kalix.javasdk.testkit.junit.KalixTestKitResource;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.Test;

import java.util.Base64;
import java.util.Map;
import java.util.concurrent.CompletionStage;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

// Example of an integration test calling our service via the Kalix proxy
// Run all test classes ending with "IntegrationTest" using `mvn verify -Pit`
Expand All @@ -26,7 +26,7 @@ public class JwtIntegrationTest {
/**
* The test kit starts both the service container and the Kalix proxy.
*/
@ClassRule
@RegisterExtension
public static final KalixTestKitResource testKit =
new KalixTestKitResource(Main.createKalix());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.example.json.MyServiceApi;
import com.google.protobuf.Any;
import com.google.protobuf.Empty;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

public class MyServiceActionTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import com.example.CounterApi;
import com.example.CounterService;
import com.example.Main;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.Test;

import java.util.concurrent.CompletionStage;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

// Example of an integration test calling our service via the Kalix proxy
// Run all test classes ending with "IntegrationTest" using `mvn verify -Pit`
Expand All @@ -25,7 +25,7 @@ public class CounterIntegrationTest {
/**
* The test kit starts both the service container and the Kalix proxy.
*/
@ClassRule
@RegisterExtension
public static final KalixTestKitResource testKit =
new KalixTestKitResource(Main.createKalix());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
// ...
// end::test-topic[]
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.Test;

import java.net.URI;
import java.time.Duration;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

// Example of an integration test calling our service via the Kalix proxy
// Run all test classes ending with "IntegrationTest" using `mvn verify -Pit`
Expand All @@ -30,7 +30,7 @@ public class CounterTopicIntegrationTest {
/**
* The test kit starts both the service container and the Kalix proxy.
*/
@ClassRule
@RegisterExtension
public static final KalixTestKitResource testKit =
new KalixTestKitResource(Main.createKalix(), KalixTestKit.Settings.DEFAULT
// end::test-topic[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.google.protobuf.Empty;
import kalix.javasdk.testkit.ActionResult;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

// This class was initially generated based on the .proto definition by Kalix tooling.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import com.example.domain.CounterDomain;
import com.google.protobuf.Any;
import com.google.protobuf.Empty;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;


public class CounterJournalToTopicActionTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.example.domain.CounterDomain;
import kalix.javasdk.testkit.ActionResult;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

// This class was initially generated based on the .proto definition by Kalix tooling.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.google.protobuf.Empty;
import kalix.javasdk.testkit.ActionResult;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

// This class was initially generated based on the .proto definition by Kalix tooling.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import kalix.javasdk.testkit.DeferredCallDetails;
import com.example.CounterApi;
import com.google.protobuf.Empty;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

public class CounterTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package customer.action;

import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Test;

// This class was initially generated based on the .proto definition by Kalix tooling.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.google.protobuf.Empty;
import customer.Main;
import customer.domain.CustomerDomain;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.Test;

import static java.util.concurrent.TimeUnit.*;

Expand All @@ -21,7 +21,7 @@ public class CustomerEntityIntegrationTest {
/**
* The test kit starts both the service container and the Kalix proxy.
*/
@ClassRule
@RegisterExtension
public static final KalixTestKitResource testKit =
new KalixTestKitResource(Main.createKalix());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import customer.domain.CustomerDomain;
import kalix.javasdk.testkit.ActionResult;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

// This class was initially generated based on the .proto definition by Kalix tooling.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import scala.jdk.javaapi.CollectionConverters;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

public class CustomerEntityTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
import kalix.javasdk.testkit.junit.KalixTestKitResource;
// ...
// end::sample-it-test[]
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.Test;

import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

// Example of an integration test calling our service via the Kalix proxy
// Run all test classes ending with "IntegrationTest" using `mvn verify -Pit`
Expand All @@ -35,7 +35,7 @@ public class ShoppingCartIntegrationTest {
/**
* The test kit starts both the service container and the Kalix proxy.
*/
@ClassRule
@RegisterExtension
public static final KalixTestKitResource testKit =
new KalixTestKitResource(Main.createKalix()); // <1>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import kalix.javasdk.testkit.EventSourcedResult;
import com.example.shoppingcart.ShoppingCartApi;
import com.google.protobuf.Empty;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.NoSuchElementException;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class ShoppingCartTest {

Expand Down
Loading

0 comments on commit 6df437b

Please sign in to comment.