Skip to content

Commit

Permalink
remove Java-like getters/setters
Browse files Browse the repository at this point in the history
  • Loading branch information
atonks2 committed Nov 19, 2020
1 parent 227bd3a commit cc7d18f
Show file tree
Hide file tree
Showing 20 changed files with 1,117 additions and 1,831 deletions.
2 changes: 1 addition & 1 deletion beneficiaryIntermediaryFI_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func TestParseBeneficiaryIntermediaryFIReaderParseError(t *testing.T) {
r.line = line
fwm := new(FEDWireMessage)
bifi := mockBeneficiaryIntermediaryFI()
fwm.SetBeneficiaryIntermediaryFI(bifi)
fwm.BeneficiaryIntermediaryFI = bifi

err := r.parseBeneficiaryIntermediaryFI()

Expand Down
60 changes: 30 additions & 30 deletions cmd/server/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,70 +17,70 @@ import (
}*/

func mockFEDWireMessage() wire.FEDWireMessage {
fwm := wire.NewFEDWireMessage()
fwm := wire.FEDWireMessage{}
fwm.ID = "12345"

// Mandatory Fields
ss := wire.NewSenderSupplied()
ss.UserRequestCorrelation = "User Req"
ss.MessageDuplicationCode = wire.MessageDuplicationOriginal
fwm.SetSenderSupplied(ss)
fwm.SenderSupplied = ss

tst := wire.NewTypeSubType()
tst.TypeCode = wire.FundsTransfer
tst.SubTypeCode = wire.BasicFundsTransfer
fwm.SetTypeSubType(tst)
fwm.TypeSubType = tst

imad := wire.NewInputMessageAccountabilityData()
imad.InputCycleDate = time.Now().Format("20060102")
imad.InputSource = "Source08"
imad.InputSequenceNumber = "000001"
fwm.SetInputMessageAccountabilityData(imad)
fwm.InputMessageAccountabilityData = imad

amt := wire.NewAmount()
amt.Amount = "000001234567"
fwm.SetAmount(amt)
fwm.Amount = amt

sdi := wire.NewSenderDepositoryInstitution()
sdi.SenderABANumber = "121042882"
sdi.SenderShortName = "Wells Fargo NA"
fwm.SetSenderDepositoryInstitution(sdi)
fwm.SenderDepositoryInstitution = sdi

rdi := wire.NewReceiverDepositoryInstitution()
rdi.ReceiverABANumber = "231380104"
rdi.ReceiverShortName = "Citadel"
fwm.SetReceiverDepositoryInstitution(rdi)
fwm.ReceiverDepositoryInstitution = rdi

bfc := wire.NewBusinessFunctionCode()
bfc.BusinessFunctionCode = wire.CustomerTransfer
bfc.TransactionTypeCode = " "
fwm.SetBusinessFunctionCode(bfc)
fwm.BusinessFunctionCode = bfc

// Other Transfer Information
sr := wire.NewSenderReference()
sr.SenderReference = "Sender Reference"
fwm.SetSenderReference(sr)
fwm.SenderReference = sr

pmi := wire.NewPreviousMessageIdentifier()
pmi.PreviousMessageIdentifier = "Previous Message Ident"
fwm.SetPreviousMessageIdentifier(pmi)
fwm.PreviousMessageIdentifier = pmi

c := wire.NewCharges()
c.ChargeDetails = "B"
c.SendersChargesOne = "USD0,99"
c.SendersChargesTwo = "USD2,99"
c.SendersChargesThree = "USD3,99"
c.SendersChargesFour = "USD1,00"
fwm.SetCharges(c)
fwm.Charges = c

ia := wire.NewInstructedAmount()
ia.CurrencyCode = "USD"
ia.Amount = "4567,89"
fwm.SetInstructedAmount(ia)
fwm.InstructedAmount = ia

eRate := wire.NewExchangeRate()
eRate.ExchangeRate = "1,2345"
fwm.SetExchangeRate(eRate)
fwm.ExchangeRate = eRate

// Beneficiary
bifi := wire.NewBeneficiaryIntermediaryFI()
Expand All @@ -90,7 +90,7 @@ func mockFEDWireMessage() wire.FEDWireMessage {
bifi.FinancialInstitution.Address.AddressLineOne = "Address One"
bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two"
bifi.FinancialInstitution.Address.AddressLineThree = "Address Three"
fwm.SetBeneficiaryIntermediaryFI(bifi)
fwm.BeneficiaryIntermediaryFI = bifi

bfi := wire.NewBeneficiaryFI()
bfi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber
Expand All @@ -99,7 +99,7 @@ func mockFEDWireMessage() wire.FEDWireMessage {
bfi.FinancialInstitution.Address.AddressLineOne = "Address One"
bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two"
bfi.FinancialInstitution.Address.AddressLineThree = "Address Three"
fwm.SetBeneficiaryFI(bfi)
fwm.BeneficiaryFI = bfi

ben := wire.NewBeneficiary()
ben.Personal.IdentificationCode = wire.DriversLicenseNumber
Expand All @@ -108,11 +108,11 @@ func mockFEDWireMessage() wire.FEDWireMessage {
ben.Personal.Address.AddressLineOne = "Address One"
ben.Personal.Address.AddressLineTwo = "Address Two"
ben.Personal.Address.AddressLineThree = "Address Three"
fwm.SetBeneficiary(ben)
fwm.Beneficiary = ben

br := wire.NewBeneficiaryReference()
br.BeneficiaryReference = "Reference"
fwm.SetBeneficiaryReference(br)
fwm.BeneficiaryReference = br

// Originator
o := wire.NewOriginator()
Expand All @@ -122,7 +122,7 @@ func mockFEDWireMessage() wire.FEDWireMessage {
o.Personal.Address.AddressLineOne = "Address One"
o.Personal.Address.AddressLineTwo = "Address Two"
o.Personal.Address.AddressLineThree = "Address Three"
fwm.SetOriginator(o)
fwm.Originator = o

ofi := wire.NewOriginatorFI()
ofi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber
Expand All @@ -131,7 +131,7 @@ func mockFEDWireMessage() wire.FEDWireMessage {
ofi.FinancialInstitution.Address.AddressLineOne = "Address One"
ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two"
ofi.FinancialInstitution.Address.AddressLineThree = "Address Three"
fwm.SetOriginatorFI(ofi)
fwm.OriginatorFI = ofi

ifi := wire.NewInstructingFI()
ifi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber
Expand All @@ -140,14 +140,14 @@ func mockFEDWireMessage() wire.FEDWireMessage {
ifi.FinancialInstitution.Address.AddressLineOne = "Address One"
ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two"
ifi.FinancialInstitution.Address.AddressLineThree = "Address Three"
fwm.SetInstructingFI(ifi)
fwm.InstructingFI = ifi

ob := wire.NewOriginatorToBeneficiary()
ob.LineOne = "LineOne"
ob.LineTwo = "LineTwo"
ob.LineThree = "LineThree"
ob.LineFour = "LineFour"
fwm.SetOriginatorToBeneficiary(ob)
fwm.OriginatorToBeneficiary = ob

// FI to FI
firfi := wire.NewFIReceiverFI()
Expand All @@ -157,7 +157,7 @@ func mockFEDWireMessage() wire.FEDWireMessage {
firfi.FIToFI.LineOne = "Line Four"
firfi.FIToFI.LineOne = "Line Five"
firfi.FIToFI.LineOne = "Line Six"
fwm.SetFIReceiverFI(firfi)
fwm.FIReceiverFI = firfi

fiifi := wire.NewFIIntermediaryFI()
fiifi.FIToFI.LineOne = "Line One"
Expand All @@ -166,7 +166,7 @@ func mockFEDWireMessage() wire.FEDWireMessage {
fiifi.FIToFI.LineOne = "Line Four"
fiifi.FIToFI.LineOne = "Line Five"
fiifi.FIToFI.LineOne = "Line Six"
fwm.SetFIIntermediaryFI(fiifi)
fwm.FIIntermediaryFI = fiifi

fiifia := wire.NewFIIntermediaryFIAdvice()
fiifia.Advice.AdviceCode = wire.AdviceCodeLetter
Expand All @@ -176,7 +176,7 @@ func mockFEDWireMessage() wire.FEDWireMessage {
fiifia.Advice.LineFour = "Line Four"
fiifia.Advice.LineFive = "Line Five"
fiifia.Advice.LineSix = "Line Six"
fwm.SetFIIntermediaryFIAdvice(fiifia)
fwm.FIIntermediaryFIAdvice = fiifia

fibfi := wire.NewFIBeneficiaryFI()
fibfi.FIToFI.LineOne = "Line One"
Expand All @@ -185,7 +185,7 @@ func mockFEDWireMessage() wire.FEDWireMessage {
fibfi.FIToFI.LineFour = "Line Four"
fibfi.FIToFI.LineFive = "Line Five"
fibfi.FIToFI.LineSix = "Line Six"
fwm.SetFIBeneficiaryFI(fibfi)
fwm.FIBeneficiaryFI = fibfi

fibfia := wire.NewFIBeneficiaryFIAdvice()
fibfia.Advice.AdviceCode = wire.AdviceCodeTelex
Expand All @@ -195,7 +195,7 @@ func mockFEDWireMessage() wire.FEDWireMessage {
fibfia.Advice.LineFour = "Line Four"
fibfia.Advice.LineFive = "Line Five"
fibfia.Advice.LineSix = "Line Six"
fwm.SetFIBeneficiaryFIAdvice(fibfia)
fwm.FIBeneficiaryFIAdvice = fibfia

fib := wire.NewFIBeneficiary()
fib.FIToFI.LineOne = "Line One"
Expand All @@ -204,7 +204,7 @@ func mockFEDWireMessage() wire.FEDWireMessage {
fib.FIToFI.LineFour = "Line Four"
fib.FIToFI.LineFive = "Line Five"
fib.FIToFI.LineSix = "Line Six"
fwm.SetFIBeneficiary(fib)
fwm.FIBeneficiary = fib

fiba := wire.NewFIBeneficiaryAdvice()
fiba.Advice.AdviceCode = wire.AdviceCodeLetter
Expand All @@ -214,11 +214,11 @@ func mockFEDWireMessage() wire.FEDWireMessage {
fiba.Advice.LineFour = "Line Four"
fiba.Advice.LineFive = "Line Five"
fiba.Advice.LineSix = "Line Six"
fwm.SetFIBeneficiaryAdvice(fiba)
fwm.FIBeneficiaryAdvice = fiba

pm := wire.NewFIPaymentMethodToBeneficiary()
pm.AdditionalInformation = "Additional Information"
fwm.SetFIPaymentMethodToBeneficiary(pm)
fwm.FIPaymentMethodToBeneficiary = pm

fifi := wire.NewFIAdditionalFIToFI()
fifi.AdditionalFIToFI.LineOne = "Line One"
Expand All @@ -227,7 +227,7 @@ func mockFEDWireMessage() wire.FEDWireMessage {
fifi.AdditionalFIToFI.LineFour = "Line Four"
fifi.AdditionalFIToFI.LineFive = "Line Five"
fifi.AdditionalFIToFI.LineSix = "Line Six"
fwm.SetFIAdditionalFIToFI(fifi)
fwm.FIAdditionalFIToFI = fifi

return fwm
}
Loading

0 comments on commit cc7d18f

Please sign in to comment.