Skip to content

Commit

Permalink
Update 20240709a_AWS_SDK_for_Go_でエンドポイントの向き先を_httptest.NewServer()_にし…
Browse files Browse the repository at this point in the history
…てテスト.md
  • Loading branch information
ma91n committed Jul 10, 2024
1 parent 9bd6b86 commit 7fa47b8
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ SDKの向き先をhttp.TestServer()で起動したgoroutineに変更する必要

一覧でまとめました。1と比較するとインターフェースを追加すると言ったアプリコードの変更が不要。2との違いはMiddlewareの使い方に依存しなくても済む。3との違いは、LocalStack Communityイメージが対応していないサービスでも凌ぐことができる、といったことがあるかと思います。

| No | Name | テストサイズ | インターフェース | Memo |
|----|-------------------------------------------|--------------|----------------| --------------------------------------------------------------------------------|
| 1 | SDKのインターフェース部分をモック化 | Small | 必要 | SDK自体の利用間違いは検知できない。アプリコードの変更が必要 |
| 2 | SDKが提供するMiddlewareを利用してモック化 | Small | - | Middlewareの利用方法を学ぶ必要 |
| 3 | LocalStackを利用 | Medium | - | 品質は上げやすいが、テスト実行速度は遅くなる。対象によっては有料プラン加入が必要 |
| 4 | httptest.NewServer()を利用してモック化 | Medim | - | クライアント側のコードに手を入れなくても良いが、サーバ側のレスポンスは決め打ちで作る必要がある |
| No | Name | テストサイズ | インターフェース | エンドポイント | Memo |
|----|-------------------------------------------|--------------|----------------| --------------| ------------------------------------------------------------------|
| 1 | SDKのインターフェース部分をモック化 | Small | 必要 | - | SDK自体の利用間違いは検知できない。アプリコードの変更が必要 |
| 2 | SDKが提供するMiddlewareを利用してモック化 | Small | - | - | Middlewareの利用方法を学ぶ必要 |
| 3 | LocalStackを利用 | Medium | - | 向き先を変更 | 品質は上げやすいが、テスト実行速度は遅くなる。対象によっては有料プラン加入が必要 |
| 4 | httptest.NewServer()を利用してモック化 | Medim | - | 向き先を変更 | クライアント側のコードに手を入れなくても良いが、サーバ側のレスポンスは決め打ちで作る必要がある |


## まとめ
Expand Down

0 comments on commit 7fa47b8

Please sign in to comment.