All the examples provided for mockedStatic method is for method without parameters. Is there a way to mock methods with parameters.
examples provided: https://javadoc
It is possible, you need to use a lambda instead of a method reference:
try (MockedStatic<Foo> dummyStatic = Mockito.mockStatic(Foo.class)) {
dummyStatic.when(() -> Foo.method("param1"))
.thenReturn("someValue");
// when
System.out.println(Foo.method("param1"));
//then
dummyStatic.verify(
times(1),
() -> Foo.method("param1")
);
}