This commit is contained in:
Nicolas Ontiveros 2024-11-15 10:26:32 -08:00
Родитель 9719391dd5
Коммит faa8f0f13b
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -613,7 +613,7 @@ func TestNewMonitor(t *testing.T) {
emitter.EXPECT().EmitGauge(MetricFailedNSGMonitorCreation, int64(1), dims)
},
mockInterface: func(mi *mock_env.MockInterface) {
mi.EXPECT().FPNewClientCertificateCredential(gomock.Any()).Return(nil, errors.New("Unknown Error"))
mi.EXPECT().FPNewClientCertificateCredential(gomock.Any(), gomock.Any()).Return(nil, errors.New("Unknown Error"))
},
tick: true,
valid: isOfType[*monitoring.NoOpMonitor],
@ -627,7 +627,7 @@ func TestNewMonitor(t *testing.T) {
emitter.EXPECT().EmitGauge(MetricPreconfiguredNSGEnabled, int64(1), dims)
},
mockInterface: func(mi *mock_env.MockInterface) {
mi.EXPECT().FPNewClientCertificateCredential(gomock.Any()).Return(&azidentity.ClientCertificateCredential{}, nil)
mi.EXPECT().FPNewClientCertificateCredential(gomock.Any(), gomock.Any()).Return(&azidentity.ClientCertificateCredential{}, nil)
mi.EXPECT().Environment().Return(&azureclient.AROEnvironment{})
},
tick: true,

12
pkg/util/mocks/env/env.go поставляемый
Просмотреть файл

@ -16,11 +16,6 @@ import (
net "net"
reflect "reflect"
env "github.com/Azure/ARO-RP/pkg/env"
azureclient "github.com/Azure/ARO-RP/pkg/util/azureclient"
clientauthorizer "github.com/Azure/ARO-RP/pkg/util/clientauthorizer"
keyvault "github.com/Azure/ARO-RP/pkg/util/keyvault"
liveconfig "github.com/Azure/ARO-RP/pkg/util/liveconfig"
azcore "github.com/Azure/azure-sdk-for-go/sdk/azcore"
arm "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
policy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
@ -29,13 +24,18 @@ import (
autorest "github.com/Azure/go-autorest/autorest"
logrus "github.com/sirupsen/logrus"
gomock "go.uber.org/mock/gomock"
env "github.com/Azure/ARO-RP/pkg/env"
azureclient "github.com/Azure/ARO-RP/pkg/util/azureclient"
clientauthorizer "github.com/Azure/ARO-RP/pkg/util/clientauthorizer"
keyvault "github.com/Azure/ARO-RP/pkg/util/keyvault"
liveconfig "github.com/Azure/ARO-RP/pkg/util/liveconfig"
)
// MockInterface is a mock of Interface interface.
type MockInterface struct {
ctrl *gomock.Controller
recorder *MockInterfaceMockRecorder
isgomock struct{}
}
// MockInterfaceMockRecorder is the mock recorder for MockInterface.