- e2tInstancesManagerMock.On("GetE2TInstance", e2tInstanceAddress).Return(e2tInstance, common.NewResourceNotFoundError("not found"))
- e2tInstance = entities.NewE2TInstance(e2tInstanceAddress)
- e2tInstancesManagerMock.On("AddE2TInstance", e2tInstanceAddress).Return(nil)
- routingManagerClient.On("AddE2TInstance", e2tInstanceAddress).Return(nil)
+
+ readerMock.On("GetE2TInstance", e2tInstanceAddress).Return(e2tInstance, common.NewResourceNotFoundError("not found"))
+ writerMock.On("SaveE2TInstance", mock.Anything).Return(nil)
+
+ respBody := ioutil.NopCloser(bytes.NewBufferString(""))
+ url := config.RoutingManager.BaseUrl + clients.AddE2TInstanceApiSuffix
+ httpClientMock.On("Post", url, mock.Anything, mock.Anything).Return(&http.Response{StatusCode: http.StatusCreated, Body: respBody}, nil)
+
+ e2tAddresses := []string{}
+ readerMock.On("GetE2TAddresses").Return(e2tAddresses, common.NewResourceNotFoundError(""))
+
+ e2tAddresses = append(e2tAddresses, e2tInstanceAddress)
+ writerMock.On("SaveE2TAddresses", e2tAddresses).Return(nil)
+