<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:38:09 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[GODRIVER-2249] Investigate alternative solutions for mocking main API types</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-2249</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;Requests to convert our main API types (&lt;tt&gt;Collection&lt;/tt&gt;, &lt;tt&gt;Database&lt;/tt&gt;, &lt;tt&gt;Client&lt;/tt&gt;, etc.) to interfaces instead of basic structs are continuing to come in. It&apos;s clear that users desire a more seamless way of mocking the behavior of the Go driver for their own testing. See related tickets and online discussions (GODRIVER-2161, &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-1241&quot; title=&quot;Mocking library&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-1241&quot;&gt;&lt;del&gt;GODRIVER-1241&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-834&quot; title=&quot;Please convert Client, Database, Collection and others structs to interfaces to allow develop Mocks&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-834&quot;&gt;&lt;del&gt;GODRIVER-834&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://www.mongodb.com/community/forums/t/unit-testing-mongo-driver-for-golang/122325&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;community forum posts&lt;/a&gt;, and &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/806#issuecomment-982937829&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;comments&lt;/a&gt; on our PRs).&lt;/p&gt;

&lt;p&gt;For reasons of backwards-compatibility (usually, any additions to Go interfaces require major releases under SemVer) and Go best practices (Go official documentation &lt;a href=&quot;https://github.com/golang/go/wiki/CodeReviewComments#interfaces&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;advises against&lt;/a&gt; returning interfaces in the &quot;implementer API&quot;), we are against converting the structs to interfaces. But, we should really investigate alternative solutions here and think about ways to ease this user burden.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1940812">GODRIVER-2249</key>
            <summary>Investigate alternative solutions for mocking main API types</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="11263" iconUrl="https://jira.mongodb.org/images/icons/statuses/generic.png" description="">Scheduled</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="matt.dale@mongodb.com">Matt Dale</assignee>
                                    <reporter username="benji.rewis@mongodb.com">Benji Rewis</reporter>
                        <labels>
                            <label>rp-track</label>
                    </labels>
                <created>Wed, 1 Dec 2021 20:20:17 +0000</created>
                <updated>Thu, 7 Dec 2023 21:19:10 +0000</updated>
                                                                            <component>Testing</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="5934054" author="rachelle.palmer" created="Thu, 7 Dec 2023 19:53:15 +0000"  >&lt;p&gt;More requests on this topic from users:&lt;br/&gt;
Please Make the Go driver interface based so that it can be easily mocked for unitTests and provide interfaces for driver classes that can be used to mock the database for unit tests. Along the lines of what AWS does for its services:&lt;br/&gt;
&lt;a href=&quot;https://aws.amazon.com/blogs/developer/mocking-out-then-aws-sdk-for-go-for-unit-testing/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://aws.amazon.com/blogs/developer/mocking-out-then-aws-sdk-for-go-for-unit-testing/&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="901138">GODRIVER-1241</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="699317">GODRIVER-834</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzw8w7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>