tag:blogger.com,1999:blog-8487142701656203604.post6869088147680226106..comments2024-03-27T19:32:26.247-07:00Comments on Mark's Blog: Use Spring MVC Test framework and Mockito to test controllersMark Chenhttp://www.blogger.com/profile/01317562563064465275noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-8487142701656203604.post-14165259580676849742017-01-17T02:05:48.104-08:002017-01-17T02:05:48.104-08:00Excellent post! Thanks for sharing these helpful t...Excellent post! Thanks for sharing these helpful tips with us.<br /><a href="http://www.youngdecade.com" rel="nofollow">Mobile App Development Company Indore</a>Young Decadehttps://www.blogger.com/profile/05325693721489945643noreply@blogger.comtag:blogger.com,1999:blog-8487142701656203604.post-471194114670962862015-12-31T02:02:26.364-08:002015-12-31T02:02:26.364-08:00Thanks man!
Wasting hours to fix it by your commen...Thanks man!<br />Wasting hours to fix it by your comment.Kenthttps://www.blogger.com/profile/14193430299727522055noreply@blogger.comtag:blogger.com,1999:blog-8487142701656203604.post-4860792363857318312014-11-20T09:40:29.752-08:002014-11-20T09:40:29.752-08:00We need to see the "applicationContextForTest...We need to see the "applicationContextForTest.xml" file, please :)Mininohttps://www.blogger.com/profile/01831684783165916627noreply@blogger.comtag:blogger.com,1999:blog-8487142701656203604.post-28274527404361408222014-10-06T01:56:25.712-07:002014-10-06T01:56:25.712-07:00Hi Thanks For visit us:
ARKA Softwares & Out...Hi Thanks For visit us: <br /><br />ARKA Softwares & Outsourcing is an IT Company focusing on software & Web development and providing offshore outsourcing solutions to enterprises worldwide. <a href="http://arkasoftwares.com/" rel="nofollow">Outsourcing software work in india</a>Arka Softwareshttps://www.blogger.com/profile/09641259638107802111noreply@blogger.comtag:blogger.com,1999:blog-8487142701656203604.post-52113211404246449422013-10-30T14:15:44.582-07:002013-10-30T14:15:44.582-07:00I have a related (as yet unanswered) post on Stack...I have a related (as yet unanswered) post on StackOverflow about this: http://stackoverflow.com/questions/19690907/spring-aspect-not-triggered-in-unit-testJasonhttps://www.blogger.com/profile/07965570272276266129noreply@blogger.comtag:blogger.com,1999:blog-8487142701656203604.post-88396992402279516692013-07-29T05:26:36.070-07:002013-07-29T05:26:36.070-07:00THanks man!
That solved all my problems!
Now i c...THanks man!<br /><br />That solved all my problems!<br /><br />Now i can test everything on my MVC using the MVC features!Renanhttps://www.blogger.com/profile/16253886097556666281noreply@blogger.comtag:blogger.com,1999:blog-8487142701656203604.post-25014886919401447732013-06-11T07:35:17.823-07:002013-06-11T07:35:17.823-07:00I'll join the chorus - it doesn't work for...I'll join the chorus - it doesn't work for me either. The controller contains the real service rather than the mock. I don't want to use the standaloneSetup. This must be possible but I don't know what I'm missing. If anyone cracked it then do post here.Anonymoushttps://www.blogger.com/profile/01613448297779698041noreply@blogger.comtag:blogger.com,1999:blog-8487142701656203604.post-21039248539353753072013-05-01T01:03:37.566-07:002013-05-01T01:03:37.566-07:00I'm following your tutorial for setting up Spr...I'm following your tutorial for setting up Spring MVC Controller JUnit test.<br />I'm getting following error.<br /><br />Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcContentNegotiationManager': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:<br />PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'mediaTypes' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.http.MediaType.valueOf(Ljava/lang/String;)Lorg/springframework/http/MediaType;<br /><br /><br />Can you tell my why this is happening. I have jackson in my class path.Ravihttps://www.blogger.com/profile/03832749084473624985noreply@blogger.comtag:blogger.com,1999:blog-8487142701656203604.post-17139992679938545462013-04-29T22:00:27.822-07:002013-04-29T22:00:27.822-07:00I got this working by changing the instantiation o...I got this working by changing the instantiation of the MockMvc instance to this:<br /><br />this.mockMvc = MockMvcBuilders.standaloneSetup(productController).build();<br /><br />(productController is the controller you are testing)Jasonhttps://www.blogger.com/profile/07965570272276266129noreply@blogger.comtag:blogger.com,1999:blog-8487142701656203604.post-59366256738172689422013-04-23T05:50:30.169-07:002013-04-23T05:50:30.169-07:00I'm having the same problem, the controller un...I'm having the same problem, the controller under test is using the real service instead of the mocked service (and consequently hitting the database during the unit test). How did you configure Spring so that the controller under test uses the mocked service?Steven Hineshttps://www.blogger.com/profile/04067374336411525505noreply@blogger.comtag:blogger.com,1999:blog-8487142701656203604.post-16722072145847213112013-04-14T16:37:51.397-07:002013-04-14T16:37:51.397-07:00This code doesn't work for me, the mocked serv...This code doesn't work for me, the mocked service is not used in the test. Can you post the contents of your applicationContextForTest.xml?Anonymoushttps://www.blogger.com/profile/12968926969800712514noreply@blogger.com