Skip to content

feat(Mocking): make it easier to match any input in mockito#1259

Merged
bai-uipath merged 1 commit intomainfrom
bai/mockito-default-any
Feb 4, 2026
Merged

feat(Mocking): make it easier to match any input in mockito#1259
bai-uipath merged 1 commit intomainfrom
bai/mockito-default-any

Conversation

@bai-uipath
Copy link
Collaborator

@bai-uipath bai-uipath commented Feb 3, 2026

This PR makes it easier to set up Mockito deterministic mocks in the case where we want it to always return a constant value (probably the most common case in practice).

Current design - explicit matching required using mockito.matchers.Any

  {                                                                                                                                       
    "function": "my_tool",                                                                                                                
    "arguments": {                                                                                                                        
      "kwargs": {                                                                                                                         
        "param1": {"_target_": "mockito.matchers.Any"},                                                                                   
        "param2": {"_target_": "mockito.matchers.Any"}                                                                                    
      }                                                                                                                                   
    },                                                                                                                                    
    "then": [{"type": "return", "value": "result"}]                                                                                       
  }

Improved design: arguments is optional, if omitted, always match

  {                                                                                                                                       
    "function": "my_tool",                                                                                                                
    "then": [{"type": "return", "value": "result"}]                                                                                       
  }

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Feb 3, 2026
@bai-uipath bai-uipath changed the title [WIP] Make it easier to match any input in mockito Make it easier to match any input in mockito Feb 3, 2026
@bai-uipath bai-uipath changed the title Make it easier to match any input in mockito feat(Mocking): make it easier to match any input in mockito Feb 3, 2026
@bai-uipath bai-uipath force-pushed the bai/mockito-default-any branch from 6c871f2 to 5cfceee Compare February 3, 2026 22:07
@bai-uipath bai-uipath marked this pull request as ready for review February 3, 2026 22:07
@bai-uipath bai-uipath requested a review from akshaylive February 3, 2026 22:08
@bai-uipath bai-uipath force-pushed the bai/mockito-default-any branch 2 times, most recently from c3b6b87 to 65bce2f Compare February 3, 2026 22:15
Copy link
Collaborator

@akshaylive akshaylive left a comment

Choose a reason for hiding this comment

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

This would've been supported in this PR but I like your idea of defaulting it to ARGS, KWARGS.

Please rebase/bump version before merging.

@bai-uipath bai-uipath force-pushed the bai/mockito-default-any branch from 65bce2f to 1cb0014 Compare February 4, 2026 18:16
@bai-uipath bai-uipath merged commit 848039a into main Feb 4, 2026
92 checks passed
@bai-uipath bai-uipath deleted the bai/mockito-default-any branch February 4, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants