-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
- Loading branch information
1 parent
6d000dc
commit 2b5774d
Showing
8 changed files
with
144 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package fake | ||
|
||
import ( | ||
"github.com/aws/aws-sdk-go/service/acm" | ||
"github.com/aws/aws-sdk-go/service/acm/acmiface" | ||
) | ||
|
||
type ACMClient struct { | ||
acmiface.ACMAPI | ||
output acm.ListCertificatesOutput | ||
cert acm.GetCertificateOutput | ||
} | ||
|
||
func (m ACMClient) ListCertificates(in *acm.ListCertificatesInput) (*acm.ListCertificatesOutput, error) { | ||
return &m.output, nil | ||
} | ||
|
||
func (m ACMClient) ListCertificatesPages(input *acm.ListCertificatesInput, fn func(p *acm.ListCertificatesOutput, lastPage bool) (shouldContinue bool)) error { | ||
fn(&m.output, true) | ||
return nil | ||
} | ||
|
||
func (m ACMClient) GetCertificate(input *acm.GetCertificateInput) (*acm.GetCertificateOutput, error) { | ||
return &m.cert, nil | ||
} | ||
|
||
func NewACMClient(output acm.ListCertificatesOutput, cert acm.GetCertificateOutput) ACMClient { | ||
return ACMClient{ | ||
output: output, | ||
cert: cert, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package fake | ||
|
||
import ( | ||
"github.com/aws/aws-sdk-go/service/iam" | ||
"github.com/aws/aws-sdk-go/service/iam/iamiface" | ||
) | ||
|
||
type IAMClient struct { | ||
iamiface.IAMAPI | ||
list iam.ListServerCertificatesOutput | ||
cert iam.GetServerCertificateOutput | ||
} | ||
|
||
func (m IAMClient) ListServerCertificates(*iam.ListServerCertificatesInput) (*iam.ListServerCertificatesOutput, error) { | ||
return &m.list, nil | ||
} | ||
|
||
func (m IAMClient) ListServerCertificatesPages(input *iam.ListServerCertificatesInput, fn func(*iam.ListServerCertificatesOutput, bool) bool) error { | ||
fn(&m.list, true) | ||
return nil | ||
} | ||
|
||
func (m IAMClient) GetServerCertificate(*iam.GetServerCertificateInput) (*iam.GetServerCertificateOutput, error) { | ||
return &m.cert, nil | ||
} | ||
|
||
func NewIAMClient(list iam.ListServerCertificatesOutput, cert iam.GetServerCertificateOutput) IAMClient { | ||
return IAMClient{ | ||
list: list, | ||
cert: cert, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package aws | ||
|
||
import "os" | ||
|
||
func mustRead(testFile string) string { | ||
buf, err := os.ReadFile("testdata/" + testFile) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return string(buf) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters