Skip to content

Commit

Permalink
chore: Respond to PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jarjee committed Mar 20, 2024
1 parent ef5d5bf commit 488dbf4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion internal/cli/atlas/streams/instance/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (opts *DownloadOpts) initStore(ctx context.Context) func() error {

func (opts *DownloadOpts) Run() error {
params := atlasv2.DownloadStreamTenantAuditLogsApiParams{
GroupId: opts.ProjectID,
GroupId: opts.ConfigProjectID(),
TenantName: opts.tenantName,
}

Expand Down
17 changes: 4 additions & 13 deletions internal/cli/atlas/streams/instance/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package instance

import (
"io"
"os"
"strings"
"testing"

"github.com/golang/mock/gomock"
Expand All @@ -37,19 +37,8 @@ func TestDownloadOpts_Run(t *testing.T) {
const projectID = "download-project-id"
const tenantName = "streams-tenant"

file, err := os.CreateTemp("", "")
if err != nil {
require.NoError(t, err)
}
filename := file.Name()
defer os.Remove(filename)
_, _ = file.WriteString(contents)
_ = file.Close()

expected, _ := os.Open(filename)
defer expected.Close()

fs := afero.NewMemMapFs()

downloadOpts := &DownloadOpts{
store: mockStore,
DownloaderOpts: cli.DownloaderOpts{
Expand All @@ -67,6 +56,8 @@ func TestDownloadOpts_Run(t *testing.T) {
downloadParams.GroupId = projectID
downloadParams.TenantName = tenantName

expected := io.NopCloser(strings.NewReader(contents))

mockStore.
EXPECT().
DownloadAuditLog(downloadParams).
Expand Down

0 comments on commit 488dbf4

Please sign in to comment.