-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1585e48
commit 643102d
Showing
3 changed files
with
62 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package consumer | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/free5gc/openapi" | ||
"github.com/free5gc/openapi/models" | ||
"github.com/h2non/gock" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestSendRegisterNFInstance(t *testing.T) { | ||
defer gock.Off() // Flush pending mocks after test execution | ||
|
||
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). | ||
JSON(map[string]string{}) | ||
|
||
_, _, err := SendRegisterNFInstance("http://127.0.0.10:8000", "1", models.NfProfile{}) | ||
require.NoError(t, err) | ||
} |