The spring-mvc-test tag has no wiki summary.
6
votes
1answer
636 views
Testing Spring MVC @ExceptionHandler method with Spring MVC Test
I have the following simple controller to catch any unexpected exceptions:
@ControllerAdvice
public class ExceptionController {
@ExceptionHandler(Throwable.class)
@ResponseStatus(value = ...
1
vote
1answer
118 views
How to avoid NullPointerException in test used MockMvc?
I have controller:
@Controller
public class EventMenuController{
@RequestMapping(value = "/updateEvent", method = RequestMethod.POST)
public String updateEvent(Model model,
...
0
votes
1answer
636 views
Error message = Required MultipartFile parameter 'file' is not present
Testing a spring file upload form, the controlelr signature looks like this
@RequestMapping(value = "upload", method = RequestMethod.POST)
@ResponseBody
public void upload(@RequestParam("file") ...
0
votes
1answer
117 views
StandAlone Spring MVC Test framework
I am having difficulties installing the the spring mvc test framework (Standalone) for applications running version of Spring older than 3.2.
The standalone project available on ...
0
votes
1answer
277 views
Spring MVC Test In Fitnesse
I have a probleme with Fitnesse Integration with Spring MVC .
My use case to test is the authentication :
I have a generic Fixture that load spring Context :
public abstract class ...
2
votes
0answers
98 views
Is it possible to test Portlet Controllers using Springs MockMvc?
You can test your "normal" Spring MVC Controllers using the MockMvc class like so:
mockMvc
.perform(get("/my/fine/path"))
.andExpect(status().isOk());
From the Spring Reference ...
1
vote
0answers
34 views
MockMvc: forwardedUrl is null
I am having problems to make this test work. Assertion always fails because it can't verify forwardedUrl which is always null. If I remove this assumption, it can't verify return model. I suppose it ...
1
vote
0answers
73 views
Spring mock mvc keep file extension
The only relevant question I could I find here is this one.
Unfortunately unlike the above mentioned question I am not using file names as a path variable. What I am sending in a string which may or ...
1
vote
0answers
58 views
How set values for objects which are spring productions for testing using MockMvc
I have this controller class:
@Controller
public class EventMenuController extends AbstractController {
@ModelAttribute("myEvent")
public Event getEvent() {
return new Event();
}
...
1
vote
0answers
305 views
Differences between create MockMvc from WebApplicationContext and create MockMvc from your Controller instance?
When i create MockMvc for restful-webservice testing with spring MVC 3.2.3 using WebApplicationContext like this:
@Autowired
private WebApplicationContext wac;
private MockMvc mockMvc;
@Before
...
1
vote
0answers
97 views
Testing Forwarding in a Spring MVC App
Is there any way of testing the functionality of a forward:/ view being returned from a Spring MVC controller in a JUnit test?
I'm using the MockMvc functionality from Spring 3.2 and my controller ...
0
votes
0answers
44 views
How do you make spring-mvc-test framework stop trapping exceptions?
I am using the Spring MVC Test framework in Spring 3.2.4, and one problem I have with it is that it continuously traps exceptions. For example, if you perform a POST with JSON data (or anything ...
0
votes
0answers
78 views
Mock EJB3.0 Stateful Session Bean in Spring MVC Controller JUnit
How can we Mock EJB3.0 Stateful Session Bean in JUnit for Spring MVC REST Controller. As unit tests wont run in a container how can we mock the EJBs which are autowired in Controllers/any other layers ...
0
votes
0answers
323 views
Spring Controller Testing with Mockito and RequestMappingHandlerMapping
I am using spring 3.2 and trying to unit testing for controller.
My code is
Controller is
@RequestMapping(value = "/sample-home", method = RequestMethod.GET)
public String initSampleHome() {
...
0
votes
0answers
45 views
spring mvc tests outside the war
My project is a project with a full spring stack .
Spring , spring-mvc , spring-security ....
I use Fitnesse For BDD .
I have a maven project for that called bdd-fitnesse .
I want to plug my ...