<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Anyone have an example of using Mockito within your Nuxeo code? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/anyone-have-an-example-of-using-mockito-within-your-nuxeo-code/m-p/317166#M4167</link>
    <description>&lt;P&gt;I have a listener class which includes this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;GatewayClient gatewayClient = Framework.getService(GatewayClient.class);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to write a junit which will invoke the listener class, and I want to mock the call to the gateway.&lt;/P&gt;
&lt;P&gt;My first problem is I don't understand how to mock a class, which is being created inside the class I am testing.&lt;/P&gt;
&lt;P&gt;The second problem is that I don't know if the Framwork.getService call will get in the way of the attempt to mock.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2022 16:19:04 GMT</pubDate>
    <dc:creator>Chris_Foran</dc:creator>
    <dc:date>2022-04-12T16:19:04Z</dc:date>
    <item>
      <title>Anyone have an example of using Mockito within your Nuxeo code?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/anyone-have-an-example-of-using-mockito-within-your-nuxeo-code/m-p/317166#M4167</link>
      <description>&lt;P&gt;I have a listener class which includes this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;GatewayClient gatewayClient = Framework.getService(GatewayClient.class);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to write a junit which will invoke the listener class, and I want to mock the call to the gateway.&lt;/P&gt;
&lt;P&gt;My first problem is I don't understand how to mock a class, which is being created inside the class I am testing.&lt;/P&gt;
&lt;P&gt;The second problem is that I don't know if the Framwork.getService call will get in the way of the attempt to mock.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 16:19:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/anyone-have-an-example-of-using-mockito-within-your-nuxeo-code/m-p/317166#M4167</guid>
      <dc:creator>Chris_Foran</dc:creator>
      <dc:date>2022-04-12T16:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Anyone have an example of using Mockito within your Nuxeo code?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/anyone-have-an-example-of-using-mockito-within-your-nuxeo-code/m-p/317167#M4168</link>
      <description>&lt;P&gt;I found this, which includes Mockito.  Don't understand it yet, so not sure it this gives me what I want.  https&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 20:34:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/anyone-have-an-example-of-using-mockito-within-your-nuxeo-code/m-p/317167#M4168</guid>
      <dc:creator>Chris_Foran</dc:creator>
      <dc:date>2022-05-25T20:34:17Z</dc:date>
    </item>
  </channel>
</rss>

