Not really looking to remove mocks and stubs but use of powermock to mock statics, test private methods seems to be anti pattern used in a monolith at my work place.
I beleive these are not good patterns so just thought to see if mockito can help ease the pain and help us with removing these anti patterns in the codebase from testing perspective
I have personally used mockito a lot for various projects, I have lately joined a company where we have this big monolith and the test suite I have see uses lot of PowerMockito ( probably around mockito statics and usage of whenNew)
Can you suggest if your book or generally there is a way to remove these anti patterns and thus use of powermockito from codebase gradually ?
Michał Płachta wrote:I tried to show only cor FP concepts that are not only available in Scala, Haskell, but also in F#, and even Java or Python (like pattern matching that has just been introduced for both!)
1. Without extending ActionSupport it does not work or am i missing something?
2. But if you build your war using maven (mvn clean package) it places the HelloAction-validation.xml away from the .class files
It places it alongside classes folder. ( May be maven war plugin can be configured to do it as well) .
I have written a basic example for struts 2 with validation framework
JSP Page:- having a single field named 'name' and submit button
Action class :- com.package.HelloAction
struts.xml : the action tag has a result with type 'input' and 'success'
HelloAction-validation.xml :- having a requiredstring validation on the name field.
The question is:-
1) why i have to extend ActionSupport to make it working..Isn't that a question against POJO based programming?
2) why is HelloAction-validation.xml needs to be placed under com.package to make it working
Should it not be alnogside classes folder??? the whole concept of configuration files under src package is really confusing??