Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Release v1.0.0 #17

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
command cryptic transformer correction, fix tests
smgladkovskiy committed Apr 22, 2019
commit 338d0486e3337e8a3027ee654dda470ecc35da06
5 changes: 4 additions & 1 deletion service/99_information.go
Original file line number Diff line number Diff line change
@@ -28,9 +28,12 @@ func (s *service) CommandCryptic(msg string) (*commandCryptic.Response, error) {
q := &CommandCryptic_v07_3.Request{
MessageAction: &CommandCryptic_v07_3.MessageAction{
MessageFunctionDetails: &CommandCryptic_v07_3.MessageFunctionDetails{
MessageFunction: msg,
MessageFunction: "F18",
},
},
LongTextString: &CommandCryptic_v07_3.LongTextString{
TextStringDetails: msg,
},
}
resp, err := s.sdk.CommandCrypticV073(q)
if err != nil {
8 changes: 1 addition & 7 deletions service/service_test.go
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ import (

"github.com/stretchr/testify/assert"

"github.com/tmconsulting/amadeus-golang-sdk/logger"
"github.com/tmconsulting/amadeus-golang-sdk/logger/stdoutLogger"
"github.com/tmconsulting/amadeus-golang-sdk/sdk"
)
@@ -20,7 +19,6 @@ var (
originator string
passwordRaw string
officeId string
l logger.Service
)

func tearUp() {
@@ -35,10 +33,6 @@ func tearUp() {
officeId = os.Getenv("OFFICE_ID")

log.Printf("url: %s\noriginator: %s\npasswordRaw: %s\nofficeId: %s", url, originator, passwordRaw, officeId)

ls := stdoutLogger.Init()
l = logger.NewLogger(ls)

}

func TestMain(m *testing.M) {
@@ -57,7 +51,7 @@ func TestNewSKD(t *testing.T) {
if !assert.NoError(t, err) {
t.FailNow()
}
fmt.Printf("response: %v\n", response)
fmt.Printf("response: %v\n", response.LongTextString)

fmt.Printf("error: %v\n", err)
})
16 changes: 10 additions & 6 deletions structs/commandCryptic/v07.3/reply.go
Original file line number Diff line number Diff line change
@@ -19,15 +19,19 @@ type LongTextString struct {
}

func (r *Response) ToCommon() *commandCryptic.Response {
return &commandCryptic.Response{
MessageActionDetails: &commandCryptic.MessageActionDetails{
MessageFunctionDetails: &commandCryptic.MessageFunctionDetails{
mad := &commandCryptic.MessageActionDetails{}
if r.MessageActionDetails != nil {
if r.MessageActionDetails.MessageFunctionDetails != nil {
mad.MessageFunctionDetails = &commandCryptic.MessageFunctionDetails{
BusinessFunction: r.MessageActionDetails.MessageFunctionDetails.BusinessFunction,
MessageFunction: r.MessageActionDetails.MessageFunctionDetails.MessageFunction,
AdditionalMessageFunction: r.MessageActionDetails.MessageFunctionDetails.AdditionalMessageFunction,
},
ResponseType: r.MessageActionDetails.ResponseType,
},
}
mad.ResponseType = r.MessageActionDetails.ResponseType
}
}
return &commandCryptic.Response{
MessageActionDetails: mad,
LongTextString: &commandCryptic.LongTextString{
TextStringDetails: r.LongTextString.TextStringDetails,
},
2 changes: 1 addition & 1 deletion test.env-example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
URL=https://nodeD1.test.webservices.amadeus.com/1ASIWXXXXXX
ORIGINATOR=WSBENXXX
PASSWORD_RAW=dGhlIHBhc3N3b3Jk // **base 64 encoded** password
PASSWORD_RAW=dGhlIHBhc3N3b3Jk # NOT **base 64 encoded** password
OFFICE_ID=BRUXX1111