<?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"
	>
<channel>
	<title>Comments on: Fine Grained Stub Behavior With Mockito</title>
	<atom:link href="http://blog.james-carr.org/2009/10/18/fine-grained-stub-behavior-with-mockito/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.james-carr.org/2009/10/18/fine-grained-stub-behavior-with-mockito/</link>
	<description>Rants and Musings of an Agile Developer</description>
	<pubDate>Fri, 12 Mar 2010 03:12:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: John Smith</title>
		<link>http://blog.james-carr.org/2009/10/18/fine-grained-stub-behavior-with-mockito/#comment-125095</link>
		<dc:creator>John Smith</dc:creator>
		<pubDate>Mon, 25 Jan 2010 06:51:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.james-carr.org/?p=559#comment-125095</guid>
		<description>Hi:

I liked your code examples for Mockito!!!
Is there a link where I can download the code?

Yours,

John Smith</description>
		<content:encoded><![CDATA[<p>Hi:</p>
<p>I liked your code examples for Mockito!!!<br />
Is there a link where I can download the code?</p>
<p>Yours,</p>
<p>John Smith</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Carr</title>
		<link>http://blog.james-carr.org/2009/10/18/fine-grained-stub-behavior-with-mockito/#comment-115824</link>
		<dc:creator>James Carr</dc:creator>
		<pubDate>Tue, 20 Oct 2009 13:05:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.james-carr.org/?p=559#comment-115824</guid>
		<description>It seems I am overdue to write a post on spock ;)</description>
		<content:encoded><![CDATA[<p>It seems I am overdue to write a post on spock <img src='http://blog.james-carr.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Niederwieser</title>
		<link>http://blog.james-carr.org/2009/10/18/fine-grained-stub-behavior-with-mockito/#comment-115757</link>
		<dc:creator>Peter Niederwieser</dc:creator>
		<pubDate>Mon, 19 Oct 2009 22:56:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.james-carr.org/?p=559#comment-115757</guid>
		<description>Seems like the "someResult" element passed to writer.write() and channel.send() got lost in translation, but everything else is there.</description>
		<content:encoded><![CDATA[<p>Seems like the &#8220;someResult&#8221; element passed to writer.write() and channel.send() got lost in translation, but everything else is there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Niederwieser</title>
		<link>http://blog.james-carr.org/2009/10/18/fine-grained-stub-behavior-with-mockito/#comment-115755</link>
		<dc:creator>Peter Niederwieser</dc:creator>
		<pubDate>Mon, 19 Oct 2009 21:17:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.james-carr.org/?p=559#comment-115755</guid>
		<description>As usual, I couldn't resist to try your example with Spock. Here is the result (full code):
&lt;pre name="code" class="java"&gt;
class MessageServiceTest extends Specification {
    def marshaller = Mock(Marshaller)
    def channel = Mock(Channel)
    def messageService = new MessageServiceImpl()
    def invoice = new Invoice()

    def setup() {
        messageService.channel = channel
        messageService.marshaller = marshaller
    }

    def "should write marshalled data out to channel"() {
        when:
        messageService.send(invoice)

        then:
        def writer
        marshaller.setWriter(_) &#62;&#62; { writer = it[0] }
        marshaller.marshall(invoice) &#62;&#62; { writer.write("") }
        1 * channel.send("")
    }
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>As usual, I couldn&#8217;t resist to try your example with Spock. Here is the result (full code):</p>
<pre name="code" class="java">
class MessageServiceTest extends Specification {
    def marshaller = Mock(Marshaller)
    def channel = Mock(Channel)
    def messageService = new MessageServiceImpl()
    def invoice = new Invoice()

    def setup() {
        messageService.channel = channel
        messageService.marshaller = marshaller
    }

    def "should write marshalled data out to channel"() {
        when:
        messageService.send(invoice)

        then:
        def writer
        marshaller.setWriter(_) &gt;&gt; { writer = it[0] }
        marshaller.marshall(invoice) &gt;&gt; { writer.write("") }
        1 * channel.send("")
    }
}
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
