<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="331311" data-post-id="331311">
  <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">
								<aside class="quote no-group" data-username="nivanson" data-post="11" data-topic="64106">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nivanson/48/12445_2.png" class="avatar"> nivanson:</div>
<blockquote>
<p>I don’t understand what you are asking. Why would you not be able to call your own application server?</p>
</blockquote>
</aside>
<p>Because I am using bypass. According to my understanding, I cannot use bypass for both the external service or my app (since they would have different ports).</p>
<p>If you are aware on how to do this, please do provide an example, using <code>HTTPoison</code> to access your server’s app, and bypass to simulate a response from an external service.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="331311" 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-test-a-phoenix-application-with-bypass/64106/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-331311" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="331311"
                     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 #11"></div>
  </section>
</div>
    <div class="postbit" id="331312" data-post-id="331312">
  <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>It has come to my attention that perhaps the best way to achieve my goal is to test the controller directly and use something like Mox or Hammox to simulate the external service.</p>
<p>This is due to the fact that my original plan, of doing an integration test using <code>bypass</code> to simulate a response from a 3rd party service together with an <code>HTTPoison</code> call to my actual application are not compatible, since <code>bypass</code> will intersect calls to my application, preventing the 3rd party service of being called.</p>
<p>With this in mind I have now changed the direction of my search:</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://phoenix.hexdocs.pm/testing_controllers.html">
  <header class="source">

      <a href="https://phoenix.hexdocs.pm/testing_controllers.html" target="_blank" rel="noopener nofollow ugc">phoenix.hexdocs.pm</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://phoenix.hexdocs.pm/testing_controllers.html" target="_blank" rel="noopener nofollow ugc">Testing Controllers — Phoenix v1.8.8</a></h3>



  </article>

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

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

<p>And will leave this as concluded.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="331312" 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-test-a-phoenix-application-with-bypass/64106/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-331312" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="331312"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-solved cat-solved" title="Marked as solution"></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>