i have service code like this forexample line 1) Mono.zip(map(string, object), stringlist, customers).zipwhen(resp-> line 2) custom.readdevice("abcde", false).collectmap(sss->sss.getdeviceid())) where custom.readdevice("abcde", false) is a mock method i mocked this method in test class Device device = new Device(); sss.setdeviceid("DD"); Flux fluxdevice = Flux.just(device); Mockito.lenient().when(custom.readdevice("abcde", false)).thenReturn(fluxdevice); when i debug this code until line1 code getting executed after that mocked method not called if i try mocked method outside Mono.zip it executes very well but not in Mono.zip please help me sir
Anything wrong with the below code, the lambda function is not executing. How to use the args ? Any help would be appreciated Mono test = Mono.just("test"); Mono testtwo = Mono.just("testTwo"); Mono str = Mono.zip(args -> { return (String) args[0]; }); System.out.println(str); // This is printing MonoEmpty
Very helpful, thanks
Could someone tell me why use flatMap and Flux.just() instead of map ?
this is one of the clear explanation, thanks got to know how zip exactly works.
Thanks for the feedback
Apparently zipWith has several ways to apply it to the stream, but interesting thanks big dog.
grand blue..hahaha, a true man of culture I see.
Finally another man of culture.
Whats the difference between zip() and zipWhen() besides that the first supports only two streams?
i have service code like this
forexample
line 1) Mono.zip(map(string, object), stringlist, customers).zipwhen(resp->
line 2) custom.readdevice("abcde", false).collectmap(sss->sss.getdeviceid()))
where custom.readdevice("abcde", false) is a mock method
i mocked this method in test class
Device device = new Device();
sss.setdeviceid("DD");
Flux fluxdevice = Flux.just(device);
Mockito.lenient().when(custom.readdevice("abcde", false)).thenReturn(fluxdevice);
when i debug this code until line1 code getting executed after that mocked method not called
if i try mocked method outside Mono.zip it executes very well but not in Mono.zip
please help me sir
Anything wrong with the below code, the lambda function is not executing. How to use the args ? Any help would be appreciated
Mono test = Mono.just("test");
Mono testtwo = Mono.just("testTwo");
Mono str = Mono.zip(args -> {
return (String) args[0];
});
System.out.println(str); // This is printing MonoEmpty