Skip to content

Commit

Permalink
fix: update openapi and test
Browse files Browse the repository at this point in the history
  • Loading branch information
andy89923 committed Jul 18, 2024
1 parent a245614 commit 12b45f5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/fclairamb/ftpserverlib v0.21.0
github.com/fclairamb/go-log v0.4.1
github.com/fiorix/go-diameter v3.0.2+incompatible
github.com/free5gc/openapi v1.0.9-0.20240424093716-bda9387bb300
github.com/free5gc/openapi v1.0.9-0.20240718052200-b2c88deed178
github.com/free5gc/util v1.0.6
github.com/gin-gonic/gin v1.9.1
github.com/google/uuid v1.3.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVB
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
github.com/free5gc/openapi v1.0.9-0.20240424093716-bda9387bb300 h1:zFEzWpBN2gLaepRVVhVeosUcrux7tVk41+Q0XHNWJXg=
github.com/free5gc/openapi v1.0.9-0.20240424093716-bda9387bb300/go.mod h1:oy68rqnHakRLUCuEOXcis7/PWGBuil+UaXMeTBeYY8Y=
github.com/free5gc/openapi v1.0.9-0.20240718052200-b2c88deed178 h1:3b4s2RopI0eodagRIIJN3Uu4k+gA3oIULYOZCijhRRU=
github.com/free5gc/openapi v1.0.9-0.20240718052200-b2c88deed178/go.mod h1:oy68rqnHakRLUCuEOXcis7/PWGBuil+UaXMeTBeYY8Y=
github.com/free5gc/util v1.0.6 h1:dBt9drcXtYKE/cY5XuQcuffgsYclPIpIArhSeS6M+DQ=
github.com/free5gc/util v1.0.6/go.mod h1:eSGN7POUM8LNTvg/E591XR6447a6/w1jFWGKNZPHcXw=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
Expand Down
4 changes: 3 additions & 1 deletion internal/sbi/consumer/nrf_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ func (s *nnrfService) getNFDiscClient(uri string) *Nnrf_NFDiscovery.APIClient {
}

func (s *nnrfService) SendSearchNFInstances(
nrfUri string, targetNfType, requestNfType models.NfType, param Nnrf_NFDiscovery.SearchNFInstancesRequest,
nrfUri string, targetNfType,
requestNfType models.NrfNfManagementNfType,
param Nnrf_NFDiscovery.SearchNFInstancesRequest,
) (
*models.SearchResult, error,
) {
Expand Down
19 changes: 7 additions & 12 deletions internal/sbi/consumer/nrf_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ import (
func Test_nnrfService_RegisterNFInstance(t *testing.T) {
defer gock.Off() // Flush pending mocks after test execution

// gock.InterceptClient(openapi.GetHttpClient())
// defer gock.RestoreClient(openapi.GetHttpClient())

openapi.InterceptH2CClient()
defer openapi.RestoreH2CClient()
gock.InterceptClient(openapi.GetHttpClient())
defer gock.RestoreClient(openapi.GetHttpClient())

gock.New("http://127.0.0.10:8000").
Put("/nnrf-nfm/v1/nf-instances/1").
Reply(200).
Reply(201).
JSON(map[string]string{})

ctrl := gomock.NewController(t)
Expand All @@ -47,14 +44,12 @@ func Test_nnrfService_RegisterNFInstance(t *testing.T) {
func Test_nnrfService_SendDeregisterNFInstance(t *testing.T) {
defer gock.Off() // Flush pending mocks after test execution

// gock.InterceptClient(openapi.GetHttpClient())
// defer gock.RestoreClient(openapi.GetHttpClient())
openapi.InterceptH2CClient()
defer openapi.RestoreH2CClient()
gock.InterceptClient(openapi.GetHttpClient())
defer gock.RestoreClient(openapi.GetHttpClient())

gock.New("http://127.0.0.10:8000").
Put("/nnrf-nfm/v1/nf-instances/1").
Reply(200).
Delete("/nnrf-nfm/v1/nf-instances/1").
Reply(204).
JSON(map[string]string{})

ctrl := gomock.NewController(t)
Expand Down

0 comments on commit 12b45f5

Please sign in to comment.