@UseKafkaClient is not working with TestSuite
See original GitHub issueI’m using zerocode-tdd version of 1.3.8. When I write individual test classes with customized kafka client like below
@UseKafkaClient(CustomKafkaClient.class)
public class TestClass {
@Test
@JsonTestCase("scenarioJsons/json1.json")
public void testMethod1() throws Exception {
}
}
My CustomKafkaClient.class is loaded and everything works fine.
When I try to run the Json tests through TestSuite like below
@TargetEnv("properties/server.properties")
@TestPackageRoot("scenarioJsons")
@EnvProperty("_${env}")
@RunWith(ZeroCodePackageRunner.class)
@UseKafkaClient(CustomKafkaClient.class)
public class SmokeTestSuite {}
Though I annotated test suite class with @UseKafkaClient(CustomKafkaClient.class), BasicKafkaClient.class from org.jsmart.zerocode.core.kafka.client is loaded instead of CustomKafkaClient.class due to that my Kafka consumers are failing.
Can anyone help me to load the customized CustomKafkaClient.class in test suite scenario ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
unittest — Unit testing framework — Python 3.11.1 ...
A test suite is a collection of test cases, test suites, or both. It is used to aggregate tests that should be ......
Read more >crossbario/autobahn-testsuite - GitHub
To test multiple clients and generate one big report containing all clients, do NOT stop the testsuite container, but run all your clients,...
Read more >How do I run all Python unit tests in a directory? - Stack Overflow
To use this command, your project's tests must be wrapped in a unittest test suite by either a function, a TestCase class or...
Read more >LLVM Testing Infrastructure Guide - Documentation
This directory contains a large array of small tests that exercise various features of LLVM and to ensure that regressions do not occur....
Read more >The deal.II Testsuite
II has a testsuite with thousands of small programs that we run every time we make a change to make sure that no...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The Point is, Messages we pushed and received from Kafka topic is encrypted. The Encryption and decryption mechanisms are company specific. So Whatever message we push should be encrypted and vice versa. so before assertion we need to convert the encrypted message into a proper one and do assert. So we use CustomKafkaClient in the middle to do encrypt / decrypt messages.
This s not urgent to me. use case is I’m preparing TestSuite,I want to add customized kafka client to send and receive messages from topic. Problem is, with @TestPackageRoot(“scenarioJsons”) my customized kafka client is not working. Test suite took default BasicKafkaClient.class.
Scenario,
Create Test Suite like below @TargetEnv(“properties/server.properties”) @TestPackageRoot(“scenarioJsons”) @EnvProperty(“_${env}”) @RunWith(ZeroCodePackageRunner.class) @UseKafkaClient(CustomKafkaClient.class) public class SmokeTestSuite {}
add Customized kafka client by @UseKafkaClient(CustomKafkaClient.class)
if start your test suite, BasicKafkaClient.class is used to send and receive messages instead of picking my Customized one.