stephan-mueller / wildfly-showcase Goto Github PK
View Code? Open in Web Editor NEWWildfly MP Showcase
License: Apache License 2.0
Wildfly MP Showcase
License: Apache License 2.0
Hello,
This is not an issue but rather a question. I have cloned this repository, tested it and it worked as expected. However, using the sample project as a template for developing my own ones, I have the mentioned exception running a Mockito unit test, the equivalent of what you're doing in the GreetResourceTest class, when you invoke the resource, as follows:
Response response = resource.greet("Stephan");
Of course, I have a different context, but everything is similar, in the sense that there is an API resource, injecting and invoking a service, etc. So I'm mocking these components in a similar way, for example:
@Mock
private Service service;
@InjectMocks
private Resource resource;
I'm trying to call the API:
Response response = resource.doSomething();
thinking that in the context of a unit test, with Mockito, this call doesn't require JAX-RS client, as this is the case in your project. However, the exception is raised, which doesn't happen when I run your project and, comparing both, I don't see significant differences of maven artifacts or anything else then just context.
Do you have an idea of why it happens in my case and not in yours ? Of course, I'm doing thae equivalent of what you're doing here:
Mockito.lenient().doCallRealMethod().when(service).getMessage(Mockito.anyString());
Many thanks in advance for your help.
Kind regards,
Nicolas
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.