<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="188649" data-post-id="188649">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I don’t unit test something like that. Generally when your testing implementations for otherwise mocked behaviour they’re integration tests and in your case would call <code>Manager</code> proper. There should be hardly any business logic in there besides mapping the behaviours api ↔ the implementing libraries api.</p>
<p>Edit:</p>
<p>Which isn’t to say you configure <code>:manager</code> to use its own mocks for those integration tests. But it clearly is a integration test, as you’re integrating with <code>:manager</code> for the test. <code>:cli</code> alone can’t test this.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="188649" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-manage-files-that-have-behaviours-and-defer-to-an-implementation-at-the-same-time/34145/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-188649" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="188649"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="188657" data-post-id="188657">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Fl4m3Ph03n1x" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Fl4m3Ph03n1x/120/11709_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Fl4m3Ph03n1x
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Although a discussion regarding “How to approach testing” is out of the scope of this post, I would say I am more on the side of J. B. (Joe) Rainsberger and I usually avoid Integration tests. This is not to say I have 0, it’s just I prefer not having to deal with them as they are quite hard to maintain.</p>
<p>I am usually on the side of “If I know I am sending the correct information to <code>Manager</code>, then I don’t care what happens next because it is not my problem”. This is why I have the <code>Manager</code> behaviour in the first place. technically I don’t need it, but since I am using Hammox then I must have a behaviour so I can have my unit tests. Thus, I place the Public API in the same file of the behaviour.</p>
<p>This allows me to test that I am “sending messages with the correct format” to <code>Manager</code> (because Hammox will blow up at compile time if I am not) and the test itself makes sure I am sending the “messages with the correct content”.</p>
<p>For these reasons I am leaning on going with the alternate code of my question. I was wondering if there was another solution I was missing, but after reading (and trying) the options everyone provided me here I am still not convinced that all the extra work will be worth it.</p>
<p>A very interesting discussion and I thank everyone for their participation (special kudos to <a class="mention" href="/u/lostkobrakai" rel="nofollow">@LostKobrakai</a> !)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="188657" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-manage-files-that-have-behaviours-and-defer-to-an-implementation-at-the-same-time/34145/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-188657" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="188657"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="188661" data-post-id="188661">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>So as mentioned prev. you could treat your umbrella like a single application and all my points become irrelevant. But if you don’t do that then even “sending the correct information to <code>Manager</code>” is something <code>:cli</code> can’t know.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="188661" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-manage-files-that-have-behaviours-and-defer-to-an-implementation-at-the-same-time/34145/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-188661" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="188661"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="188667" data-post-id="188667">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Fl4m3Ph03n1x" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Fl4m3Ph03n1x/120/11709_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Fl4m3Ph03n1x
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Regarding your Impl suggestion, I believe you could benefit from reading this article:</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://blog.octoperf.com/impl-classes-are-evil/">
  <header class="source">
      <img src="https://blog.octoperf.com/img/favicon.ico" class="site-icon" alt="" width="48" height="48">

      <a href="https://blog.octoperf.com/impl-classes-are-evil/" target="_blank" rel="noopener nofollow ugc">blog.octoperf.com</a>
  </header>

  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:600/300;"><img src="https://blog.octoperf.com/img/blog/impl-classes-are-evil/java-code.png" class="thumbnail" alt="" width="600" height="300"></div>

<h3><a href="https://blog.octoperf.com/impl-classes-are-evil/" target="_blank" rel="noopener nofollow ugc">Impl classes are evil - OctoPerf</a></h3>

  <p>Why you should never name your class with Impl suffix.</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="188667" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-manage-files-that-have-behaviours-and-defer-to-an-implementation-at-the-same-time/34145/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-188667" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="188667"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="188669" data-post-id="188669">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Tbh I’ve just skimmed the but there are a few thoughs. There is not just one implementation if you’re mocking the implementation. There’s always at least the implementation you use in prod and the mock. That’s 2.</p>
<p>The other part is having the interface and the implementation in one package. That’s a valid concern. You could have a third application, which depends on both <code>:cli</code> and <code>:manager</code> to hold the implemenation, then <code>:cli</code> wouldn’t even depends on <code>:manager</code> at all. You can see the same e.g. in <code>:phoenix</code> ← <code>:phoenix_ecto</code> → <code>:ecto</code>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="188669" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-manage-files-that-have-behaviours-and-defer-to-an-implementation-at-the-same-time/34145/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-188669" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="188669"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="188670" data-post-id="188670">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="christhekeele" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/christhekeele/120/1039_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  christhekeele
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Agreed my suggestion is poor naming. This case differs slightly from the article, as the module I describe is not “concrete implementation” here so much as “default implementation”, for concrete-land to fall back to. “Default” probably works better though I still don’t love it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="188670" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-manage-files-that-have-behaviours-and-defer-to-an-implementation-at-the-same-time/34145/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-188670" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="188670"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>