-
-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
134 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
http-testing/src/test/java/org/jsmart/zerocode/testhelp/tests/MockServerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.jsmart.zerocode.testhelp.tests; | ||
|
||
|
||
import org.jsmart.zerocode.testhelp.localserver.RunMeFirstLocalMockRESTServer; | ||
import org.junit.After; | ||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
|
||
public class MockServerTest { | ||
private RunMeFirstLocalMockRESTServer mockRESTServer; | ||
|
||
@Before | ||
public void start(){ | ||
mockRESTServer = new RunMeFirstLocalMockRESTServer(RunMeFirstLocalMockRESTServer.PORT); | ||
mockRESTServer.start(); | ||
} | ||
|
||
@After | ||
public void stop(){ | ||
mockRESTServer.stop(); | ||
} | ||
|
||
@Test | ||
public void testMockServerRunning(){ | ||
Assert.assertTrue(mockRESTServer.isRunning()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...est/java/org/jsmart/zerocode/integration/tests/kafka/consume/KafkaConsumePollingTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.jsmart.zerocode.integration.tests.kafka.consume; | ||
|
||
import org.jsmart.zerocode.core.domain.Scenario; | ||
import org.jsmart.zerocode.core.domain.TargetEnv; | ||
import org.jsmart.zerocode.core.runner.ZeroCodeUnitRunner; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@TargetEnv("kafka_servers/kafka_test_server_polling.properties") | ||
@RunWith(ZeroCodeUnitRunner.class) | ||
public class KafkaConsumePollingTest { | ||
|
||
/** | ||
* When no polling time is explicitly defined in properties | ||
* file e.g consumer.pollingTime | ||
* Then intial poll consumer join will default to program | ||
* defined default of 500ms. | ||
*/ | ||
@Test | ||
@Scenario("kafka/consume/test_kafka_consume.json") | ||
public void testKafkaConsume() throws Exception { | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
kafka-testing/src/test/resources/kafka_servers/kafka_test_server_polling.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | ||
# kafka bootstrap servers comma separated | ||
# e.g. localhost:9092,host2:9093 | ||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | ||
kafka.bootstrap.servers=localhost:9092 | ||
|
||
kafka.producer.properties=kafka_servers/kafka_producer.properties | ||
kafka.consumer.properties=kafka_servers/kafka_consumer.properties | ||
|
||
# -------------------------------------------------------------------- | ||
# Optional local consumer properties common/central to all test cases. | ||
# These can be overwritten by the tests locally. | ||
# -------------------------------------------------------------------- | ||
# If this property is set, then the consumer does a commitSync after reading the message(s) | ||
# Make sure you don't set both commitSync and commitAsync to true | ||
consumer.commitSync = true | ||
# If this property is set, then the consumer does a commitAsync after reading the message(s) | ||
# Make sure you don't set both commitSync and commitAsync to true | ||
consumer.commitAsync = false | ||
# All records those were read are dumped to this specified file path | ||
# This path can be a relative path or an absolute path. If the file | ||
# does not exist, it creates the file and dumps the records | ||
consumer.fileDumpTo= target/temp/demo.txt | ||
# If this property is set to true, all records are shown in the response. | ||
# When dealing with large number of records, you might not be interested | ||
# in the individual records, but interested in the recordCount | ||
# i.e. total number of records consumed | ||
consumer.showRecordsConsumed=false | ||
# That means if any record(s) are read, then this counter is reset to 0(zero) and the consumer | ||
# polls again. So if no records are fetched for a specific poll interval, then the consumer | ||
# gives a retry retrying until this max number polls/reties reached. | ||
consumer.maxNoOfRetryPollsOrTimeouts = 5 | ||
|
||
|
||
# local producer properties | ||
producer.key1=value1-testv ycvb |