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

ISSUE-622, ISSUE-626 Java static method and multiple arguments exec support #628

Merged

Conversation

a1shadows
Copy link
Collaborator

@a1shadows a1shadows commented Feb 17, 2024

  1. Support for multiple parameters in java method exec
  2. Support for static method Exec
  3. Minor refactoring changes

fixes #622 , #626

PR Branch

Motivation and Context

With this PR, it will be possible to do java exec of static methods as well as methods with multiple arguments.

For static methods, they have to be invoked in exactly the same way as instance methods were invoked up to this point.

As for methods with multiple arguments, let's say there is a method like so

public Map<String, String> sampleMultiArgMethod1(String arg1, String arg2)

It would be invoked in the following way:

{
      "name": "sample method 1",
      "url": "org.jsmart.zerocode.zerocodejavaexec.SampleMethods",
      "method": "sampleMultiArgMethod1",
      "request": {
        "0" : "arg1value",
        "1" : "arg2value"
      }

The arguments will have to be provided as a json with the key being the 0 indexed order of occurrence in the java method argument list.

Checklist:

  • Unit tests added

  • Integration tests added

  • Test names are meaningful

  • Feature manually tested

  • Branch build passed

  • No 'package.*' in the imports

  • Relevant Wiki page updated with clear instruction for the end user

    • Not applicable. This was only a refactor change, no functional or behaviour changes were introduced
  • Http test added to http-testing module(if applicable) ?

    • Not applicable. The changes did not affect HTTP automation flow
  • Kafka test added to kafka-testing module(if applicable) ?

    • Not applicable. The changes did not affect Kafka automation flow

1. Support for multiple parameters in java method exec
2. Support for static method Exec
3. Minor refactoring changes
@a1shadows a1shadows marked this pull request as ready for review February 17, 2024 10:51
@a1shadows
Copy link
Collaborator Author

@authorjapps Can you take a look at this PR

@authorjapps
Copy link
Owner

@authorjapps Can you take a look at this PR

Sorry, was away in the weekend.
Thanks for this, Will have a look soon.

@authorjapps
Copy link
Owner

Looking good from all aspects.
CI also passed.
Can be merged now anytime 👍

@authorjapps authorjapps merged commit 65892d1 into authorjapps:master Feb 18, 2024
1 check passed
@a1shadows a1shadows deleted the issue-622/static-method-support branch March 14, 2024 01:57
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.

Static java method invocation in step
2 participants