Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Add test framework to be able to run unit test.#17

Merged
sijie merged 8 commits intostreamnative:masterfrom
jiazhai:test
Jul 24, 2019
Merged

Add test framework to be able to run unit test.#17
sijie merged 8 commits intostreamnative:masterfrom
jiazhai:test

Conversation

@jiazhai
Copy link
Contributor

@jiazhai jiazhai commented Jul 23, 2019

This PR is based on
Produce request, which is in PR #14, please review and merge that first.

changes:

  • change to sn pulsar version, so we could call getter/setter for parent class in KafkaBrokerService and KafkaService. Or it is not able to do the mock in test framework.
  • add test framework,
  • add a simple produce request test, and pass write test.

@jiazhai jiazhai requested a review from sijie July 23, 2019 13:38
@jiazhai jiazhai self-assigned this Jul 23, 2019
@jiazhai
Copy link
Contributor Author

jiazhai commented Jul 23, 2019

@sijie Tests added Pulsar consumer .

// 2. Consume messages use Pulsar client Consumer.
for (int i = 0; i < totalMsgs; i++) {
msg = consumer.receive(100, TimeUnit.MILLISECONDS);
log.info("Pulsar consumer get message: {}", new String(msg.getData()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an assertion to compare the message payload?

Also I think you need to test a few variants:

  • with key
  • with message headers
  • with timestamp
  • with compression

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sijie , add an issue #18 to track this.

@sijie sijie added this to the 0.0.1 milestone Jul 24, 2019
@sijie sijie merged commit daa19e1 into streamnative:master Jul 24, 2019
@sijie sijie deleted the test branch July 24, 2019 02:02
@jiazhai jiazhai modified the milestones: 0.0.1, 0.1.0 Feb 17, 2020
michaeljmarshall pushed a commit to michaeljmarshall/kop that referenced this pull request Dec 13, 2022
Demogorgon314 pushed a commit to Demogorgon314/kop that referenced this pull request Nov 28, 2023
…treamnative#17)

Fixes streamnative/ksn#7

### Modifications

- Migrate `KerberosLogin` from Kafka for the Kerberos related
operations, it's simplified that many configurations are not
configurable.
- Implement a trivial `KerberosCallbackHandler`
- When the client sends authentication requests with GSSAPI mechanism,
create the `SaslServer` via `Sasl.createSaslServer` with the params that are parsed
from `KerberosLogin#subject()`.
- Use the same logic with Kafka to convert the original Kerberos
principal to the short principal. e.g.
  - `client@EXAMPLE.com` to `client`
  - `client/localhost@EXAMPLE.com` to `client`
- Add the `GssapiAuthenticationTest` to verify granting permission on a
Kerberos principal and the short name conversion.

(cherry picked from commit 53c413bfa97f6c0afec79200725ff317e6ce56fe)

Fix conclicts caused by:
- apache/pulsar#15121 the new config introduced
from Pulsar 2.11
- streamnative#1731 a simple enhancement
that is not cherry-picked into branch-2.10
- streamnative#1759 adds the `config` field
to `PlainSaslServer` for the new `authenticateAsync` API
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants