question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@UseKafkaClient is not working with TestSuite

See original GitHub issue

I’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:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
PrabaharanKcommented, Oct 3, 2019

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.

1reaction
PrabaharanKcommented, Oct 1, 2019

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,

  1. Create Test Suite like below @TargetEnv(“properties/server.properties”) @TestPackageRoot(“scenarioJsons”) @EnvProperty(“_${env}”) @RunWith(ZeroCodePackageRunner.class) @UseKafkaClient(CustomKafkaClient.class) public class SmokeTestSuite {}

  2. add Customized kafka client by @UseKafkaClient(CustomKafkaClient.class)

  3. if start your test suite, BasicKafkaClient.class is used to send and receive messages instead of picking my Customized one.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found