From 3aaab23e81e6eeb1022bed3d6970ec35bb03c91a Mon Sep 17 00:00:00 2001 From: Ian Eure Date: Mon, 13 Sep 2021 11:31:36 -0700 Subject: [PATCH] Fix broken tests. --- fixtures/epcis/epcisquery.src | 34 +++++++++++++++++----------------- gowsdl_test.go | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/fixtures/epcis/epcisquery.src b/fixtures/epcis/epcisquery.src index 795312b..f01f408 100644 --- a/fixtures/epcis/epcisquery.src +++ b/fixtures/epcis/epcisquery.src @@ -27,13 +27,13 @@ type Document struct { // The version of the schema corresponding to which the instance conforms. // - SchemaVersion float64 `xml:"schemaVersion,attr,omitempty" json:"schemaVersion,omitempty"` + SchemaVersion float64 `xml:"urn:epcglobal:xsd:1 schemaVersion,attr,omitempty" json:"schemaVersion,omitempty"` // // The date the message was created. Used for auditing and logging. // - CreationDate soap.XSDDateTime `xml:"creationDate,attr,omitempty" json:"creationDate,omitempty"` + CreationDate soap.XSDDateTime `xml:"urn:epcglobal:xsd:1 creationDate,attr,omitempty" json:"creationDate,omitempty"` } type EPC string @@ -132,25 +132,25 @@ type BusinessService struct { } type ServiceTransaction struct { - TypeOfServiceTransaction *TypeOfServiceTransaction `xml:"TypeOfServiceTransaction,attr,omitempty" json:"TypeOfServiceTransaction,omitempty"` + TypeOfServiceTransaction *TypeOfServiceTransaction `xml:"http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader TypeOfServiceTransaction,attr,omitempty" json:"TypeOfServiceTransaction,omitempty"` - IsNonRepudiationRequired string `xml:"IsNonRepudiationRequired,attr,omitempty" json:"IsNonRepudiationRequired,omitempty"` + IsNonRepudiationRequired string `xml:"http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader IsNonRepudiationRequired,attr,omitempty" json:"IsNonRepudiationRequired,omitempty"` - IsAuthenticationRequired string `xml:"IsAuthenticationRequired,attr,omitempty" json:"IsAuthenticationRequired,omitempty"` + IsAuthenticationRequired string `xml:"http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader IsAuthenticationRequired,attr,omitempty" json:"IsAuthenticationRequired,omitempty"` - IsNonRepudiationOfReceiptRequired string `xml:"IsNonRepudiationOfReceiptRequired,attr,omitempty" json:"IsNonRepudiationOfReceiptRequired,omitempty"` + IsNonRepudiationOfReceiptRequired string `xml:"http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader IsNonRepudiationOfReceiptRequired,attr,omitempty" json:"IsNonRepudiationOfReceiptRequired,omitempty"` - IsIntegrityCheckRequired string `xml:"IsIntegrityCheckRequired,attr,omitempty" json:"IsIntegrityCheckRequired,omitempty"` + IsIntegrityCheckRequired string `xml:"http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader IsIntegrityCheckRequired,attr,omitempty" json:"IsIntegrityCheckRequired,omitempty"` - IsApplicationErrorResponseRequested string `xml:"IsApplicationErrorResponseRequested,attr,omitempty" json:"IsApplicationErrorResponseRequested,omitempty"` + IsApplicationErrorResponseRequested string `xml:"http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader IsApplicationErrorResponseRequested,attr,omitempty" json:"IsApplicationErrorResponseRequested,omitempty"` - TimeToAcknowledgeReceipt string `xml:"TimeToAcknowledgeReceipt,attr,omitempty" json:"TimeToAcknowledgeReceipt,omitempty"` + TimeToAcknowledgeReceipt string `xml:"http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader TimeToAcknowledgeReceipt,attr,omitempty" json:"TimeToAcknowledgeReceipt,omitempty"` - TimeToAcknowledgeAcceptance string `xml:"TimeToAcknowledgeAcceptance,attr,omitempty" json:"TimeToAcknowledgeAcceptance,omitempty"` + TimeToAcknowledgeAcceptance string `xml:"http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader TimeToAcknowledgeAcceptance,attr,omitempty" json:"TimeToAcknowledgeAcceptance,omitempty"` - TimeToPerform string `xml:"TimeToPerform,attr,omitempty" json:"TimeToPerform,omitempty"` + TimeToPerform string `xml:"http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader TimeToPerform,attr,omitempty" json:"TimeToPerform,omitempty"` - Recurrence string `xml:"Recurrence,attr,omitempty" json:"Recurrence,omitempty"` + Recurrence string `xml:"http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader Recurrence,attr,omitempty" json:"Recurrence,omitempty"` } type StandardBusinessDocumentHeader struct { @@ -268,7 +268,7 @@ type VocabularyType struct { Items []string `xml:",any" json:"items,omitempty"` - Type AnyURI `xml:"type,attr,omitempty" json:"type,omitempty"` + Type AnyURI `xml:"urn:epcglobal:epcis:xsd:1 type,attr,omitempty" json:"type,omitempty"` } type VocabularyElementListType struct { @@ -284,13 +284,13 @@ type VocabularyElementType struct { Items []string `xml:",any" json:"items,omitempty"` - Id AnyURI `xml:"id,attr,omitempty" json:"id,omitempty"` + Id AnyURI `xml:"urn:epcglobal:epcis:xsd:1 id,attr,omitempty" json:"id,omitempty"` } type AttributeType struct { AnyType - Id AnyURI `xml:"id,attr,omitempty" json:"id,omitempty"` + Id AnyURI `xml:"urn:epcglobal:epcis:xsd:1 id,attr,omitempty" json:"id,omitempty"` } type IDListType struct { @@ -378,7 +378,7 @@ type BusinessLocationExtensionType struct { type BusinessTransactionType struct { Value *BusinessTransactionIDType `xml:",chardata" json:"-,"` - Type *BusinessTransactionTypeIDType `xml:"type,attr,omitempty" json:"type,omitempty"` + Type *BusinessTransactionTypeIDType `xml:"urn:epcglobal:epcis:xsd:1 type,attr,omitempty" json:"type,omitempty"` } type BusinessTransactionListType struct { @@ -388,7 +388,7 @@ type BusinessTransactionListType struct { type SourceDestType struct { Value *SourceDestIDType `xml:",chardata" json:"-,"` - Type *SourceDestTypeIDType `xml:"type,attr,omitempty" json:"type,omitempty"` + Type *SourceDestTypeIDType `xml:"urn:epcglobal:epcis:xsd:1 type,attr,omitempty" json:"type,omitempty"` } type SourceListType struct { diff --git a/gowsdl_test.go b/gowsdl_test.go index 5b3d45d..f3b238c 100644 --- a/gowsdl_test.go +++ b/gowsdl_test.go @@ -83,10 +83,10 @@ func TestAttributeRef(t *testing.T) { Status []struct { Value string ` + "`" + `xml:",chardata" json:"-,"` + "`" + ` - Code string ` + "`" + `xml:"code,attr,omitempty" json:"code,omitempty"` + "`" + ` + Code string ` + "`" + `xml:"http://www.mnb.hu/webservices/ code,attr,omitempty" json:"code,omitempty"` + "`" + ` } ` + "`" + `xml:"status,omitempty" json:"status,omitempty"` + "`" + ` - ResponseCode string ` + "`" + `xml:"responseCode,attr,omitempty" json:"responseCode,omitempty"` + "`" + ` + ResponseCode string ` + "`" + `xml:"http://www.mnb.hu/webservices/ responseCode,attr,omitempty" json:"responseCode,omitempty"` + "`" + ` }` actual = string(bytes.ReplaceAll([]byte(actual), []byte("\t"), []byte(" "))) expected = string(bytes.ReplaceAll([]byte(expected), []byte("\t"), []byte(" ")))