summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
b2e5e2b)
Change-Id: If4049bebc9be63d676d65c1ca365e0a47761df61
Signed-off-by: irina <ib565x@intl.att.com>
rogress.go
Change-Id: I44d07fcb068bfb346baf4388936f8ebc481107fa
Signed-off-by: irina <ib565x@intl.att.com>
12 files changed:
switch err.(type) {
case *e2managererrors.RnibDbError:
e2Error, _ := err.(*e2managererrors.RnibDbError)
switch err.(type) {
case *e2managererrors.RnibDbError:
e2Error, _ := err.(*e2managererrors.RnibDbError)
- errorResponseDetails = models.ErrorResponse{Code: e2Error.Err.Code, Message: e2Error.Err.Message}
+ errorResponseDetails = models.ErrorResponse{Code: e2Error.Code, Message: e2Error.Message}
httpError = http.StatusInternalServerError
case *e2managererrors.CommandAlreadyInProgressError:
e2Error, _ := err.(*e2managererrors.CommandAlreadyInProgressError)
httpError = http.StatusInternalServerError
case *e2managererrors.CommandAlreadyInProgressError:
e2Error, _ := err.(*e2managererrors.CommandAlreadyInProgressError)
- errorResponseDetails = models.ErrorResponse{Code: e2Error.Err.Code, Message: e2Error.Err.Message}
+ errorResponseDetails = models.ErrorResponse{Code: e2Error.Code, Message: e2Error.Message}
httpError = http.StatusMethodNotAllowed
case *e2managererrors.HeaderValidationError:
e2Error, _ := err.(*e2managererrors.HeaderValidationError)
httpError = http.StatusMethodNotAllowed
case *e2managererrors.HeaderValidationError:
e2Error, _ := err.(*e2managererrors.HeaderValidationError)
- errorResponseDetails = models.ErrorResponse{Code: e2Error.Err.Code, Message: e2Error.Err.Message}
+ errorResponseDetails = models.ErrorResponse{Code: e2Error.Code, Message: e2Error.Message}
httpError = http.StatusUnsupportedMediaType
case *e2managererrors.WrongStateError:
e2Error, _ := err.(*e2managererrors.WrongStateError)
httpError = http.StatusUnsupportedMediaType
case *e2managererrors.WrongStateError:
e2Error, _ := err.(*e2managererrors.WrongStateError)
- errorResponseDetails = models.ErrorResponse{Code: e2Error.Err.Code, Message: e2Error.Err.Message}
+ errorResponseDetails = models.ErrorResponse{Code: e2Error.Code, Message: e2Error.Message}
httpError = http.StatusBadRequest
case *e2managererrors.RequestValidationError:
e2Error, _ := err.(*e2managererrors.RequestValidationError)
httpError = http.StatusBadRequest
case *e2managererrors.RequestValidationError:
e2Error, _ := err.(*e2managererrors.RequestValidationError)
- errorResponseDetails = models.ErrorResponse{Code: e2Error.Err.Code, Message: e2Error.Err.Message}
+ errorResponseDetails = models.ErrorResponse{Code: e2Error.Code, Message: e2Error.Message}
httpError = http.StatusBadRequest
case *e2managererrors.InvalidJsonError:
e2Error, _ := err.(*e2managererrors.InvalidJsonError)
httpError = http.StatusBadRequest
case *e2managererrors.InvalidJsonError:
e2Error, _ := err.(*e2managererrors.InvalidJsonError)
- errorResponseDetails = models.ErrorResponse{Code: e2Error.Err.Code, Message: e2Error.Err.Message}
+ errorResponseDetails = models.ErrorResponse{Code: e2Error.Code, Message: e2Error.Message}
httpError = http.StatusBadRequest
case *e2managererrors.RmrError:
e2Error, _ := err.(*e2managererrors.RmrError)
httpError = http.StatusBadRequest
case *e2managererrors.RmrError:
e2Error, _ := err.(*e2managererrors.RmrError)
- errorResponseDetails = models.ErrorResponse{Code: e2Error.Err.Code, Message: e2Error.Err.Message}
+ errorResponseDetails = models.ErrorResponse{Code: e2Error.Code, Message: e2Error.Message}
httpError = http.StatusInternalServerError
case *e2managererrors.ResourceNotFoundError:
e2Error, _ := err.(*e2managererrors.ResourceNotFoundError)
httpError = http.StatusInternalServerError
case *e2managererrors.ResourceNotFoundError:
e2Error, _ := err.(*e2managererrors.ResourceNotFoundError)
- errorResponseDetails = models.ErrorResponse{Code: e2Error.Err.Code, Message: e2Error.Err.Message}
+ errorResponseDetails = models.ErrorResponse{Code: e2Error.Code, Message: e2Error.Message}
httpError = http.StatusNotFound
default:
e2Error := e2managererrors.NewInternalError()
httpError = http.StatusNotFound
default:
e2Error := e2managererrors.NewInternalError()
- errorResponseDetails = models.ErrorResponse{Code: e2Error.Err.Code, Message: e2Error.Err.Message}
+ errorResponseDetails = models.ErrorResponse{Code: e2Error.Code, Message: e2Error.Message}
httpError = http.StatusInternalServerError
}
}
httpError = http.StatusInternalServerError
}
}
var errorResponse = parseJsonRequest(t, writer.Body)
assert.Equal(t, http.StatusInternalServerError, writer.Result().StatusCode)
var errorResponse = parseJsonRequest(t, writer.Body)
assert.Equal(t, http.StatusInternalServerError, writer.Result().StatusCode)
- assert.Equal(t, errorResponse.Code, e2managererrors.NewRnibDbError().Err.Code)
+ assert.Equal(t, errorResponse.Code, e2managererrors.NewRnibDbError().Code)
}
func TestHeaderValidationFailed(t *testing.T) {
}
func TestHeaderValidationFailed(t *testing.T) {
err := e2managererrors.NewHeaderValidationError()
assert.Equal(t, http.StatusUnsupportedMediaType, writer.Result().StatusCode)
err := e2managererrors.NewHeaderValidationError()
assert.Equal(t, http.StatusUnsupportedMediaType, writer.Result().StatusCode)
- assert.Equal(t, errorResponse.Code, err.Err.Code)
- assert.Equal(t, errorResponse.Message, err.Err.Message)
+ assert.Equal(t, errorResponse.Code, err.Code)
+ assert.Equal(t, errorResponse.Message, err.Message)
}
func TestShutdownStatusNoContent(t *testing.T) {
}
func TestShutdownStatusNoContent(t *testing.T) {
var errorResponse = parseJsonRequest(t, writer.Body)
assert.Equal(t, http.StatusInternalServerError, writer.Result().StatusCode)
var errorResponse = parseJsonRequest(t, writer.Body)
assert.Equal(t, http.StatusInternalServerError, writer.Result().StatusCode)
- assert.Equal(t, errorResponse.Code, err.Err.Code)
- assert.Equal(t, errorResponse.Message, err.Err.Message)
+ assert.Equal(t, errorResponse.Code, err.Code)
+ assert.Equal(t, errorResponse.Message, err.Message)
}
func TestHandleCommandAlreadyInProgressError(t *testing.T) {
}
func TestHandleCommandAlreadyInProgressError(t *testing.T) {
var errorResponse = parseJsonRequest(t, writer.Body)
assert.Equal(t, http.StatusMethodNotAllowed, writer.Result().StatusCode)
var errorResponse = parseJsonRequest(t, writer.Body)
assert.Equal(t, http.StatusMethodNotAllowed, writer.Result().StatusCode)
- assert.Equal(t, errorResponse.Code, err.Err.Code)
- assert.Equal(t, errorResponse.Message, err.Err.Message)
+ assert.Equal(t, errorResponse.Code, err.Code)
+ assert.Equal(t, errorResponse.Message, err.Message)
}
func TestValidateHeaders(t *testing.T) {
}
func TestValidateHeaders(t *testing.T) {
package e2managererrors
type CommandAlreadyInProgressError struct {
package e2managererrors
type CommandAlreadyInProgressError struct {
}
func NewCommandAlreadyInProgressError() *CommandAlreadyInProgressError {
return &CommandAlreadyInProgressError {
}
func NewCommandAlreadyInProgressError() *CommandAlreadyInProgressError {
return &CommandAlreadyInProgressError {
Code: 405,
Message: "Command already in progress",
},
Code: 405,
Message: "Command already in progress",
},
}
func (e *CommandAlreadyInProgressError) Error() string {
}
func (e *CommandAlreadyInProgressError) Error() string {
package e2managererrors
type HeaderValidationError struct {
package e2managererrors
type HeaderValidationError struct {
}
func NewHeaderValidationError() *HeaderValidationError {
return &HeaderValidationError {
}
func NewHeaderValidationError() *HeaderValidationError {
return &HeaderValidationError {
Code: 415,
Message: "Header validation error",
},
Code: 415,
Message: "Header validation error",
},
}
func (e *HeaderValidationError) Error() string {
}
func (e *HeaderValidationError) Error() string {
package e2managererrors
type InternalError struct {
package e2managererrors
type InternalError struct {
}
func NewInternalError() *InternalError {
return &InternalError {
}
func NewInternalError() *InternalError {
return &InternalError {
Code: 501,
Message: "Internal Server Error. Please try again later",
},
Code: 501,
Message: "Internal Server Error. Please try again later",
},
}
func (e *InternalError) Error() string {
}
func (e *InternalError) Error() string {
type InvalidJsonError struct {
type InvalidJsonError struct {
}
func NewInvalidJsonError() *InvalidJsonError {
return &InvalidJsonError{
}
func NewInvalidJsonError() *InvalidJsonError {
return &InvalidJsonError{
Code: 401,
Message: "corrupted json",
},
Code: 401,
Message: "corrupted json",
},
}
func (e *InvalidJsonError) Error() string {
}
func (e *InvalidJsonError) Error() string {
package e2managererrors
type RequestValidationError struct {
package e2managererrors
type RequestValidationError struct {
}
func NewRequestValidationError() *RequestValidationError {
return &RequestValidationError{
}
func NewRequestValidationError() *RequestValidationError {
return &RequestValidationError{
Code: 402,
Message: "Validation error",
},
Code: 402,
Message: "Validation error",
},
}
func (e *RequestValidationError) Error() string {
}
func (e *RequestValidationError) Error() string {
package e2managererrors
type ResourceNotFoundError struct {
package e2managererrors
type ResourceNotFoundError struct {
}
func NewResourceNotFoundError() *ResourceNotFoundError {
return &ResourceNotFoundError{
}
func NewResourceNotFoundError() *ResourceNotFoundError {
return &ResourceNotFoundError{
Code: 404,
Message: "Resource not found",
},
Code: 404,
Message: "Resource not found",
},
}
func (e *ResourceNotFoundError) Error() string {
}
func (e *ResourceNotFoundError) Error() string {
package e2managererrors
type RmrError struct {
package e2managererrors
type RmrError struct {
}
func NewRmrError() *RmrError {
return &RmrError{
}
func NewRmrError() *RmrError {
return &RmrError{
Code: 502,
Message: "RMR error",
},
Code: 502,
Message: "RMR error",
},
}
func (e *RmrError) Error() string {
}
func (e *RmrError) Error() string {
package e2managererrors
type RnibDbError struct {
package e2managererrors
type RnibDbError struct {
}
func NewRnibDbError() *RnibDbError {
return &RnibDbError {
}
func NewRnibDbError() *RnibDbError {
return &RnibDbError {
Code: 500,
Message: "RNIB error",
},
Code: 500,
Message: "RNIB error",
},
}
func (e *RnibDbError) Error() string {
}
func (e *RnibDbError) Error() string {
}
\ No newline at end of file
}
\ No newline at end of file
import "fmt"
type WrongStateError struct {
import "fmt"
type WrongStateError struct {
}
func NewWrongStateError(activityName string, state string) *WrongStateError {
return &WrongStateError{
}
func NewWrongStateError(activityName string, state string) *WrongStateError {
return &WrongStateError{
Code: 403,
Message: fmt.Sprintf("Activity <%s> rejected. RAN current state <%s> does not allow its execution ", activityName, state) ,
},
Code: 403,
Message: fmt.Sprintf("Activity <%s> rejected. RAN current state <%s> does not allow its execution ", activityName, state) ,
},
}
func (e *WrongStateError) Error() string {
}
func (e *WrongStateError) Error() string {
t.Errorf("want: error, got: success.\n")
}
t.Errorf("want: error, got: success.\n")
}
- expected := "#x2_reset_known_causes_test.TestPrepareX2ResetPDUsFailure - failed to build and pack the reset message #src/asn1codec_utils.c.pack_pdu_aux - Encoded output of E2AP-PDU, is too big:"
+ expected := "#x2_reset_known_causes.prepareX2ResetPDUs - failed to build and pack the reset message #src/asn1codec_utils.c.pack_pdu_aux - Encoded output of E2AP-PDU, is too big:"
if !strings.Contains(err.Error(), expected) {
t.Errorf("want :[%s], got: [%s]\n", expected, err)
}
if !strings.Contains(err.Error(), expected) {
t.Errorf("want :[%s], got: [%s]\n", expected, err)
}