add mock in tests

This commit is contained in:
DmitryZagorulko 2018-04-20 17:59:26 +03:00
parent a0f74fcad8
commit b5d420b68e
3 changed files with 3200 additions and 332 deletions

View File

@ -19,8 +19,8 @@ func (f *Failure) ApiError() string {
func (f *Failure) ApiErrors() []string { func (f *Failure) ApiErrors() []string {
var errors []string var errors []string
for i := 0; i < len(f.ApiErrs); i++ { for k, i := range f.ApiErrs {
errors = append(errors, fmt.Sprintf("%v", f.ApiErrs[i])) errors = append(errors, fmt.Sprintf("%v: %v", k, i))
} }
return errors return errors

View File

@ -4,11 +4,11 @@ package errs
type Failure struct { type Failure struct {
RuntimeErr error RuntimeErr error
ApiErr string ApiErr string
ApiErrs []string ApiErrs map[string]string
} }
// FailureResponse convert json error response into object // FailureResponse convert json error response into object
type FailureResponse struct { type FailureResponse struct {
ErrorMsg string `json:"errorMsg,omitempty"` ErrorMsg string `json:"errorMsg,omitempty"`
Errors []string `json:"errors,omitempty"` Errors map[string]string `json:"errors,omitempty"`
} }

File diff suppressed because it is too large Load Diff