Repository: moov-io/ach
Pull request #145 (2017-10-31 18:24:24)

ReturnAddenda -> AddendaReturn
Files should have been a part of #144


Patch:
diff --git a/addenda.go b/addenda.go
index f236238f..56afa50c 100644
--- a/addenda.go
+++ b/addenda.go
@@ -65,7 +65,7 @@ func NewAddenda(params ...AddendaParam) (Addendumer, error) {
 		case "98":
 			return NewAddendaNOC(params[0]), nil
 		case "99":
-			return NewReturnAddenda(params[0]), nil
+			return NewAddendaReturn(params[0]), nil
 		default:
 			msg := fmt.Sprintf("Addenda Type Code %v is not supported", typeCode)
 			return nil, &FileError{FieldName: "TypeCode", Msg: msg}
diff --git a/addendaReturn.go b/addendaReturn.go
index 75ba91ae..bc09bbd8 100644
--- a/addendaReturn.go
+++ b/addendaReturn.go
@@ -18,7 +18,7 @@ var (
 	returnCodeDict = map[string]*returnCode{}
 
 	// Error messages specific to Return Addenda
-	msgReturnAddendaReturnCode = "found is not a valid return code"
+	msgAddendaReturnReturnCode = "found is not a valid return code"
 )
 
 func init() {
@@ -26,8 +26,8 @@ func init() {
 	returnCodeDict = makeReturnCodeDict()
 }
 
-// ReturnAddenda utilized for Notification of Change Entry (COR) and Return types.
-type ReturnAddenda struct {
+// AddendaReturn utilized for Notification of Change Entry (COR) and Return types.
+type AddendaReturn struct {
 	// RecordType defines the type of record in the block. entryAddendaPos 7
 	recordType string
 	// TypeCode Addenda types code '99'
@@ -61,106 +61,106 @@ type returnCode struct {
 	Code, Reason, Description string
 }
 
-// NewReturnAddenda returns a new ReturnAddenda with default values for none exported fields
-func NewReturnAddenda(params ...AddendaParam) *ReturnAddenda {
-	rAddenda := &ReturnAddenda{
+// NewAddendaReturn returns a new AddendaReturn with default values for none exported fields
+func NewAddendaReturn(params ...AddendaParam) *AddendaReturn {
+	addendaReturn := &AddendaReturn{
 		recordType: "7",
 		typeCode:   "99",
 	}
 	if len(params) > 0 {
-		rAddenda.ReturnCode = params[0].ReturnCode
-		rAddenda.OriginalTrace = rAddenda.parseNumField(params[0].OriginalTrace)
-		rAddenda.OriginalDFI = rAddenda.parseNumField(params[0].OriginalDFI)
-		rAddenda.AddendaInformation = params[0].AddendaInfo
-		rAddenda.TraceNumber = rAddenda.parseNumField(params[0].TraceNumber)
+		addendaReturn.ReturnCode = params[0].ReturnCode
+		addendaReturn.OriginalTrace = addendaReturn.parseNumField(params[0].OriginalTrace)
+		addendaReturn.OriginalDFI = addendaReturn.parseNumField(params[0].OriginalDFI)
+		addendaReturn.AddendaInformation = params[0].AddendaInfo
+		addendaReturn.TraceNumber = addendaReturn.parseNumField(params[0].TraceNumber)
 	}
-	return rAddenda
+	return addendaReturn
 }
 
-// Parse takes the input record string and parses the ReturnAddenda values
-func (returnAddenda *ReturnAddenda) Parse(record string) {
+// Parse takes the input record string and parses the AddendaReturn values
+func (addendaReturn *AddendaReturn) Parse(record string) {
 	// 1-1 Always "7"
-	returnAddenda.recordType = "7"
+	addendaReturn.recordType = "7"
 	// 2-3 Defines the specific explanation and format for the addenda information contained in the same record
-	returnAddenda.typeCode = record[1:3]
+	addendaReturn.typeCode = record[1:3]
 	// 4-6
-	returnAddenda.ReturnCode = record[3:6]
+	addendaReturn.ReturnCode = record[3:6]
 	// 7-21
-	returnAddenda.OriginalTrace = returnAddenda.parseNumField(record[6:21])
+	addendaReturn.OriginalTrace = addendaReturn.parseNumField(record[6:21])
 	// 22-27, might be a date or blank
-	returnAddenda.DateOfDeath = returnAddenda.parseSimpleDate(record[21:27])
+	addendaReturn.DateOfDeath = addendaReturn.parseSimpleDate(record[21:27])
 	// 28-35
-	returnAddenda.OriginalDFI = returnAddenda.parseNumField(record[27:35])
+	addendaReturn.OriginalDFI = addendaReturn.parseNumField(record[27:35])
 	// 36-79
-	returnAddenda.AddendaInformation = strings.TrimSpace(record[35:79])
+	addendaReturn.AddendaInformation = strings.TrimSpace(record[35:79])
 	// 80-94
-	returnAddenda.TraceNumber = returnAddenda.parseNumField(record[79:94])
+	addendaReturn.TraceNumber = addendaReturn.parseNumField(record[79:94])
 }
 
-// String writes the ReturnAddenda struct to a 94 character string
-func (returnAddenda *ReturnAddenda) String() string {
+// String writes the AddendaReturn struct to a 94 character string
+func (addendaReturn *AddendaReturn) String() string {
 	return fmt.Sprintf("%v%v%v%v%v%v%v%v",
-		returnAddenda.recordType,
-		returnAddenda.TypeCode(),
-		returnAddenda.ReturnCode,
-		returnAddenda.OriginalTraceField(),
-		returnAddenda.DateOfDeathField(),
-		returnAddenda.OriginalDFIField(),
-		returnAddenda.AddendaInformationField(),
-		returnAddenda.TraceNumberField(),
+		addendaReturn.recordType,
+		addendaReturn.TypeCode(),
+		addendaReturn.ReturnCode,
+		addendaReturn.OriginalTraceField(),
+		addendaReturn.DateOfDeathField(),
+		addendaReturn.OriginalDFIField(),
+		addendaReturn.AddendaInformationField(),
+		addendaReturn.TraceNumberField(),
 	)
 }
 
-// Validate verifies NACHA rules for ReturnAddenda
-func (returnAddenda *ReturnAddenda) Validate() error {
+// Validate verifies NACHA rules for AddendaReturn
+func (addendaReturn *AddendaReturn) Validate() error {
 
-	if returnAddenda.recordType != "7" {
+	if addendaReturn.recordType != "7" {
 		msg := fmt.Sprintf(msgRecordType, 7)
-		return &FieldError{FieldName: "recordType", Value: returnAddenda.recordType, Msg: msg}
+		return &FieldError{FieldName: "recordType", Value: addendaReturn.recordType, Msg: msg}
 	}
 	// @TODO Type Code should be 99.
 
-	_, ok := returnCodeDict[returnAddenda.ReturnCode]
+	_, ok := returnCodeDict[addendaReturn.ReturnCode]
 	if !ok {
 		// Return Addenda requires a valid ReturnCode
-		return &FieldError{FieldName: "ReturnCode", Value: returnAddenda.ReturnCode, Msg: msgReturnAddendaReturnCode}
+		return &FieldError{FieldName: "ReturnCode", Value: addendaReturn.ReturnCode, Msg: msgAddendaReturnReturnCode}
 	}
 	return nil
 }
 
 // TypeCode defines the format of the underlying addenda record
-func (returnAddenda *ReturnAddenda) TypeCode() string {
-	return returnAddenda.typeCode
+func (addendaReturn *AddendaReturn) TypeCode() string {
+	return addendaReturn.typeCode
 }
 
 // OriginalTraceField returns a zero padded OriginalTrace string
-func (returnAddenda *ReturnAddenda) OriginalTraceField() string {
-	return returnAddenda.numericField(returnAddenda.OriginalTrace, 15)
+func (addendaReturn *AddendaReturn) OriginalTraceField() string {
+	return addendaReturn.numericField(addendaReturn.OriginalTrace, 15)
 }
 
 // DateOfDeathField returns a space padded DateOfDeath string
-func (returnAddenda *ReturnAddenda) DateOfDeathField() string {
+func (addendaReturn *AddendaReturn) DateOfDeathField() string {
 	// Return space padded 6 characters if it is a zero value of DateOfDeath
-	if returnAddenda.DateOfDeath.IsZero() {
-		return returnAddenda.alphaField("", 6)
+	if addendaReturn.DateOfDeath.IsZero() {
+		return addendaReturn.alphaField("", 6)
 	}
 	// YYMMDD
-	return returnAddenda.formatSimpleDate(returnAddenda.DateOfDeath)
+	return addendaReturn.formatSimpleDate(addendaReturn.DateOfDeath)
 }
 
 // OriginalDFIField returns a zero padded OriginalDFI string
-func (returnAddenda *ReturnAddenda) OriginalDFIField() string {
-	return returnAddenda.numericField(returnAddenda.OriginalDFI, 8)
+func (addendaReturn *AddendaReturn) OriginalDFIField() string {
+	return addendaReturn.numericField(addendaReturn.OriginalDFI, 8)
 }
 
 //AddendaInformationField returns a space padded AddendaInformation string
-func (returnAddenda *ReturnAddenda) AddendaInformationField() string {
-	return returnAddenda.alphaField(returnAddenda.AddendaInformation, 44)
+func (addendaReturn *AddendaReturn) AddendaInformationField() string {
+	return addendaReturn.alphaField(addendaReturn.AddendaInformation, 44)
 }
 
 // TraceNumberField returns a zero padded traceNumber string
-func (returnAddenda *ReturnAddenda) TraceNumberField() string {
-	return returnAddenda.numericField(returnAddenda.TraceNumber, 15)
+func (addendaReturn *AddendaReturn) TraceNumberField() string {
+	return addendaReturn.numericField(addendaReturn.TraceNumber, 15)
 }
 
 func makeReturnCodeDict() map[string]*returnCode {
diff --git a/batch.go b/batch.go
index e54c593e..e2032059 100644
--- a/batch.go
+++ b/batch.go
@@ -324,7 +324,7 @@ func (batch *batch) isAddendaSequence() error {
 // "PPD", "WEB", "CCD", "CIE", "DNE", "MTE", "POS", "SHR"
 func (batch *batch) isAddendaCount(count int) error {
 	for _, entry := range batch.entries {
-		if !entry.HasReturnAddenda() {
+		if !entry.HasAddendaReturn() {
 			if len(entry.Addendum) > count {
 				msg := fmt.Sprintf(msgBatchAddendaCount, len(entry.Addendum), count, batch.header.StandardEntryClassCode)
 				return &BatchError{BatchNumber: batch.header.BatchNumber, FieldName: "AddendaCount", Msg: msg}
@@ -332,7 +332,7 @@ func (batch *batch) isAddendaCount(count int) error {
 		} else {
 			if len(entry.ReturnAddendum) > count {
 				msg := fmt.Sprintf(msgBatchAddendaCount, len(entry.ReturnAddendum), count, batch.header.StandardEntryClassCode)
-				return &BatchError{BatchNumber: batch.header.BatchNumber, FieldName: "ReturnAddendaCount", Msg: msg}
+				return &BatchError{BatchNumber: batch.header.BatchNumber, FieldName: "AddendaReturnCount", Msg: msg}
 			}
 		}
 	}
diff --git a/entryDetail.go b/entryDetail.go
index f6cd900a..e6b6f0da 100644
--- a/entryDetail.go
+++ b/entryDetail.go
@@ -77,7 +77,7 @@ type EntryDetail struct {
 	// Addendum a list of Addenda for the Entry Detail
 	Addendum []Addendumer
 	// ReturnAddendum stores return types. These are processed separately
-	ReturnAddendum []ReturnAddenda
+	ReturnAddendum []AddendaReturn
 	// validator is composed for data validation
 	validator
 	// converters is composed for ACH to golang Converters
@@ -243,8 +243,8 @@ func (ed *EntryDetail) AddAddenda(addenda Addendumer) []Addendumer {
 	return ed.Addendum
 }
 
-// AddReturnAddenda appends an ReturnAddendum to the entry
-func (ed *EntryDetail) AddReturnAddenda(returnAddendum ReturnAddenda) []ReturnAddenda {
+// AddAddendaReturn appends an ReturnAddendum to the entry
+func (ed *EntryDetail) AddAddendaReturn(returnAddendum AddendaReturn) []AddendaReturn {
 	ed.AddendaRecordIndicator = 1
 	// checks to make sure that we only have either or, not both
 	if ed.Addendum != nil {
@@ -330,7 +330,7 @@ func (ed *EntryDetail) TraceNumberField() string {
 	return ed.numericField(ed.TraceNumber, 15)
 }
 
-// HasReturnAddenda returns true if entry has return addenda
-func (ed *EntryDetail) HasReturnAddenda() bool {
+// HasAddendaReturn returns true if entry has return addenda
+func (ed *EntryDetail) HasAddendaReturn() bool {
 	return ed.ReturnAddendum != nil
 }


Test patch:
diff --git a/addendaReturn_test.go b/addendaReturn_test.go
index b760109a..a9d14234 100644
--- a/addendaReturn_test.go
+++ b/addendaReturn_test.go
@@ -10,64 +10,64 @@ import (
 	"time"
 )
 
-func mockReturnAddenda() *ReturnAddenda {
-	rAddenda := NewReturnAddenda()
-	rAddenda.typeCode = "99"
-	rAddenda.ReturnCode = "R07"
-	rAddenda.OriginalTrace = 99912340000015
-	rAddenda.AddendaInformation = "Authorization Revoked"
-	rAddenda.OriginalDFI = 9101298
-
-	return rAddenda
+func mockAddendaReturn() *AddendaReturn {
+	addendaReturn := NewAddendaReturn()
+	addendaReturn.typeCode = "99"
+	addendaReturn.ReturnCode = "R07"
+	addendaReturn.OriginalTrace = 99912340000015
+	addendaReturn.AddendaInformation = "Authorization Revoked"
+	addendaReturn.OriginalDFI = 9101298
+
+	return addendaReturn
 }
 
-func TestMockReturnAddenda(t *testing.T) {
+func TestMockAddendaReturn(t *testing.T) {
 	// TODO: build a mock addenda
 }
 
-func TestReturnAddendaParse(t *testing.T) {
-	rAddenda := NewReturnAddenda()
+func TestAddendaReturnParse(t *testing.T) {
+	addendaReturn := NewAddendaReturn()
 	line := "799R07099912340000015      09101298Authorization revoked                       091012980000066"
-	rAddenda.Parse(line)
-	// walk the returnAddenda struct
-	if rAddenda.recordType != "7" {
-		t.Errorf("expected %v got %v", "7", rAddenda.recordType)
+	addendaReturn.Parse(line)
+	// walk the addendaReturn struct
+	if addendaReturn.recordType != "7" {
+		t.Errorf("expected %v got %v", "7", addendaReturn.recordType)
 	}
-	if rAddenda.typeCode != "99" {
-		t.Errorf("expected %v got %v", "99", rAddenda.typeCode)
+	if addendaReturn.typeCode != "99" {
+		t.Errorf("expected %v got %v", "99", addendaReturn.typeCode)
 	}
-	if rAddenda.ReturnCode != "R07" {
-		t.Errorf("expected %v got %v", "R07", rAddenda.ReturnCode)
+	if addendaReturn.ReturnCode != "R07" {
+		t.Errorf("expected %v got %v", "R07", addendaReturn.ReturnCode)
 	}
-	if rAddenda.OriginalTrace != 99912340000015 {
-		t.Errorf("expected: %v got: %v", 99912340000015, rAddenda.OriginalTrace)
+	if addendaReturn.OriginalTrace != 99912340000015 {
+		t.Errorf("expected: %v got: %v", 99912340000015, addendaReturn.OriginalTrace)
 	}
-	if rAddenda.DateOfDeath.IsZero() != true {
-		t.Errorf("expected: %v got: %v", time.Time{}, rAddenda.DateOfDeath)
+	if addendaReturn.DateOfDeath.IsZero() != true {
+		t.Errorf("expected: %v got: %v", time.Time{}, addendaReturn.DateOfDeath)
 	}
-	if rAddenda.OriginalDFI != 9101298 {
-		t.Errorf("expected: %v got: %v", 9101298, rAddenda.OriginalDFI)
+	if addendaReturn.OriginalDFI != 9101298 {
+		t.Errorf("expected: %v got: %v", 9101298, addendaReturn.OriginalDFI)
 	}
-	if rAddenda.AddendaInformation != "Authorization revoked" {
-		t.Errorf("expected: %v got: %v", "Authorization revoked", rAddenda.AddendaInformation)
+	if addendaReturn.AddendaInformation != "Authorization revoked" {
+		t.Errorf("expected: %v got: %v", "Authorization revoked", addendaReturn.AddendaInformation)
 	}
-	if rAddenda.TraceNumber != 91012980000066 {
-		t.Errorf("expected: %v got: %v", 91012980000066, rAddenda.TraceNumber)
+	if addendaReturn.TraceNumber != 91012980000066 {
+		t.Errorf("expected: %v got: %v", 91012980000066, addendaReturn.TraceNumber)
 	}
 }
 
-func TestReturnAddendaString(t *testing.T) {
-	rAddenda := NewReturnAddenda()
+func TestAddendaReturnString(t *testing.T) {
+	addendaReturn := NewAddendaReturn()
 	line := "799R07099912340000015      09101298Authorization revoked                       091012980000066"
-	rAddenda.Parse(line)
+	addendaReturn.Parse(line)
 
-	if rAddenda.String() != line {
-		t.Errorf("\n expected: %v\n got     : %v", line, rAddenda.String())
+	if addendaReturn.String() != line {
+		t.Errorf("\n expected: %v\n got     : %v", line, addendaReturn.String())
 	}
 }
 
 // This is not an exported function but utilized for validation
-func TestReturnAddendaMakeReturnCodeDict(t *testing.T) {
+func TestAddendaReturnMakeReturnCodeDict(t *testing.T) {
 	codes := makeReturnCodeDict()
 	// check if known code is present
 	_, prs := codes["R01"]
@@ -81,10 +81,10 @@ func TestReturnAddendaMakeReturnCodeDict(t *testing.T) {
 	}
 }
 
-func TestReturnAddendaValidateTrue(t *testing.T) {
-	rAddenda := mockReturnAddenda()
-	rAddenda.ReturnCode = "R13"
-	if err := rAddenda.Validate(); err != nil {
+func TestAddendaReturnValidateTrue(t *testing.T) {
+	addendaReturn := mockAddendaReturn()
+	addendaReturn.ReturnCode = "R13"
+	if err := addendaReturn.Validate(); err != nil {
 		if e, ok := err.(*FieldError); ok {
 			if e.FieldName != "ReturnCode" {
 				t.Errorf("%T: %s", err, err)
@@ -95,10 +95,10 @@ func TestReturnAddendaValidateTrue(t *testing.T) {
 	}
 }
 
-func TestReturnAddendaValidateReturnCodeFalse(t *testing.T) {
-	rAddenda := mockReturnAddenda()
-	rAddenda.ReturnCode = ""
-	if err := rAddenda.Validate(); err != nil {
+func TestAddendaReturnValidateReturnCodeFalse(t *testing.T) {
+	addendaReturn := mockAddendaReturn()
+	addendaReturn.ReturnCode = ""
+	if err := addendaReturn.Validate(); err != nil {
 		if e, ok := err.(*FieldError); ok {
 			if e.FieldName != "ReturnCode" {
 				t.Errorf("%T: %s", err, err)
@@ -109,53 +109,53 @@ func TestReturnAddendaValidateReturnCodeFalse(t *testing.T) {
 	}
 }
 
-func TestReturnAddendaOriginalTraceField(t *testing.T) {
-	rAddenda := mockReturnAddenda()
-	rAddenda.OriginalTrace = 12345
-	if rAddenda.OriginalTraceField() != "000000000012345" {
-		t.Errorf("expected %v received %v", "000000000012345", rAddenda.OriginalTraceField())
+func TestAddendaReturnOriginalTraceField(t *testing.T) {
+	addendaReturn := mockAddendaReturn()
+	addendaReturn.OriginalTrace = 12345
+	if addendaReturn.OriginalTraceField() != "000000000012345" {
+		t.Errorf("expected %v received %v", "000000000012345", addendaReturn.OriginalTraceField())
 	}
 }
 
-func TestReturnAddendaDateOfDeathField(t *testing.T) {
-	rAddenda := mockReturnAddenda()
+func TestAddendaReturnDateOfDeathField(t *testing.T) {
+	addendaReturn := mockAddendaReturn()
 	// Check for all zeros
-	if rAddenda.DateOfDeathField() != "      " {
-		t.Errorf("expected %v received %v", "      ", rAddenda.DateOfDeathField())
+	if addendaReturn.DateOfDeathField() != "      " {
+		t.Errorf("expected %v received %v", "      ", addendaReturn.DateOfDeathField())
 	}
 	// Year: 1978 Month: October Day: 23
-	rAddenda.DateOfDeath = time.Date(1978, time.October, 23, 0, 0, 0, 0, time.UTC)
-	if rAddenda.DateOfDeathField() != "781023" {
-		t.Errorf("expected %v received %v", "781023", rAddenda.DateOfDeathField())
+	addendaReturn.DateOfDeath = time.Date(1978, time.October, 23, 0, 0, 0, 0, time.UTC)
+	if addendaReturn.DateOfDeathField() != "781023" {
+		t.Errorf("expected %v received %v", "781023", addendaReturn.DateOfDeathField())
 	}
 }
 
-func TestReturnAddendaOriginalDFIField(t *testing.T) {
-	rAddenda := mockReturnAddenda()
+func TestAddendaReturnOriginalDFIField(t *testing.T) {
+	addendaReturn := mockAddendaReturn()
 	exp := "09101298"
-	if rAddenda.OriginalDFIField() != exp {
-		t.Errorf("expected %v received %v", exp, rAddenda.OriginalDFIField())
+	if addendaReturn.OriginalDFIField() != exp {
+		t.Errorf("expected %v received %v", exp, addendaReturn.OriginalDFIField())
 	}
 }
 
-func TestReturnAddendaAddendaInformationField(t *testing.T) {
-	rAddenda := mockReturnAddenda()
+func TestAddendaReturnAddendaInformationField(t *testing.T) {
+	addendaReturn := mockAddendaReturn()
 	exp := "Authorization Revoked                       "
-	if rAddenda.AddendaInformationField() != exp {
-		t.Errorf("expected %v received %v", exp, rAddenda.AddendaInformationField())
+	if addendaReturn.AddendaInformationField() != exp {
+		t.Errorf("expected %v received %v", exp, addendaReturn.AddendaInformationField())
 	}
 }
 
-func TestReturnAddendaTraceNumberField(t *testing.T) {
-	rAddenda := mockReturnAddenda()
-	rAddenda.TraceNumber = 91012980000066
+func TestAddendaReturnTraceNumberField(t *testing.T) {
+	addendaReturn := mockAddendaReturn()
+	addendaReturn.TraceNumber = 91012980000066
 	exp := "091012980000066"
-	if rAddenda.TraceNumberField() != exp {
-		t.Errorf("expected %v received %v", exp, rAddenda.TraceNumberField())
+	if addendaReturn.TraceNumberField() != exp {
+		t.Errorf("expected %v received %v", exp, addendaReturn.TraceNumberField())
 	}
 }
 
-func TestReturnAddendaNewAddendaParam(t *testing.T) {
+func TestAddendaReturnNewAddendaParam(t *testing.T) {
 	aParam := AddendaParam{
 		TypeCode:      "99",
 		ReturnCode:    "R07",
@@ -167,28 +167,28 @@ func TestReturnAddendaNewAddendaParam(t *testing.T) {
 
 	a, err := NewAddenda(aParam)
 	if err != nil {
-		t.Errorf("returnAddenda from NewAddeda: %v", err)
+		t.Errorf("addendaReturn from NewAddeda: %v", err)
 	}
-	rAddenda, ok := a.(*ReturnAddenda)
+	addendaReturn, ok := a.(*AddendaReturn)
 	if !ok {
-		t.Errorf("expecting *ReturnAddenda received %T ", a)
+		t.Errorf("expecting *AddendaReturn received %T ", a)
 	}
-	if rAddenda.TypeCode() != aParam.TypeCode {
-		t.Errorf("expected %v got %v", aParam.TypeCode, rAddenda.TypeCode())
+	if addendaReturn.TypeCode() != aParam.TypeCode {
+		t.Errorf("expected %v got %v", aParam.TypeCode, addendaReturn.TypeCode())
 	}
-	if rAddenda.ReturnCode != aParam.ReturnCode {
-		t.Errorf("expected %v got %v", aParam.ReturnCode, rAddenda.ReturnCode)
+	if addendaReturn.ReturnCode != aParam.ReturnCode {
+		t.Errorf("expected %v got %v", aParam.ReturnCode, addendaReturn.ReturnCode)
 	}
-	if !strings.Contains(rAddenda.OriginalTraceField(), aParam.OriginalTrace) {
-		t.Errorf("expected %v got %v", aParam.OriginalTrace, rAddenda.OriginalTrace)
+	if !strings.Contains(addendaReturn.OriginalTraceField(), aParam.OriginalTrace) {
+		t.Errorf("expected %v got %v", aParam.OriginalTrace, addendaReturn.OriginalTrace)
 	}
-	if !strings.Contains(rAddenda.OriginalDFIField(), aParam.OriginalDFI) {
-		t.Errorf("expected %v got %v", aParam.OriginalDFI, rAddenda.OriginalDFI)
+	if !strings.Contains(addendaReturn.OriginalDFIField(), aParam.OriginalDFI) {
+		t.Errorf("expected %v got %v", aParam.OriginalDFI, addendaReturn.OriginalDFI)
 	}
-	if rAddenda.AddendaInformation != aParam.AddendaInfo {
-		t.Errorf("expected %v got %v", aParam.AddendaInfo, rAddenda.AddendaInformation)
+	if addendaReturn.AddendaInformation != aParam.AddendaInfo {
+		t.Errorf("expected %v got %v", aParam.AddendaInfo, addendaReturn.AddendaInformation)
 	}
-	if !strings.Contains(rAddenda.TraceNumberField(), aParam.TraceNumber) {
-		t.Errorf("expected %v got %v", aParam.TraceNumber, rAddenda.TraceNumber)
+	if !strings.Contains(addendaReturn.TraceNumberField(), aParam.TraceNumber) {
+		t.Errorf("expected %v got %v", aParam.TraceNumber, addendaReturn.TraceNumber)
 	}
 }