Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ubogdan committed Nov 2, 2021
1 parent 3aa2141 commit 640dfcf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions swagger_test.go
Expand Up @@ -111,6 +111,18 @@ func TestDisablingCustomWrapHandler(t *testing.T) {
assert.Equal(t, 404, w11.Code)
}

func TestNamedCustomWrapHandler(t *testing.T) {
router := gin.New()
gin.SetMode(gin.TestMode)

swag.Register("test", &mockedSwag{})

router.GET("/swagger/*any", CustomWrapHandler(&Config{InstanceName: "test"}, swaggerFiles.Handler))

w1 := performRequest("GET", "/swagger/doc.json", router)
assert.Equal(t, 200, w1.Code)
}

func TestWithGzipMiddleware(t *testing.T) {
gin.SetMode(gin.TestMode)
router := gin.New()
Expand Down

0 comments on commit 640dfcf

Please sign in to comment.