Skip to content

Commit

Permalink
refactored test
Browse files Browse the repository at this point in the history
  • Loading branch information
samaysofo committed Feb 25, 2025
1 parent b35ab79 commit 01898bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ func (suite *MTOServiceItemServiceSuite) TestCreateOriginSITServiceItem() {
},
}, nil)
builder := query.NewQueryBuilder()
moveRouter := moverouter.NewMoveRouter()
moveRouter := moverouter.NewMoveRouter(transportationoffice.NewTransportationOfficesFetcher())
planner := &mocks.Planner{}
planner.On("ZipTransitDistance",
mock.AnythingOfType("*appcontext.appContext"),
Expand Down Expand Up @@ -1334,7 +1334,7 @@ func (suite *MTOServiceItemServiceSuite) TestCreateOriginSITServiceItem() {
},
}, nil)
builder := query.NewQueryBuilder()
moveRouter := moverouter.NewMoveRouter()
moveRouter := moverouter.NewMoveRouter(transportationoffice.NewTransportationOfficesFetcher())
planner := &mocks.Planner{}
planner.On("ZipTransitDistance",
mock.AnythingOfType("*appcontext.appContext"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,20 @@ func (suite *TransportationOfficeServiceSuite) Test_FindCounselingOfficeForPrime
})

suite.Run("failure - not found duty location returns error", func() {
_, oconusRateArea, _, _ := setupDataForOconusSearchCounselingOffice("99619", "MAPS")

// setup department affiliation to GBLOC mappings
jppsoRegion, err := models.FetchJppsoRegionByCode(suite.DB(), "MAPS")
suite.NotNil(jppsoRegion)
suite.Nil(err)
gblocAors, err := models.FetchGblocAorsByJppsoCodeRateAreaDept(suite.DB(), jppsoRegion.ID, oconusRateArea.ID, models.DepartmentIndicatorARMY.String())
suite.NotNil(gblocAors)
suite.Nil(err)
appCtx := suite.AppContextWithSessionForTest(&auth.Session{
ServiceMemberID: uuid.Must(uuid.NewV4()),
})
unknown_duty_location_id := uuid.Must(uuid.NewV4())
offices, err := findCounselingOffice(appCtx, unknown_duty_location_id, appCtx.Session().ServiceMemberID)
suite.Nil(offices)
_, err = suite.toFetcher.FindCounselingOfficeForPrimeCounseled(appCtx, unknown_duty_location_id, appCtx.Session().ServiceMemberID)
suite.NotNil(err)
})

Expand Down

0 comments on commit 01898bf

Please sign in to comment.