"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"io/ioutil"
- //"k8s.io/apimachinery/pkg/runtime"
- //"k8s.io/client-go/kubernetes/fake"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/client-go/kubernetes/fake"
"net/http"
"testing"
"time"
httpClientMock := &mocks.HttpClientMock{}
rmClient := clients.NewRoutingManagerClient(log, config, httpClientMock)
associationManager := NewE2TAssociationManager(log, rnibDataService, e2tInstancesManager, rmClient)
- //kubernetesManager := initKubernetesManagerTest(t)
+ kubernetesManager := initKubernetesManagerTest(t)
- /*shutdownManager := NewE2TShutdownManager(log, config, rnibDataService, e2tInstancesManager, associationManager, kubernetesManager)
+ shutdownManager := NewE2TShutdownManager(log, config, rnibDataService, e2tInstancesManager, associationManager, kubernetesManager)
- return shutdownManager, readerMock, writerMock, httpClientMock, kubernetesManager*/
- shutdownManager := NewE2TShutdownManager(log, config, rnibDataService, e2tInstancesManager, associationManager, nil)
-
- return shutdownManager, readerMock, writerMock, httpClientMock, nil
+ return shutdownManager, readerMock, writerMock, httpClientMock, kubernetesManager
}
func TestShutdownSuccess1OutOf3Instances(t *testing.T) {
readerMock.AssertExpectations(t)
writerMock.AssertExpectations(t)
httpClientMock.AssertExpectations(t)
-
+
}
func TestShutdownE2tInstanceAlreadyBeingDeleted(t *testing.T) {
readerMock.AssertExpectations(t)
writerMock.AssertExpectations(t)
httpClientMock.AssertExpectations(t)
-
+
}
func TestShutdownFailureMarkInstanceAsToBeDeleted(t *testing.T) {
readerMock.AssertExpectations(t)
writerMock.AssertExpectations(t)
httpClientMock.AssertExpectations(t)
-
+
}
func TestShutdownFailureRoutingManagerError(t *testing.T) {
readerMock.AssertExpectations(t)
writerMock.AssertExpectations(t)
httpClientMock.AssertExpectations(t)
-
+
}
func TestShutdownFailureInClearNodebsAssociation(t *testing.T) {
writerMock.AssertExpectations(t)
httpClientMock.AssertExpectations(t)
}
-/*
+
func TestShutdownSuccess2Instance2Rans(t *testing.T) {
shutdownManager, readerMock, writerMock, httpClientMock,kubernetesManager := initE2TShutdownManagerTest(t)
writerMock.AssertExpectations(t)
httpClientMock.AssertExpectations(t)
})
-}*/
\ No newline at end of file
+}
\ No newline at end of file