github.com/josephspurrier/go-swagger@v0.2.1-0.20221129144919-1f672a142a00/cmd/swagger/commands/generate/server_internal_test.go (about) 1 package generate 2 3 import ( 4 "bytes" 5 "log" 6 "os" 7 "testing" 8 9 "github.com/go-swagger/go-swagger/generator" 10 "github.com/stretchr/testify/assert" 11 ) 12 13 func TestDeprecated(t *testing.T) { 14 var buf bytes.Buffer 15 log.SetOutput(&buf) 16 defer log.SetOutput(os.Stdout) 17 s := Server{ 18 WithContext: true, 19 } 20 s.apply(new(generator.GenOpts)) 21 assert.Contains(t, buf.String(), "warning") 22 }