<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.theeggeadventure.com/wikimedia/index.php?action=history&amp;feed=atom&amp;title=Why_I_dislike_mocks</id>
	<title>Why I dislike mocks - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.theeggeadventure.com/wikimedia/index.php?action=history&amp;feed=atom&amp;title=Why_I_dislike_mocks"/>
	<link rel="alternate" type="text/html" href="https://www.theeggeadventure.com/wikimedia/index.php?title=Why_I_dislike_mocks&amp;action=history"/>
	<updated>2026-06-27T12:19:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0-beta</generator>
	<entry>
		<id>https://www.theeggeadventure.com/wikimedia/index.php?title=Why_I_dislike_mocks&amp;diff=1730&amp;oldid=prev</id>
		<title>Egge at 02:34, 1 October 2007</title>
		<link rel="alternate" type="text/html" href="https://www.theeggeadventure.com/wikimedia/index.php?title=Why_I_dislike_mocks&amp;diff=1730&amp;oldid=prev"/>
		<updated>2007-10-01T02:34:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:34, 1 October 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l24&quot;&gt;Line 24:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 24:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sorting out problems like this seems to be a complete waste of time. My preference would be to use a [http://www.martinfowler.com/bliki/TestDouble.html stub or a fake object].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sorting out problems like this seems to be a complete waste of time. My preference would be to use a [http://www.martinfowler.com/bliki/TestDouble.html stub or a fake object].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Java]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key egge_wikimedia-mw_:diff:1.41:old-1549:rev-1730:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Egge</name></author>
	</entry>
	<entry>
		<id>https://www.theeggeadventure.com/wikimedia/index.php?title=Why_I_dislike_mocks&amp;diff=1549&amp;oldid=prev</id>
		<title>Brianegge at 05:25, 12 March 2007</title>
		<link rel="alternate" type="text/html" href="https://www.theeggeadventure.com/wikimedia/index.php?title=Why_I_dislike_mocks&amp;diff=1549&amp;oldid=prev"/>
		<updated>2007-03-12T05:25:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Mock&amp;#039;s are brittle and force your tests to assume an implementation of the code you are testing.  Today, the unit test broke because I added this line of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            LOG.debug(&amp;quot;Received Message &amp;quot; + responseMessage.getJMSCorrelationID());&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reported failure:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Testcase: testRequestSendsMessageAndWaitsForResponse(JmsServiceImplUnitTest):	Caused an ERROR&lt;br /&gt;
&lt;br /&gt;
  Unexpected method call getJMSCorrelationID():&lt;br /&gt;
java.lang.AssertionError: &lt;br /&gt;
  Unexpected method call getJMSCorrelationID():&lt;br /&gt;
	at org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:29)&lt;br /&gt;
	at org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:45)&lt;br /&gt;
	at $Proxy13.getJMSCorrelationID(Unknown Source)&lt;br /&gt;
	at JmsServiceImpl.makeRequest(JmsServiceImpl.java:48)&lt;br /&gt;
	at JmsServiceImplUnitTest.testRequestSendsMessageAndWaitsForResponse(JmsServiceImplUnitTest.java:56)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
expect(sendMessage.getJMSCorrelationID()).andReturn(&amp;quot;JMS1&amp;quot;).anyTimes();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sorting out problems like this seems to be a complete waste of time. My preference would be to use a [http://www.martinfowler.com/bliki/TestDouble.html stub or a fake object].&lt;/div&gt;</summary>
		<author><name>Brianegge</name></author>
	</entry>
</feed>