[MM-53269] Add configuration setting for integration requests timeout (#23805)
Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7874daa6f7
Коммит
1fdddfe678
@@ -74,6 +74,47 @@ func TestConfigEmptySiteName(t *testing.T) {
|
||||
require.Equal(t, *c1.TeamSettings.SiteName, TeamSettingsDefaultSiteName)
|
||||
}
|
||||
|
||||
func TestServiceSettingsIsValid(t *testing.T) {
|
||||
for name, test := range map[string]struct {
|
||||
ServiceSettings ServiceSettings
|
||||
ExpectError bool
|
||||
}{
|
||||
"empty": {
|
||||
ServiceSettings: ServiceSettings{},
|
||||
ExpectError: false,
|
||||
},
|
||||
"OutgoingIntegrationRequestsTimeout is negative": {
|
||||
ServiceSettings: ServiceSettings{
|
||||
OutgoingIntegrationRequestsTimeout: NewInt64(-1),
|
||||
},
|
||||
ExpectError: true,
|
||||
},
|
||||
"OutgoingIntegrationRequestsTimeout is zero": {
|
||||
ServiceSettings: ServiceSettings{
|
||||
OutgoingIntegrationRequestsTimeout: NewInt64(0),
|
||||
},
|
||||
ExpectError: true,
|
||||
},
|
||||
"OutgoingIntegrationRequestsTimeout is positiv": {
|
||||
ServiceSettings: ServiceSettings{
|
||||
OutgoingIntegrationRequestsTimeout: NewInt64(1),
|
||||
},
|
||||
ExpectError: false,
|
||||
},
|
||||
} {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
test.ServiceSettings.SetDefaults(false)
|
||||
|
||||
appErr := test.ServiceSettings.isValid()
|
||||
if test.ExpectError {
|
||||
assert.NotNil(t, appErr)
|
||||
} else {
|
||||
assert.Nil(t, appErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigEnableDeveloper(t *testing.T) {
|
||||
testCases := []struct {
|
||||
Description string
|
||||
|
||||
Ссылка в новой задаче
Block a user