Remove FromJSON functions (Part 1) (#17961)

* Remove FromJSON functions (Part 1)

```release-note
Removed the following functions:
AccessDataFromJson
AccessResponseFromJson
AnalyticsRowFromJson
AnalyticsRowsFromJson
AuditFromJson
AuditsFromJson
AuthDataFromJson
AuthorizeRequestFromJson
BotFromJson
BotPatchFromJson
BotListFromJson
```

* fix tests

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2021-07-21 14:17:08 +05:30
коммит произвёл Claudio Costa
родитель 7454680be5
Коммит e199eba313
17 изменённых файлов: 190 добавлений и 380 удалений

Просмотреть файл

@@ -4,32 +4,11 @@
package model
import (
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestAuthJson(t *testing.T) {
a1 := AuthData{}
a1.ClientId = NewId()
a1.UserId = NewId()
a1.Code = NewId()
json := a1.ToJson()
ra1 := AuthDataFromJson(strings.NewReader(json))
require.Equal(t, a1.Code, ra1.Code, "codes didn't match")
a2 := AuthorizeRequest{}
a2.ClientId = NewId()
a2.Scope = NewId()
json = a2.ToJson()
ra2 := AuthorizeRequestFromJson(strings.NewReader(json))
require.Equal(t, a2.ClientId, ra2.ClientId, "client ids didn't match")
}
func TestAuthPreSave(t *testing.T) {
a1 := AuthData{}
a1.ClientId = NewId()