<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>daisuzu</author_name>
  <author_url>https://blog.hatena.ne.jp/daisuzu/</author_url>
  <blog_title>daisuzu's notes</blog_title>
  <blog_url>https://daisuzu.hatenablog.com/</blog_url>
  <categories>
    <anon>Go</anon>
  </categories>
  <description>テストでaws-sdk-go-v2を使う場合はドキュメントにある通り、Clientのモックを用意するのが一般的な手法かと思います。 ただテストのためだけにinterfaceを書きたくないので、aws-sdk-go-v2が提供するClientをそのまま使える形にしたいです。 幸いaws-sdk-go-v2はClientをカスタマイズするためのオプションがあるため、大別して以下の2つの方法で実現可能です。 1つ目はAPIリクエストの送信先を変更する方法です。 こちらはWithEndpointResolverやWithHTTPClientを用いることで、リクエストをhttptestで立ち上げたサーバ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdaisuzu.hatenablog.com%2Fentry%2F2021%2F10%2F31%2F225356&quot; title=&quot;aws-sdk-go-v2をモックせずにテストする - daisuzu&amp;#39;s notes&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://aws.github.io/aws-sdk-go-v2/diagrams/middleware.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-10-31 22:53:56</published>
  <title>aws-sdk-go-v2をモックせずにテストする</title>
  <type>rich</type>
  <url>https://daisuzu.hatenablog.com/entry/2021/10/31/225356</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
