Skip to content

Commit

Permalink
Merge branch 'main' into B-21690-Fix-Assigned-Column
Browse files Browse the repository at this point in the history
  • Loading branch information
loganwc authored Dec 30, 2024
2 parents 3873375 + 6fb9a16 commit c95d899
Show file tree
Hide file tree
Showing 277 changed files with 13,615 additions and 3,211 deletions.
1,047 changes: 1,045 additions & 2 deletions .gitlab-ci.yml

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions Dockerfile.migrations
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
FROM alpine:3.20.3
FROM debian:stable AS build-env

# hadolint ignore=DL3017
RUN apk upgrade --no-cache busybox
COPY config/tls/dod-wcf-root-ca-1.pem /usr/local/share/ca-certificates/dod-wcf-root-ca-1.pem.crt
COPY config/tls/dod-wcf-intermediate-ca-1.pem /usr/local/share/ca-certificates/dod-wcf-intermediate-ca-1.pem.crt
RUN apt-get update
# hadolint ignore=DL3008
RUN apt-get install -y ca-certificates --no-install-recommends
RUN update-ca-certificates


# hadolint ignore=DL3007
FROM gcr.io/distroless/base-debian11@sha256:ac69aa622ea5dcbca0803ca877d47d069f51bd4282d5c96977e0390d7d256455

COPY config/tls/dod-wcf-root-ca-1.pem /usr/local/share/ca-certificates/dod-wcf-root-ca-1.pem.crt
COPY config/tls/dod-wcf-intermediate-ca-1.pem /usr/local/share/ca-certificates/dod-wcf-intermediate-ca-1.pem.crt
COPY --from=build-env /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

COPY bin/rds-ca-rsa4096-g1.pem /bin/rds-ca-rsa4096-g1.pem
COPY bin/rds-ca-2019-root.pem /bin/rds-ca-2019-root.pem
Expand All @@ -13,13 +22,4 @@ COPY bin/milmove /bin/milmove
COPY migrations/app/schema /migrate/schema
COPY migrations/app/migrations_manifest.txt /migrate/migrations_manifest.txt

# Install tools needed in container
# hadolint ignore=DL3018
RUN apk update && apk add ca-certificates --no-cache
RUN update-ca-certificates

WORKDIR /

USER nobody

