Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shrohilla/kafka header bindings #308

Merged
merged 11 commits into from Apr 6, 2022
Merged

Conversation

shrohilla
Copy link
Contributor

@shrohilla shrohilla commented Mar 31, 2022

  1. Added the support for the kafka headers for output bindings
  2. Reconverting the object from string check if the required params exists than create the KafkaEventData
  3. It doesn't require the unit test case as the class is internal class

@shrohilla
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@TsuyoshiUshio TsuyoshiUshio left a comment

Choose a reason for hiding this comment

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

Some naming convention issue is there. However generally looks good.
One thing I'd like to recommend is, write unit test. You can use internal scope for enabling unit testing with internalVisuleTo https://codesnippets.fesslersoft.de/use-the-assembly-internalsvisibleto-attribute/

Automated testing seems to fail.

@shrohilla
Copy link
Contributor Author

Some naming convention issue is there. However generally looks good. One thing I'd like to recommend is, write unit test. You can use internal scope for enabling unit testing with internalVisuleTo https://codesnippets.fesslersoft.de/use-the-assembly-internalsvisibleto-attribute/

Automated testing seems to fail.

Hi @TsuyoshiUshio I had addressed all the comments shared and created the unit test cases also, please review the code

Copy link
Contributor

@TsuyoshiUshio TsuyoshiUshio left a comment

Choose a reason for hiding this comment

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

The unit tests should include the testing for headers since you added headers feature. You can share the spec and prove it works with variation with writing unit tests.

@shrohilla
Copy link
Contributor Author

The unit tests should include the testing for headers since you added headers feature. You can share the spec and prove it works with variation with writing unit tests.

@TsuyoshiUshio -- Already added that in the test -- AddAsync_Item_Is_Of_KafkaEventData_Json_String_Types
It contains headers details also

@TsuyoshiUshio
Copy link
Contributor

TsuyoshiUshio commented Apr 5, 2022

Hi @shrohilla
The test doesn't include assertion or validation using Moq. Am I missing something? Usually, test cases will be constructed by three sections.

  1. Setup
  2. Run the target
  3. Assertion/Validation
    However, on your test case I can't find it. For example. https://github.com/Azure/azure-functions-kafka-extension/blob/dev/test/Microsoft.Azure.WebJobs.Extensions.Kafka.UnitTests/KafkaProducerFactoryTest.cs For the validation of the Moq will be https://makolyte.com/moq-verifying-parameters-passed-to-a-mocked-method/#:~:text=When%20you%20need%20to%20verify%20that%20the%20code,expected%20with%20the%20specified%20parameters.%20Here%E2%80%99s%20an%20example.

@shrohilla
Copy link
Contributor Author

Hi @shrohilla The test doesn't include assertion or validation using Moq. Am I missing something? Usually, test cases will be constructed by three sections.

  1. Setup
  2. Run the target
  3. Assertion/Validation
    However, on your test case I can't find it. For example. https://github.com/Azure/azure-functions-kafka-extension/blob/dev/test/Microsoft.Azure.WebJobs.Extensions.Kafka.UnitTests/KafkaProducerFactoryTest.cs For the validation of the Moq will be https://makolyte.com/moq-verifying-parameters-passed-to-a-mocked-method/#:~:text=When%20you%20need%20to%20verify%20that%20the%20code,expected%20with%20the%20specified%20parameters.%20Here%E2%80%99s%20an%20example.

@TsuyoshiUshio Added the few possible validations, will add this scenario in the E2E tests for language workers as a separate task.

@shrohilla shrohilla merged commit ed25ee0 into dev Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants