<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Mock Unit Testing Services and Daos with Mockito and Spring 3</title>
	<atom:link href="http://www.reverttoconsole.com/blog/spring/mock-unit-testing-services-and-daos-with-mockito-and-spring-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reverttoconsole.com/blog/spring/mock-unit-testing-services-and-daos-with-mockito-and-spring-3/</link>
	<description>for f in *;do echo &#124; sed &#039;i\rtc&#039; &#62;&#62; $f;done; java programming et al</description>
	<lastBuildDate>Thu, 21 Feb 2013 14:46:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Spring 3 @Autowired Unit Tests with Mockito &#171; In the Folds</title>
		<link>http://www.reverttoconsole.com/blog/spring/mock-unit-testing-services-and-daos-with-mockito-and-spring-3/comment-page-1/#comment-55480</link>
		<dc:creator>Spring 3 @Autowired Unit Tests with Mockito &#171; In the Folds</dc:creator>
		<pubDate>Fri, 02 Mar 2012 16:56:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.reverttoconsole.com/?p=984#comment-55480</guid>
		<description><![CDATA[[...] Mock Unit Testing Services and Daos with Mockito and Spring 3 [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Mock Unit Testing Services and Daos with Mockito and Spring 3 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Priyatam</title>
		<link>http://www.reverttoconsole.com/blog/spring/mock-unit-testing-services-and-daos-with-mockito-and-spring-3/comment-page-1/#comment-54281</link>
		<dc:creator>Priyatam</dc:creator>
		<pubDate>Thu, 19 Jan 2012 04:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.reverttoconsole.com/?p=984#comment-54281</guid>
		<description><![CDATA[@DAVID - Spring comes into play via the @Service annotations and/or @Inject/@Transactional. Not sure what in Spring you would want to mock; the approach, though, is similar.]]></description>
		<content:encoded><![CDATA[<p>@DAVID &#8211; Spring comes into play via the @Service annotations and/or @Inject/@Transactional. Not sure what in Spring you would want to mock; the approach, though, is similar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Hilton</title>
		<link>http://www.reverttoconsole.com/blog/spring/mock-unit-testing-services-and-daos-with-mockito-and-spring-3/comment-page-1/#comment-54270</link>
		<dc:creator>David Hilton</dc:creator>
		<pubDate>Wed, 18 Jan 2012 20:47:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.reverttoconsole.com/?p=984#comment-54270</guid>
		<description><![CDATA[A great example. 

I agree with your comments about other examples using lists since they didn&#039;t reflect Martin Fowler&#039;s discussion about the &#039;subject under test&#039; as distinct the collaborator (http://martinfowler.com/articles/mocksArentStubs.html), in list examples I think they have collapsed the &#039;subject under test&#039; and collaborator together as one in order to showcase mockito easier but this cause confusion about the right technique when mocking. 

I am not sure where Spring is coming in here, that&#039;s why I was looking at your article in the first place(google, &quot;Spring and Mockito&quot;), your example is a straight Mockito test i.e. there is no Spring dependency injection (maybe I have the wrong end of the stick?)

None the less, a good Mockito example.]]></description>
		<content:encoded><![CDATA[<p>A great example. </p>
<p>I agree with your comments about other examples using lists since they didn&#8217;t reflect Martin Fowler&#8217;s discussion about the &#8216;subject under test&#8217; as distinct the collaborator (<a href="http://martinfowler.com/articles/mocksArentStubs.html" rel="nofollow">http://martinfowler.com/articles/mocksArentStubs.html</a>), in list examples I think they have collapsed the &#8216;subject under test&#8217; and collaborator together as one in order to showcase mockito easier but this cause confusion about the right technique when mocking. </p>
<p>I am not sure where Spring is coming in here, that&#8217;s why I was looking at your article in the first place(google, &#8220;Spring and Mockito&#8221;), your example is a straight Mockito test i.e. there is no Spring dependency injection (maybe I have the wrong end of the stick?)</p>
<p>None the less, a good Mockito example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajinkya</title>
		<link>http://www.reverttoconsole.com/blog/spring/mock-unit-testing-services-and-daos-with-mockito-and-spring-3/comment-page-1/#comment-53198</link>
		<dc:creator>Ajinkya</dc:creator>
		<pubDate>Fri, 23 Dec 2011 12:28:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.reverttoconsole.com/?p=984#comment-53198</guid>
		<description><![CDATA[Best and easy example so far :) 
Keep the good work up!]]></description>
		<content:encoded><![CDATA[<p>Best and easy example so far <img src='http://www.reverttoconsole.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Keep the good work up!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Taran Singh</title>
		<link>http://www.reverttoconsole.com/blog/spring/mock-unit-testing-services-and-daos-with-mockito-and-spring-3/comment-page-1/#comment-51233</link>
		<dc:creator>Taran Singh</dc:creator>
		<pubDate>Thu, 03 Nov 2011 16:24:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.reverttoconsole.com/?p=984#comment-51233</guid>
		<description><![CDATA[Gr8 article and I def. I agree the annoying foo/bar doesn&#039;t give anything solid especially when you run into errors :(

TestData.createTestProfile(&quot;userid&quot;); Here still we are incurring some manual labour to create a class and method to return us a profile and to me it looks like not mocking completely, but may be in future what I would like to have is that you just specify the data somehow and get the object created. Thanks]]></description>
		<content:encoded><![CDATA[<p>Gr8 article and I def. I agree the annoying foo/bar doesn&#8217;t give anything solid especially when you run into errors <img src='http://www.reverttoconsole.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>TestData.createTestProfile(&#8220;userid&#8221;); Here still we are incurring some manual labour to create a class and method to return us a profile and to me it looks like not mocking completely, but may be in future what I would like to have is that you just specify the data somehow and get the object created. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy</title>
		<link>http://www.reverttoconsole.com/blog/spring/mock-unit-testing-services-and-daos-with-mockito-and-spring-3/comment-page-1/#comment-47106</link>
		<dc:creator>Davy</dc:creator>
		<pubDate>Thu, 16 Jun 2011 18:18:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.reverttoconsole.com/?p=984#comment-47106</guid>
		<description><![CDATA[Thank you for your example of using mockito.

I would split the &quot;testRead&quot; method in several methods testing only one behaviour, for example &quot;testEmptyReadThrowsInvalidProfileException&quot; and &quot;testValidReadReturnsCorrectDto&quot;

I would also test that an exception is thrown using @Test(expected=YourException.class): see http://junit.sourceforge.net/javadoc/org/junit/Test.html#expected() and http://junit.sourceforge.net/doc/cookbook/cookbook.htm (at the end of the page) for an example.]]></description>
		<content:encoded><![CDATA[<p>Thank you for your example of using mockito.</p>
<p>I would split the &#8220;testRead&#8221; method in several methods testing only one behaviour, for example &#8220;testEmptyReadThrowsInvalidProfileException&#8221; and &#8220;testValidReadReturnsCorrectDto&#8221;</p>
<p>I would also test that an exception is thrown using @Test(expected=YourException.class): see <a href="http://junit.sourceforge.net/javadoc/org/junit/Test.html#expected()" rel="nofollow">http://junit.sourceforge.net/javadoc/org/junit/Test.html#expected()</a> and <a href="http://junit.sourceforge.net/doc/cookbook/cookbook.htm" rel="nofollow">http://junit.sourceforge.net/doc/cookbook/cookbook.htm</a> (at the end of the page) for an example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Priyatam</title>
		<link>http://www.reverttoconsole.com/blog/spring/mock-unit-testing-services-and-daos-with-mockito-and-spring-3/comment-page-1/#comment-46227</link>
		<dc:creator>Priyatam</dc:creator>
		<pubDate>Thu, 19 May 2011 00:17:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.reverttoconsole.com/?p=984#comment-46227</guid>
		<description><![CDATA[Good point. I was too lazy too read the api.]]></description>
		<content:encoded><![CDATA[<p>Good point. I was too lazy too read the api.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Links for May 16th through May 17th — Vinny Carpenter&#039;s blog</title>
		<link>http://www.reverttoconsole.com/blog/spring/mock-unit-testing-services-and-daos-with-mockito-and-spring-3/comment-page-1/#comment-46226</link>
		<dc:creator>Links for May 16th through May 17th — Vinny Carpenter&#039;s blog</dc:creator>
		<pubDate>Wed, 18 May 2011 23:21:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.reverttoconsole.com/?p=984#comment-46226</guid>
		<description><![CDATA[[...] REVERT TO CONSOLE &#8250; Mock Unit Testing Services and Daos with Mockito and Spring 3 &#8211; Mock Unit Testing Services and Daos with Mockito and Spring 3 [...]]]></description>
		<content:encoded><![CDATA[<p>[...] REVERT TO CONSOLE &rsaquo; Mock Unit Testing Services and Daos with Mockito and Spring 3 &#8211; Mock Unit Testing Services and Daos with Mockito and Spring 3 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joris</title>
		<link>http://www.reverttoconsole.com/blog/spring/mock-unit-testing-services-and-daos-with-mockito-and-spring-3/comment-page-1/#comment-46222</link>
		<dc:creator>Joris</dc:creator>
		<pubDate>Wed, 18 May 2011 22:10:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.reverttoconsole.com/?p=984#comment-46222</guid>
		<description><![CDATA[Nice read &amp; learned something new from it!

Although I don&#039;t get why you would write something like

assertEquals(1, 2); // should never execute

You could change it to make it a bit more understandable 
http://junit.sourceforge.net/javadoc/org/junit/Assert.html#fail(java.lang.String)]]></description>
		<content:encoded><![CDATA[<p>Nice read &amp; learned something new from it!</p>
<p>Although I don&#8217;t get why you would write something like</p>
<p>assertEquals(1, 2); // should never execute</p>
<p>You could change it to make it a bit more understandable<br />
<a href="http://junit.sourceforge.net/javadoc/org/junit/Assert.html#fail(java.lang.String)" rel="nofollow">http://junit.sourceforge.net/javadoc/org/junit/Assert.html#fail(java.lang.String)</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