ENTRYPOINT ["/bin/milmove", "migrate", "-p", "file:///migrate/migrations", "-m", "/migrate/migrations_manifest.txt"]
ENTRYPOINT ["/bin/milmove", "migrate", "-p", "file:///migrate/migrations", "-m", "/migrate/migrations_manifest.txt"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ifeq ($(USE_AWS),true)
endif

# Convenience for LDFLAGS
GIT_BRANCH ?= $(shell git branch | grep \* | cut -d ' ' -f2)
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
export GIT_BRANCH GIT_COMMIT
WEBSERVER_LDFLAGS=-X main.gitBranch=$(GIT_BRANCH) -X main.gitCommit=$(GIT_COMMIT)
Expand Down
2 changes: 2 additions & 0 deletions migrations/app/migrations_manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1044,9 +1044,11 @@
20241119163933_set_inactive_NSRA15_oconus_rate_areas.up.sql
20241120221040_change_port_location_fk_to_correct_table.up.sql
20241122155416_total_dependents_calculation.up.sql
20241122220314_create_port_and_port_location_test_data.up.sql
20241126222026_add_sort_column_to_re_service_items.up.sql
20241127133504_add_indexes_speed_up_counseling_offices.up.sql
20241202163059_create_test_sequence_dev_env.up.sql
20241203024453_add_ppm_max_incentive_column.up.sql
20241204155919_update_ordering_proc.up.sql
20241204210208_retroactive_update_of_ppm_max_and_estimated_incentives_prd.up.sql
20241227153723_remove_empty_string_emplid_values.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--Blow away existing port data as it is not valid
DELETE FROM ports;
DELETE FROM port_locations;

INSERT INTO ports (id,port_code,port_type,port_name,created_at,updated_at) VALUES
('b393e767-0703-43c6-b1e9-12541dc3f15b'::uuid,'PDX','A','PORTLAND INTL','2024-11-22 14:52:24.739738','2024-11-22 14:52:24.739738'),
('48569958-2889-41e5-8101-82c56ec48430'::uuid,'SEA','A','SEATTLE TACOMA INTL','2024-11-22 14:52:24.739738','2024-11-22 14:52:24.739738'),
('aa33487c-0637-4c1a-b260-d12ed1dbcc39'::uuid,'TCM','A','MCCHORD FLD','2024-11-22 14:52:24.739738','2024-11-22 14:52:24.739738'),
('5269b1ec-3478-414c-bdb1-c8db12ccd0b5'::uuid,'4G1','S','ASTORIA, OREGON','2024-11-22 15:09:55.189787','2024-11-22 15:09:55.189787'),
('30dc0c1f-c2e2-4bf1-b9fd-5c24e21034d8'::uuid,'4H6','S','PORTLAND, OREGON','2024-11-22 15:09:55.189787','2024-11-22 15:09:55.189787'),
('54a32fc7-c2a9-4ba6-b8dd-99a710730fda'::uuid,'4K1','S','COOS BAY, OREGON','2024-11-22 15:09:55.189787','2024-11-22 15:09:55.189787'),
('581da305-3a67-4311-b7d5-1fec19b221f9'::uuid,'4B2','S','ANACORTES, NORTH WEST WASHINGTON','2024-11-22 15:09:55.189787','2024-11-22 15:09:55.189787'),
('b8dc9c80-bd6d-4a2d-8bd3-f025ddef95fc'::uuid,'4C1','S','PORT ANGELES, WHIDBEY ISLAND','2024-11-22 15:09:55.189787','2024-11-22 15:09:55.189787'),
('5355255c-3c9c-4d86-af2a-4b63004dee24'::uuid,'4DL','S','SEATTLE SDDC TERMINAL, PUGET SOUND','2024-11-22 15:09:55.189787','2024-11-22 15:09:55.189787'),
('a9c24841-64e0-4e12-a872-ee7fb73a6300'::uuid,'4EA','S','TACOMA NAVAL STATION, WASHINGTON, PUGET SOUND','2024-11-22 15:09:55.189787','2024-11-22 15:09:55.189787'),
('e4ba8867-bf70-43c7-b143-0f719ed0121f'::uuid,'2902','B','NEWPORT, OR','2024-10-17 13:50:08.046274','2024-10-17 13:50:08.046274'),
('ae0667e0-b497-4dd3-bfb4-a20f457104d1'::uuid,'2904','B','PORTLAND, OR','2024-10-17 13:50:08.046274','2024-10-17 13:50:08.046274'),
('e21ce23a-c261-4b54-a711-6dee965bcfe9'::uuid,'3001','B','SEATTLE, WA','2024-10-17 13:50:08.046274','2024-10-17 13:50:08.046274'),
('27ce681f-6dd6-45fd-b3ab-9a5b459b814b'::uuid,'3002','B','TACOMA, WA','2024-10-17 13:50:08.046274','2024-10-17 13:50:08.046274');

INSERT INTO port_locations (id,port_id,cities_id,us_post_region_cities_id,country_id,is_active,created_at,updated_at) VALUES
('b6e94f5b-33c0-43f3-b960-7c7b2a4ee5fc'::uuid,'b393e767-0703-43c6-b1e9-12541dc3f15b'::uuid,'026f9d81-7715-424e-b368-bfc7a673aaa2'::uuid,'40bf95e4-72f1-4d75-8bc5-5842f7f26c94'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:04:41.941865','2024-11-22 15:04:41.941865'),
('43efe04d-0ca0-4571-9aa1-747193285d9e'::uuid,'48569958-2889-41e5-8101-82c56ec48430'::uuid,'836b9729-08b8-4d2c-b089-c4ea57425a23'::uuid,'aac7788f-0a0f-4397-9742-95394ce02346'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:04:41.941865','2024-11-22 15:04:41.941865'),
('13b2f85a-7370-468b-b3f8-e6689e2bcdf6'::uuid,'aa33487c-0637-4c1a-b260-d12ed1dbcc39'::uuid,'baaf6ab1-6142-4fb7-b753-d0a142c75baf'::uuid,'a70a6356-a318-4426-af02-dbff793fbbb0'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:04:41.941865','2024-11-22 15:04:41.941865'),
('a8f4471f-add6-4f5d-bbe0-48264ba24fda'::uuid,'5269b1ec-3478-414c-bdb1-c8db12ccd0b5'::uuid,'5065f129-c3fe-4533-a24c-408db08d0e28'::uuid,'5fd8306f-af71-4967-950a-4d415c18f415'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:17:22.131362','2024-11-22 15:17:22.131362'),
('be6cb946-4033-43dd-a356-3213b3ba7b53'::uuid,'30dc0c1f-c2e2-4bf1-b9fd-5c24e21034d8'::uuid,'026f9d81-7715-424e-b368-bfc7a673aaa2'::uuid,'40bf95e4-72f1-4d75-8bc5-5842f7f26c94'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:17:22.131362','2024-11-22 15:17:22.131362'),
('c5deb9d6-478b-46b4-ab61-da32fa575731'::uuid,'54a32fc7-c2a9-4ba6-b8dd-99a710730fda'::uuid,'9c7377d9-b175-4896-8acd-5a3fb9ecb48c'::uuid,'3b3d4a99-b6c2-4e01-8a10-7e4e780ecd92'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:17:22.131362','2024-11-22 15:17:22.131362'),
('25e2f255-fd9b-4c21-a513-63332b5c30b9'::uuid,'581da305-3a67-4311-b7d5-1fec19b221f9'::uuid,'9fa66dfd-73b0-4d5f-b637-cac6e0d24676'::uuid,'7f3d3fdb-1d0f-4061-af3c-d2f401737d06'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:17:22.131362','2024-11-22 15:17:22.131362'),
('adfe22d0-70ff-45c3-9b9e-08341f662377'::uuid,'b8dc9c80-bd6d-4a2d-8bd3-f025ddef95fc'::uuid,'999bcb30-edae-4b4d-8027-5e71cb8b015c'::uuid,'c4c4e9bf-631c-4ea0-9d03-bced40ab9189'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:17:22.131362','2024-11-22 15:17:22.131362'),
('8d74a7c2-addd-49d2-a945-697befa686a2'::uuid,'5355255c-3c9c-4d86-af2a-4b63004dee24'::uuid,'836b9729-08b8-4d2c-b089-c4ea57425a23'::uuid,'aac7788f-0a0f-4397-9742-95394ce02346'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:17:22.131362','2024-11-22 15:17:22.131362'),
('9e76c27d-fd4b-434e-9ffc-ef70abc88973'::uuid,'a9c24841-64e0-4e12-a872-ee7fb73a6300'::uuid,'baaf6ab1-6142-4fb7-b753-d0a142c75baf'::uuid,'a70a6356-a318-4426-af02-dbff793fbbb0'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:17:22.131362','2024-11-22 15:17:22.131362'),
('75038c6c-cd38-453d-a0c3-74e39908bb81'::uuid,'e4ba8867-bf70-43c7-b143-0f719ed0121f'::uuid,'fc264968-eaff-404a-8efe-24c35e965e2f'::uuid,'9dcbb419-f0c9-4c06-82f4-c43381a55b89'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:26:06.764703','2024-11-22 15:26:06.764703'),
('2a6b7d44-0b06-4c20-bad9-0bbe147c8e23'::uuid,'ae0667e0-b497-4dd3-bfb4-a20f457104d1'::uuid,'026f9d81-7715-424e-b368-bfc7a673aaa2'::uuid,'40bf95e4-72f1-4d75-8bc5-5842f7f26c94'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:26:06.764703','2024-11-22 15:26:06.764703'),
('10625607-6785-49f0-8a26-36039612743b'::uuid,'e21ce23a-c261-4b54-a711-6dee965bcfe9'::uuid,'836b9729-08b8-4d2c-b089-c4ea57425a23'::uuid,'aac7788f-0a0f-4397-9742-95394ce02346'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:26:06.764703','2024-11-22 15:26:06.764703'),
('a1a7ce07-94f2-45b3-b70a-59f1824778af'::uuid,'27ce681f-6dd6-45fd-b3ab-9a5b459b814b'::uuid,'baaf6ab1-6142-4fb7-b753-d0a142c75baf'::uuid,'a70a6356-a318-4426-af02-dbff793fbbb0'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,true,'2024-11-22 15:26:06.764703','2024-11-22 15:26:06.764703');
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- removing empty string values from the emplid column
UPDATE service_members
SET emplid = null
WHERE emplid = '';
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"filepond-plugin-image-preview": "^4.6.11",
"filepond-polyfill": "^1.0.2",
"formik": "^2.4.2",
"http-proxy-middleware": "^2.0.6",
"http-proxy-middleware": "^3.0.3",
"https-browserify": "^1.0.0",
"is-mobile": "4.0.0",
"jest-canvas-mock": "^2.5.2",
Expand Down
24 changes: 24 additions & 0 deletions pkg/apperror/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,30 @@ func (e *UnsupportedPostalCodeError) Error() string {
return fmt.Sprintf("Unsupported postal code (%s): %s", e.postalCode, e.reason)
}

// UnsupportedPortCode happens when we don't have the data to support a given postal code.
const UnsupportedPortCode ErrorCode = "UNSUPPORTED_PORT_CODE"

// UnsupportedPortCodeError is the custom error type (exported for type checking)
type UnsupportedPortCodeError struct {
baseError
portCode string
reason string
}

// NewUnsupportedPostalCodeError creates an error for when we don't have the data to support a given
// postal code.
func NewUnsupportedPortCodeError(portCode string, reason string) *UnsupportedPortCodeError {
return &UnsupportedPortCodeError{
baseError{UnsupportedPortCode},
portCode,
reason,
}
}

func (e *UnsupportedPortCodeError) Error() string {
return fmt.Sprintf("Unsupported port code (%s): %s", e.portCode, e.reason)
}

// InvalidInputError is returned when an update fails a validation rule
type InvalidInputError struct {
id uuid.UUID
Expand Down
130 changes: 130 additions & 0 deletions pkg/apperror/errors_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
package apperror

import (
"errors"
"fmt"
"testing"

validate "github.com/gobuffalo/validate/v3"
"github.com/gofrs/uuid"
"github.com/stretchr/testify/suite"
)

type errorsSuite struct {
suite.Suite
}

func TestErrorSuite(t *testing.T) {
hs := &errorsSuite{}
suite.Run(t, hs)
}

func (suite *errorsSuite) TestContextError() {
suite.Run("ContextError shows error message", func() {
contextError := NewContextError("This is a context error message")
suite.Equal("ContextError: This is a context error message", contextError.Error())

})
}

func (suite *errorsSuite) TestPreconditionFailedError() {
suite.Run("PreconditionFailedError error function message", func() {
id := uuid.Must(uuid.NewV4())
err := errors.New("Precondition Failed Error")
preconditionFailedError := NewPreconditionFailedError(id, err)
suite.Equal("Precondition failed on update to object with ID: '"+id.String()+"'. The If-Match header value did not match the eTag for this record.", preconditionFailedError.Error())

})
}

func (suite *errorsSuite) TestNotFoundError() {
suite.Run("NotFoundError error function message", func() {
id := uuid.Must(uuid.NewV4())
errorMessage := "This is a Not Found Error"
notFoundError := NewNotFoundError(id, errorMessage)
suite.Equal("ID: "+id.String()+" not found "+errorMessage, notFoundError.Error())

})
}

func (suite *errorsSuite) TestUpdateError() {
suite.Run("UpdateError error function message", func() {
id := uuid.Must(uuid.NewV4())
errorMessage := "This is an Update Error"
updateError := NewUpdateError(id, errorMessage)
suite.Equal("Update Error "+errorMessage, updateError.Error())

})
}

func (suite *errorsSuite) TestPPMNotReadyForCloseoutError() {
suite.Run("PPMNotReadyForCloseoutError error function message", func() {
id := uuid.Must(uuid.NewV4())
errorMessage := "This is a PPM Not Ready For Closeout Error"
ppmNotReadyForCloseoutError := NewPPMNotReadyForCloseoutError(id, errorMessage)
suite.Equal("ID: "+id.String()+" - PPM Shipment is not ready for closeout. Customer must upload PPM documents. "+errorMessage, ppmNotReadyForCloseoutError.Error())

})
}

func (suite *errorsSuite) TestPPMNoWeightTicketsError() {
suite.Run("PPMNoWeightTicketsError error function message", func() {
id := uuid.Must(uuid.NewV4())
errorMessage := "This is a PPM No Weight Tickets Error"
pPMNoWeightTicketsError := NewPPMNoWeightTicketsError(id, errorMessage)
suite.Equal("ID: "+id.String()+" - PPM Shipment has no weight tickets assigned to it, can't calculate any weights. "+errorMessage, pPMNoWeightTicketsError.Error())

})
}

func (suite *errorsSuite) TestBadDataError() {
suite.Run("BadDataError error function message", func() {
errorMessage := "This is a Bad Data Error"
badDataError := NewBadDataError(errorMessage)
suite.Equal(fmt.Sprintf("Data received from requester is bad: %s: %s", badDataError.baseError.code, errorMessage), badDataError.Error())
})
}

func (suite *errorsSuite) TestUnsupportedPostalCodeError() {
suite.Run("UnsupportedPostalCodeError error function message", func() {
postalCode := "36022"
reason := "This postal code is not supported"
unsupportedPostalCodeError := NewUnsupportedPostalCodeError(postalCode, reason)
suite.Equal(fmt.Sprintf("Unsupported postal code (%s): %s", postalCode, reason), unsupportedPostalCodeError.Error())
})
}

func (suite *errorsSuite) TestUnsupportedPortCodeError() {
suite.Run("UnsupportedPortCodeError error function message", func() {
portCode := "ABC"
reason := "This port code is not legit"
unsupportedPortCode := NewUnsupportedPortCodeError(portCode, reason)
suite.Equal(fmt.Sprintf("Unsupported port code (%s): %s", portCode, reason), unsupportedPortCode.Error())
})
}

func (suite *errorsSuite) TestInvalidInputError() {
suite.Run("InvalidInputError error function returns the message when it's not empty", func() {
id := uuid.Must(uuid.NewV4())
err := errors.New("Invalid Input Error")
verrs := validate.NewErrors()
fieldWithErr := "field"
fieldErrorMsg := "Field error"
verrs.Add(fieldWithErr, fieldErrorMsg)
message := "Error messagefor an invalid input"
invalidInputError := NewInvalidInputError(id, err, verrs, message)
suite.Equal(message, invalidInputError.Error())
})

suite.Run("InvalidInputError error function with no message but validation errors returns correct message", func() {
id := uuid.Must(uuid.NewV4())
err := errors.New("Invalid Input Error")
verrs := validate.NewErrors()
fieldWithErr := "field"
fieldErrorMsg := "Field error"
verrs.Add(fieldWithErr, fieldErrorMsg)
message := ""
invalidInputError := NewInvalidInputError(id, err, verrs, message)
suite.Equal(fmt.Sprintf("Invalid input for ID: %s. %s", id.String(), verrs), invalidInputError.Error())
})
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p><strong>***</strong> DO NOT REPLY directly to this email <strong>***</strong></p>

<p>This is a reminder that your PPM with the <strong>assigned move code {{.Locator}}</strong> from
<strong>{{.OriginDutyLocation}}</strong> to <strong>{{.DestinationDutyLocation}}</strong> is awaiting action in MilMove.</p>
<strong>{{.OriginDutyLocation}}</strong> to <strong>{{.DestinationLocation}}</strong> is awaiting action in MilMove.</p>

<p>Next steps:</p>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*** DO NOT REPLY directly to this email ***

This is a reminder that your PPM with the assigned move code {{.Locator}} from {{.OriginDutyLocation}}
to {{.DestinationDutyLocation}} is awaiting action in MilMove.
to {{.DestinationLocation}} is awaiting action in MilMove.

Next steps:

Expand Down
8 changes: 4 additions & 4 deletions pkg/factory/address_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func BuildAddress(db *pop.Connection, customs []Customization, traits []Trait) m
City: "Beverly Hills",
State: "CA",
PostalCode: "90210",
County: "LOS ANGELES",
County: models.StringPointer("LOS ANGELES"),
IsOconus: models.BoolPointer(false),
}

Expand Down Expand Up @@ -62,14 +62,14 @@ func BuildAddress(db *pop.Connection, customs []Customization, traits []Trait) m
county, err := models.FindCountyByZipCode(db, address.PostalCode)
if err != nil {
// A zip code that is not being tracked has been entered
address.County = "does not exist"
address.County = models.StringPointer("does not exist")
} else {
// The zip code successfully found a county
address.County = county
}
} else if db == nil && address.PostalCode != "90210" {
// If no db supplied, mark that
address.County = "db nil when created"
address.County = models.StringPointer("db nil when created")
}

// If db is false, it's a stub. No need to create in database.
Expand Down Expand Up @@ -98,7 +98,7 @@ func BuildMinimalAddress(db *pop.Connection, customs []Customization, traits []T
City: "Fort Gorden",
State: "GA",
PostalCode: "30813",
County: "RICHMOND",
County: models.StringPointer("RICHMOND"),
IsOconus: models.BoolPointer(false),
}

Expand Down
14 changes: 7 additions & 7 deletions pkg/factory/address_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (suite *FactorySuite) TestBuildAddress() {
customCity := "Modesto"
customState := "ID"
customPostalCode := "83725"
customCounty := "ADA"
customCounty := models.StringPointer("ADA")
suite.Run("Successful creation of default address", func() {
// Under test: BuildAddress
// Mocked: None
Expand All @@ -39,7 +39,7 @@ func (suite *FactorySuite) TestBuildAddress() {
suite.Equal(defaultState, address.State)
suite.Equal(defaultPostalCode, address.PostalCode)
suite.Equal(country.ID, *address.CountryId)
suite.Equal(defaultCounty, address.County)
suite.Equal(defaultCounty, *address.County)
})

suite.Run("Successful creation of an address with customization", func() {
Expand Down Expand Up @@ -100,7 +100,7 @@ func (suite *FactorySuite) TestBuildAddress() {
suite.Equal("CA", address.State)
suite.Equal("94535", address.PostalCode)
suite.Equal(country.ID, *address.CountryId)
suite.Equal("SOLANO", address.County)
suite.Equal("SOLANO", *address.County)
})

suite.Run("Successful creation of address with both", func() {
Expand Down Expand Up @@ -130,7 +130,7 @@ func (suite *FactorySuite) TestBuildAddress() {
suite.Equal("IA", address.State)
suite.Equal("50309", address.PostalCode)
suite.Equal(country.ID, *address.CountryId)
suite.Equal("POLK", address.County)
suite.Equal("POLK", *address.County)
})

suite.Run("Successful creation of stubbed address", func() {
Expand Down Expand Up @@ -159,7 +159,7 @@ func (suite *FactorySuite) TestBuildAddress() {
suite.Equal("Houston", address.City)
suite.Equal("TX", address.State)
suite.Equal("77083", address.PostalCode)
suite.Equal("db nil when created", address.County)
suite.Equal("db nil when created", *address.County)

// Count how many addresses are in the DB, no new addresses should have been created
count, err := suite.DB().Count(&models.Address{})
Expand All @@ -186,7 +186,7 @@ func (suite *FactorySuite) TestBuildAddress() {
City: customCity,
State: customState,
PostalCode: customPostalCode,
County: "County",
County: customCounty,
IsOconus: models.BoolPointer(false),
},
LinkOnly: true,
Expand All @@ -204,7 +204,7 @@ func (suite *FactorySuite) TestBuildAddress() {
suite.Equal(customCity, address.City)
suite.Equal(customState, address.State)
suite.Equal(customPostalCode, address.PostalCode)
suite.Equal("County", address.County)
suite.Equal(customCounty, address.County)
})
}

Expand Down
Loading

0 comments on commit c95d899

Please sign in to comment.