From c24fb5a10dbf1dbbd62c03193a61b40a7f727eda Mon Sep 17 00:00:00 2001 From: Ben Calegari Date: Mon, 13 Jun 2022 12:51:59 -0700 Subject: [PATCH] Set NPIs for all CountyRoutingDestinations - Counties must have at least dhs provider ids, emails, and phone numbers (address optional) no more no-args constructor leading to weird null's in application IDs - Simplify env set up to be either prod or non-prod, the only difference should be the NPIs and help emails [#182255304] --- .../shiba/mnit/CountyMapConfiguration.java | 983 +++++------------- .../shiba/mnit/CountyRoutingDestination.java | 10 +- .../shiba/ResubmissionServiceTest.java | 29 +- .../RoutingDestinationMessageServiceTest.java | 6 +- .../ApplicationStatusRepositoryTest.java | 7 +- .../mnit/FilenetWebServiceClientTest.java | 14 +- .../CoverPagePreparerTest.java | 10 +- .../FilenameGeneratorTest.java | 76 +- .../MailingAddressStreetPreparerTest.java | 9 +- 9 files changed, 352 insertions(+), 792 deletions(-) diff --git a/src/main/java/org/codeforamerica/shiba/mnit/CountyMapConfiguration.java b/src/main/java/org/codeforamerica/shiba/mnit/CountyMapConfiguration.java index 499660de4..1c99b6e78 100644 --- a/src/main/java/org/codeforamerica/shiba/mnit/CountyMapConfiguration.java +++ b/src/main/java/org/codeforamerica/shiba/mnit/CountyMapConfiguration.java @@ -1,10 +1,95 @@ package org.codeforamerica.shiba.mnit; -import static org.codeforamerica.shiba.County.*; +import static org.codeforamerica.shiba.County.Aitkin; +import static org.codeforamerica.shiba.County.Anoka; +import static org.codeforamerica.shiba.County.Becker; +import static org.codeforamerica.shiba.County.Beltrami; +import static org.codeforamerica.shiba.County.Benton; +import static org.codeforamerica.shiba.County.BigStone; +import static org.codeforamerica.shiba.County.BlueEarth; +import static org.codeforamerica.shiba.County.Brown; +import static org.codeforamerica.shiba.County.Carlton; +import static org.codeforamerica.shiba.County.Carver; +import static org.codeforamerica.shiba.County.Cass; +import static org.codeforamerica.shiba.County.Chippewa; +import static org.codeforamerica.shiba.County.Chisago; +import static org.codeforamerica.shiba.County.Clay; +import static org.codeforamerica.shiba.County.Clearwater; +import static org.codeforamerica.shiba.County.Cook; +import static org.codeforamerica.shiba.County.Cottonwood; +import static org.codeforamerica.shiba.County.CrowWing; +import static org.codeforamerica.shiba.County.Dakota; +import static org.codeforamerica.shiba.County.Dodge; +import static org.codeforamerica.shiba.County.Douglas; +import static org.codeforamerica.shiba.County.Faribault; +import static org.codeforamerica.shiba.County.Fillmore; +import static org.codeforamerica.shiba.County.Freeborn; +import static org.codeforamerica.shiba.County.Goodhue; +import static org.codeforamerica.shiba.County.Grant; +import static org.codeforamerica.shiba.County.Hennepin; +import static org.codeforamerica.shiba.County.Houston; +import static org.codeforamerica.shiba.County.Hubbard; +import static org.codeforamerica.shiba.County.Isanti; +import static org.codeforamerica.shiba.County.Itasca; +import static org.codeforamerica.shiba.County.Jackson; +import static org.codeforamerica.shiba.County.Kanabec; +import static org.codeforamerica.shiba.County.Kandiyohi; +import static org.codeforamerica.shiba.County.Kittson; +import static org.codeforamerica.shiba.County.Koochiching; +import static org.codeforamerica.shiba.County.LacQuiParle; +import static org.codeforamerica.shiba.County.Lake; +import static org.codeforamerica.shiba.County.LakeOfTheWoods; +import static org.codeforamerica.shiba.County.LeSueur; +import static org.codeforamerica.shiba.County.Lincoln; +import static org.codeforamerica.shiba.County.Lyon; +import static org.codeforamerica.shiba.County.Mahnomen; +import static org.codeforamerica.shiba.County.Marshall; +import static org.codeforamerica.shiba.County.Martin; +import static org.codeforamerica.shiba.County.McLeod; +import static org.codeforamerica.shiba.County.Meeker; +import static org.codeforamerica.shiba.County.MilleLacs; +import static org.codeforamerica.shiba.County.Morrison; +import static org.codeforamerica.shiba.County.Mower; +import static org.codeforamerica.shiba.County.Murray; +import static org.codeforamerica.shiba.County.Nicollet; +import static org.codeforamerica.shiba.County.Nobles; +import static org.codeforamerica.shiba.County.Norman; +import static org.codeforamerica.shiba.County.Olmsted; +import static org.codeforamerica.shiba.County.OtterTail; +import static org.codeforamerica.shiba.County.Pennington; +import static org.codeforamerica.shiba.County.Pine; +import static org.codeforamerica.shiba.County.Pipestone; +import static org.codeforamerica.shiba.County.Polk; +import static org.codeforamerica.shiba.County.Pope; +import static org.codeforamerica.shiba.County.Ramsey; +import static org.codeforamerica.shiba.County.RedLake; +import static org.codeforamerica.shiba.County.Redwood; +import static org.codeforamerica.shiba.County.Renville; +import static org.codeforamerica.shiba.County.Rice; +import static org.codeforamerica.shiba.County.Rock; +import static org.codeforamerica.shiba.County.Roseau; +import static org.codeforamerica.shiba.County.Scott; +import static org.codeforamerica.shiba.County.Sherburne; +import static org.codeforamerica.shiba.County.Sibley; +import static org.codeforamerica.shiba.County.StLouis; +import static org.codeforamerica.shiba.County.Stearns; +import static org.codeforamerica.shiba.County.Steele; +import static org.codeforamerica.shiba.County.Stevens; +import static org.codeforamerica.shiba.County.Swift; +import static org.codeforamerica.shiba.County.Todd; +import static org.codeforamerica.shiba.County.Traverse; +import static org.codeforamerica.shiba.County.Wabasha; +import static org.codeforamerica.shiba.County.Wadena; +import static org.codeforamerica.shiba.County.Waseca; +import static org.codeforamerica.shiba.County.Washington; +import static org.codeforamerica.shiba.County.Watonwan; +import static org.codeforamerica.shiba.County.Wilkin; +import static org.codeforamerica.shiba.County.Winona; +import static org.codeforamerica.shiba.County.Wright; +import static org.codeforamerica.shiba.County.YellowMedicine; import org.codeforamerica.shiba.County; import org.codeforamerica.shiba.CountyMap; -import org.codeforamerica.shiba.mnit.CountyRoutingDestination.CountyRoutingDestinationBuilder; import org.codeforamerica.shiba.pages.enrichment.Address; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -15,283 +100,12 @@ public class CountyMapConfiguration { private CountyMap countyMap; + private final String DEV_EMAIL = "help+dev@mnbenefits.org"; @Bean - @Profile({"default", "test"}) - CountyMap localMapping() { + @Profile({"default", "test", "dev", "atst"}) + CountyMap nonProdMapping() { initializeDefaultCountyMap(); - countyMap.setDefaultValue(countyMap.get(Hennepin)); - return countyMap; - } - - @Bean - @Profile({"dev", "atst"}) - CountyMap demoMapping() { - initializeDefaultCountyMap(); - - updateCounty(Aitkin, - "help+staging@mnbenefits.org", - "A000001900"); - updateCounty(Anoka, - "help+staging@mnbenefits.org", - "1023250115"); - updateCounty(Becker, - "help+staging@mnbenefits.org", - "A000003500"); - updateCounty(Beltrami, - "help+staging@mnbenefits.org", - "A000004300"); - updateCounty(Benton, - "help+staging@mnbenefits.org", - "1174697148"); - updateCounty(BigStone, - "help+staging@mnbenefits.org", - "A000006000"); - updateCounty(BlueEarth, - "help+staging@mnbenefits.org", - "A000007800"); - updateCounty(Brown, - "help+staging@mnbenefits.org", - "A000008600"); - updateCounty(Carlton, - "help+staging@mnbenefits.org", - "1003921875"); - updateCounty(Carver, - "help+staging@mnbenefits.org", - "A000010800"); - updateCounty(Cass, - "help+staging@mnbenefits.org", - "1760489769"); - updateCounty(Chippewa, - "help+staging@mnbenefits.org", - "A000012400"); - updateCounty(Chisago, - "help+staging@mnbenefits.org", - "1659408904"); - updateCounty(Clay, - "help+staging@mnbenefits.org", - "A000014100"); - updateCounty(Clearwater, - "help+staging@mnbenefits.org", - "A000015900"); - updateCounty(Cook, - "help+staging@mnbenefits.org", - "A000016700"); - updateCounty(Cottonwood, - "help+staging@mnbenefits.org", - "A000017500"); - updateCounty(CrowWing, - "help+staging@mnbenefits.org", - "A000018300"); - updateCounty(Dakota, - "help+staging@mnbenefits.org", - "1427127620"); - updateCounty(Dodge, - "help+staging@mnbenefits.org", - "A000020500"); - updateCounty(Douglas, - "help+staging@mnbenefits.org", - "A000021300"); - updateCounty(Faribault, - "help+staging@mnbenefits.org", - "A000022100"); - updateCounty(Fillmore, - "help+staging@mnbenefits.org", - "1437228236"); - updateCounty(Freeborn, - "help+staging@mnbenefits.org", - "A000024800"); - updateCounty(Goodhue, - "help+staging@mnbenefits.org", - "A000025600"); - //Grant and Pope are merged, now using Pope NPI - updateCounty(Grant, - "help+staging@mnbenefits.org", - "A000061200"); - updateCounty(Hennepin, - "help+staging@mnbenefits.org", - "A000027200"); - updateCounty(Houston, - "help+staging@mnbenefits.org", - "A000028100"); - updateCounty(Hubbard, - "help+staging@mnbenefits.org", - "A000029900"); - updateCounty(Isanti, - "help+staging@mnbenefits.org", - "A000030200"); - updateCounty(Itasca, - "help+staging@mnbenefits.org", - "A000031100"); - updateCounty(Jackson, - "help+staging@mnbenefits.org", - "A000032900"); - updateCounty(Kanabec, - "help+staging@mnbenefits.org", - "1396819108"); - updateCounty(Kandiyohi, - "help+staging@mnbenefits.org", - "A000034500"); - updateCounty(Kittson, - "help+staging@mnbenefits.org", - "A000035300"); - updateCounty(Koochiching, - "help+staging@mnbenefits.org", - "A000036100"); - updateCounty(LacQuiParle, - "help+staging@mnbenefits.org", - "A000037000"); - updateCounty(Lake, - "help+staging@mnbenefits.org", - "A000038800"); - updateCounty(LakeOfTheWoods, - "help+staging@mnbenefits.org", - "A000039600"); - updateCounty(LeSueur, - "help+staging@mnbenefits.org", - "A000040000"); - updateCounty(Lincoln, - "help+staging@mnbenefits.org", - "A000041800"); - updateCounty(Lyon, - "help+staging@mnbenefits.org", - "A000042600"); - updateCounty(McLeod, - "help+staging@mnbenefits.org", - "A000043400"); - updateCounty(Mahnomen, - "help+staging@mnbenefits.org", - "A000044200"); - updateCounty(Marshall, - "help+staging@mnbenefits.org", - "A000045100"); - updateCounty(Martin, - "help+staging@mnbenefits.org", - "A000046900"); - updateCounty(Meeker, - "help+staging@mnbenefits.org", - "A000047700"); - updateCounty(MilleLacs, - "help+staging@mnbenefits.org", - "A000048500"); - updateCounty(Morrison, - "help+staging@mnbenefits.org", - "1255406286"); - updateCounty(Mower, - "help+staging@mnbenefits.org", - "M000050700"); - updateCounty(Murray, - "help+staging@mnbenefits.org", - "M000051500"); - updateCounty(Nicollet, - "help+staging@mnbenefits.org", - "M000052300"); - updateCounty(Nobles, - "help+staging@mnbenefits.org", - "M000053100"); - updateCounty(Norman, - "help+staging@mnbenefits.org", - "A000054000"); - updateCounty(Olmsted, - "help+staging@mnbenefits.org", - "A000055800"); - updateCounty(OtterTail, - "help+staging@mnbenefits.org", - "A000056600"); - updateCounty(Pennington, - "help+staging@mnbenefits.org", - "A000057400"); - updateCounty(Pine, - "help+staging@mnbenefits.org", - "A000058200"); - updateCounty(Pipestone, - "help+staging@mnbenefits.org", - "A000059100"); - updateCounty(Polk, - "help+staging@mnbenefits.org", - "A000060400"); - updateCounty(Pope, - "help+staging@mnbenefits.org", - "A000061200"); - updateCounty(Ramsey, - "help+staging@mnbenefits.org", - "1811055957"); - updateCounty(RedLake, - "help+staging@mnbenefits.org", - "A000063900"); - updateCounty(Redwood, - "help+staging@mnbenefits.org", - "A000064700"); - updateCounty(Renville, - "help+staging@mnbenefits.org", - "M000065500"); - updateCounty(Rice, - "help+staging@mnbenefits.org", - "M000066300"); - updateCounty(Rock, - "help+staging@mnbenefits.org", - "M000067100"); - updateCounty(Roseau, - "help+staging@mnbenefits.org", - "A000068000"); - updateCounty(Scott, - "help+staging@mnbenefits.org", - "A000070100"); - updateCounty(Sherburne, - "help+staging@mnbenefits.org", - "1447381660"); - updateCounty(Sibley, - "help+staging@mnbenefits.org", - "A000072800"); - updateCounty(Stearns, - "help+staging@mnbenefits.org", - "A000073600"); - updateCounty(Steele, - "help+staging@mnbenefits.org", - "A000074400"); - updateCounty(Stevens, - "help+staging@mnbenefits.org", - "A000075200"); - updateCounty(StLouis, - "help+staging@mnbenefits.org", - "A000069800"); - updateCounty(Swift, - "help+staging@mnbenefits.org", - "A000076100"); - updateCounty(Todd, - "help+staging@mnbenefits.org", - "1336372465"); - updateCounty(Traverse, - "help+staging@mnbenefits.org", - "A000078700"); - updateCounty(Wabasha, - "help+staging@mnbenefits.org", - "A000079500"); - updateCounty(Wadena, - "help+staging@mnbenefits.org", - "A000080900"); - updateCounty(Waseca, - "help+staging@mnbenefits.org", - "A000081700"); - updateCounty(Washington, - "help+staging@mnbenefits.org", - "1700969334"); - updateCounty(Watonwan, - "help+staging@mnbenefits.org", - "1942539846"); - updateCounty(Wilkin, - "help+staging@mnbenefits.org", - "1962567529"); - updateCounty(Winona, - "help+staging@mnbenefits.org", - "A000085000"); - updateCounty(Wright, - "help+staging@mnbenefits.org", - "1124197249"); - updateCounty(YellowMedicine, - "help+staging@mnbenefits.org", - "A000087600"); - countyMap.setDefaultValue(countyMap.get(Hennepin)); return countyMap; } @@ -299,444 +113,205 @@ CountyMap demoMapping() { @Profile("production") CountyMap productionMapping() { initializeDefaultCountyMap(); - updateCounty(Aitkin, - "achhs@co.aitkin.mn.us", - "A000001900"); - updateCounty(Anoka, - "EADocs@co.anoka.mn.us", - "1023250115"); - updateCounty(Becker, - "hsosu2@co.becker.mn.us", - "A000003500"); - updateCounty(Beltrami, - "BeltramiCoPubAssntOffice-DO-NOT-REPLY@co.beltrami.mn.us", - "A000004300"); - updateCounty(Benton, - "financial@co.benton.mn.us", - "1174697148"); - updateCounty(BigStone, - "familyservicecenter@bigstonecounty.org", - "A000006000"); - updateCounty(BlueEarth, - "DeAnn.Boney@blueearthcountymn.gov", - "A000007800"); - updateCounty(Brown, - "FrontDesk1@co.brown.mn.us", - "A000008600"); - updateCounty(Carlton, - "IMOSS@co.carlton.mn.us", - "1003921875"); - updateCounty(Carver, - "cssfinancial@co.carver.mn.us", - "A000010800"); - updateCounty(Cass, - "cass.socserv@co.cass.mn.us", - "1760489769"); - updateCounty(Chippewa, - "Tracy.kittelson@chippewa.mn", - "A000012400"); - updateCounty(Chisago, - "hhsim@chisagocounty.us", - "1659408904"); - updateCounty(Clay, - "social.services@co.clay.mn.us", - "A000014100"); - updateCounty(Clearwater, - "samantha.coyle@co.clearwater.mn.us", - "A000015900"); - updateCounty(Cook, - "economic.assistance@co.cook.mn.us", - "A000016700"); - updateCounty(Cottonwood, - "financial@dvhhs.org", - "A000017500"); - updateCounty(CrowWing, - "cwcss@crowwing.us", - "A000018300"); - updateCounty(Dakota, - "EEARIGAppResearch@CO.DAKOTA.MN.US", - "1427127620"); - updateCounty(Dodge, - "OSS@MNPrairie.org", - "A000020500"); - updateCounty(Douglas, - "dcss@co.douglass.mn.us", - "A000021300"); - updateCounty(Faribault, - "lea.silverthorn@fmchs.com ", - "A000022100"); - updateCounty(Fillmore, - "SS-FAX@co.fillmore.mn.us", - "1437228236"); - updateCounty(Freeborn, - "im.dhs@co.freeborn.mn.us", - "A000024800"); - updateCounty(Goodhue, - "hhs.imu@co.goodhue.mn.us", - "A000025600"); - // Grant and Pope counties merged, now using Pope NPI and folder id - updateCounty(Grant, - "crystal.zaviska@westernprairiemn.us", - "A000061200"); - updateCounty(Hennepin, - "hhsews@hennepin.us", - "A000027200"); - updateCounty(Houston, - "dhsinfo@co.houston.mn.us", - "A000028100"); - updateCounty(Hubbard, - "beth.vredenburg@co.hubbard.mn.us", - "A000029900"); - updateCounty(Isanti, - "Jennifer.Ann.Johnson@co.isanti.mn.us", - "A000030200"); - updateCounty(Itasca, - "FAUsupport@co.itasca.mn.us", - "A000031100"); - updateCounty(Jackson, - "financial@dvhhs.org", - "A000032900"); - updateCounty(Kanabec, - "family.services@co.kanabec.mn.us", - "1396819108"); - updateCounty(Kandiyohi, - "hs-financial@kcmn.us", - "A000034500"); - updateCounty(Kittson, - "bseed@co.kittson.mn.us", - "A000035300"); - updateCounty(Koochiching, - "valerie.long@co.koochiching.mn.us", - "A000036100"); - updateCounty(LacQuiParle, - "familyservices@co.lac-qui-parle.mn.us", - "A000037000"); - updateCounty(Lake, - "financial.assistance@co.lake.mn.us", - "A000038800"); - updateCounty(LakeOfTheWoods, - "cassondra_b@co.lotw.mn.us", - "A000039600"); - updateCounty(LeSueur, - "IMDocs@co.le-sueur.mn.us", - "A000040000"); - updateCounty(Lincoln, - "ivanhoe.frontdesk@swmhhs.com", - "A000041800"); - updateCounty(Lyon, - "marshallss.frontdesk@swmhhs.com", - "A000042600"); - updateCounty(McLeod, - "mcleod.fw@co.mcleod.mn.us", - "A000043400"); - updateCounty(Mahnomen, - "info@co.mahnomen.mn.us", - "A000044200"); - updateCounty(Marshall, - "sarah.noble@co.marshall.mn.us", - "A000045100"); - updateCounty(Martin, - "lea.silverthorn@fmchs.com", - "A000046900"); - updateCounty(Meeker, - "socserv.info@co.meeker.mn.us", - "A000047700"); - updateCounty(MilleLacs, - "Beth.Sumner@millelacs.mn.gov", - "A000048500"); - updateCounty(Morrison, - "callcenter@co.morrison.mn.us", - "1255406286"); - updateCounty(Mower, - "dhsrecep@co.mower.mn.us", - "M000050700"); - updateCounty(Murray, - "slayton.frontdesk@swmhhs.com", - "M000051500"); - updateCounty(Nicollet, - "hhsinfo@co.nicollet.mn.us", - "1083845127"); - updateCounty(Nobles, - "CommunityServices@co.nobles.mn.us", - "M000053100"); - updateCounty(Norman, - "mary.doyea@co.norman.mn.us", - "A000054000"); - updateCounty(Olmsted, - "PAQ@co.olmsted.mn.us", - "A000055800"); - updateCounty(OtterTail, - "imques@co.ottertail.mn.us", - "A000056600"); - updateCounty(Pennington, - "Afcasebank@co.pennington.mn.us", - "A000057400"); - updateCounty(Pine, - "income.proof@co.pine.mn.us", - "A000058200"); - updateCounty(Pipestone, - "pipestone.frontdesk@swmhhs.com", - "A000059100"); - updateCounty(Polk, - "ssoss@co.polk.mn.us", - "A000060400"); - //Grant and Pope merged into Western Prairie, using Pope NPI and westernprairie email - updateCounty(Pope, - "crystal.zaviska@westernprairiemn.us", - "A000061200"); - updateCounty(Ramsey, - "CHSFASScreeners@co.ramsey.mn.us", - "1811055957"); - updateCounty(RedLake, - "sswintake@mail.co.red-lake.mn.us", - "A000063900"); - updateCounty(Redwood, - "Redwood.frontdesk@swmhhs.com", - "A000064700"); - updateCounty(Renville, - "hs@renvillecountymn.com", - "M000065500"); - updateCounty(Rice, - "RCsocialservices@co.rice.mn.com", - "M000066300"); - updateCounty(Rock, - "luverne.frontdesk@swmhhs.com", - "M000067100"); - updateCounty(Roseau, - "case.bank@co.roseau.mn.us", - "A000068000"); - updateCounty(Scott, - "scottcountyincomemaintenance@co.scott.mn.us", - "A000070100"); - updateCounty(Sherburne, - "PADocs@co.sherburne.mn.us", - "1447381660"); - updateCounty(Sibley, - "ContactPHHS@co.sibley.mn.us", - "A000072800"); - updateCounty(Stearns, - "HSGatewayOSIII@co.stearns.mn.us", - "A000073600"); - updateCounty(Steele, - "OSS@MNPrairie.org", - "A000074400"); - updateCounty(Stevens, - "mariaburns@co.stevens.mn.us", - "A000075200"); - updateCounty(StLouis, - "ESS@stlouiscountymn.gov", - "A000069800"); - updateCounty(Swift, - "julie.jahn@co.swift.mn.us", - "A000076100"); - updateCounty(Todd, - "Ricoh@co.todd.mn.us", - "1336372465"); - updateCounty(Traverse, - "stacey.hennen@co.traverse.mn.us", - "A000078700"); - updateCounty(Wabasha, - "imuinterview@co.wabasha.mn.us", - "A000079500"); - updateCounty(Wadena, - "wchs.benefits@co.wadena.mn.us", - "A000080900"); - updateCounty(Waseca, - "OSS@MNPrairie.org", - "A000081700"); - updateCounty(Washington, - "stephanie.schlageter@co.washington.mn.us", - "1700969334"); - updateCounty(Watonwan, - "randee.nelson@co.watonwan.mn.us", - "1942539846"); - updateCounty(Wilkin, - "cnoetzelman@co.wilkin.mn.us", - "1962567529"); - updateCounty(Winona, - "dhs@co.winona.mn.us", - "A000085000"); - updateCounty(Wright, - "HSFSPrograms@co.wright.mn.us", - "1124197249"); - updateCounty(YellowMedicine, - "robin.schoep@co.ym.mn.gov", - "A000087600"); + updateCounty(Aitkin, "achhs@co.aitkin.mn.us", "A000001900"); + updateCounty(Anoka, "EADocs@co.anoka.mn.us", "1023250115"); + updateCounty(Becker, "hsosu2@co.becker.mn.us", "A000003500"); + updateCounty(Beltrami, "BeltramiCoPubAssntOffice-DO-NOT-REPLY@co.beltrami.mn.us", "A000004300"); + updateCounty(Benton, "financial@co.benton.mn.us", "1174697148"); + updateCounty(BigStone, "familyservicecenter@bigstonecounty.org", "A000006000"); + updateCounty(BlueEarth, "DeAnn.Boney@blueearthcountymn.gov", "A000007800"); + updateCounty(Brown, "FrontDesk1@co.brown.mn.us", "A000008600"); + updateCounty(Carlton, "IMOSS@co.carlton.mn.us", "1003921875"); + updateCounty(Carver, "cssfinancial@co.carver.mn.us", "A000010800"); + updateCounty(Cass, "cass.socserv@co.cass.mn.us", "1760489769"); + updateCounty(Chippewa, "Tracy.kittelson@chippewa.mn", "A000012400"); + updateCounty(Chisago, "hhsim@chisagocounty.us", "1659408904"); + updateCounty(Clay, "social.services@co.clay.mn.us", "A000014100"); + updateCounty(Clearwater, "samantha.coyle@co.clearwater.mn.us", "A000015900"); + updateCounty(Cook, "economic.assistance@co.cook.mn.us", "A000016700"); + updateCounty(Cottonwood, "financial@dvhhs.org", "A000017500"); + updateCounty(CrowWing, "cwcss@crowwing.us", "A000018300"); + updateCounty(Dakota, "EEARIGAppResearch@CO.DAKOTA.MN.US", "1427127620"); + updateCounty(Dodge, "OSS@MNPrairie.org", "A000020500"); + updateCounty(Douglas, "dcss@co.douglass.mn.us", "A000021300"); + updateCounty(Faribault, "lea.silverthorn@fmchs.com ", "A000022100"); + updateCounty(Fillmore, "SS-FAX@co.fillmore.mn.us", "1437228236"); + updateCounty(Freeborn, "im.dhs@co.freeborn.mn.us", "A000024800"); + updateCounty(Goodhue, "hhs.imu@co.goodhue.mn.us", "A000025600"); + // Grant and Pope merged into Western Prairie, using Pope NPI and Western Prairie email + updateCounty(Grant, "crystal.zaviska@westernprairiemn.us", "A000061200"); + updateCounty(Hennepin, "hhsews@hennepin.us", "A000027200"); + updateCounty(Houston, "dhsinfo@co.houston.mn.us", "A000028100"); + updateCounty(Hubbard, "beth.vredenburg@co.hubbard.mn.us", "A000029900"); + updateCounty(Isanti, "Jennifer.Ann.Johnson@co.isanti.mn.us", "A000030200"); + updateCounty(Itasca, "FAUsupport@co.itasca.mn.us", "A000031100"); + updateCounty(Jackson, "financial@dvhhs.org", "A000032900"); + updateCounty(Kanabec, "family.services@co.kanabec.mn.us", "1396819108"); + updateCounty(Kandiyohi, "hs-financial@kcmn.us", "A000034500"); + updateCounty(Kittson, "bseed@co.kittson.mn.us", "A000035300"); + updateCounty(Koochiching, "valerie.long@co.koochiching.mn.us", "A000036100"); + updateCounty(LacQuiParle, "familyservices@co.lac-qui-parle.mn.us", "A000037000"); + updateCounty(Lake, "financial.assistance@co.lake.mn.us", "A000038800"); + updateCounty(LakeOfTheWoods, "cassondra_b@co.lotw.mn.us", "A000039600"); + updateCounty(LeSueur, "IMDocs@co.le-sueur.mn.us", "A000040000"); + updateCounty(Lincoln, "ivanhoe.frontdesk@swmhhs.com", "A000041800"); + updateCounty(Lyon, "marshallss.frontdesk@swmhhs.com", "A000042600"); + updateCounty(McLeod, "mcleod.fw@co.mcleod.mn.us", "A000043400"); + updateCounty(Mahnomen, "info@co.mahnomen.mn.us", "A000044200"); + updateCounty(Marshall, "sarah.noble@co.marshall.mn.us", "A000045100"); + updateCounty(Martin, "lea.silverthorn@fmchs.com", "A000046900"); + updateCounty(Meeker, "socserv.info@co.meeker.mn.us", "A000047700"); + updateCounty(MilleLacs, "Beth.Sumner@millelacs.mn.gov", "A000048500"); + updateCounty(Morrison, "callcenter@co.morrison.mn.us", "1255406286"); + updateCounty(Mower, "dhsrecep@co.mower.mn.us", "M000050700"); + updateCounty(Murray, "slayton.frontdesk@swmhhs.com", "M000051500"); + updateCounty(Nicollet, "hhsinfo@co.nicollet.mn.us", "1083845127"); + updateCounty(Nobles, "CommunityServices@co.nobles.mn.us", "M000053100"); + updateCounty(Norman, "mary.doyea@co.norman.mn.us", "A000054000"); + updateCounty(Olmsted, "PAQ@co.olmsted.mn.us", "A000055800"); + updateCounty(OtterTail, "imques@co.ottertail.mn.us", "A000056600"); + updateCounty(Pennington, "Afcasebank@co.pennington.mn.us", "A000057400"); + updateCounty(Pine, "income.proof@co.pine.mn.us", "A000058200"); + updateCounty(Pipestone, "pipestone.frontdesk@swmhhs.com", "A000059100"); + updateCounty(Polk, "ssoss@co.polk.mn.us", "A000060400"); + // Grant and Pope merged into Western Prairie, using Pope NPI and Western Prairie email + updateCounty(Pope, "crystal.zaviska@westernprairiemn.us", "A000061200"); + updateCounty(Ramsey, "CHSFASScreeners@co.ramsey.mn.us", "1811055957"); + updateCounty(RedLake, "sswintake@mail.co.red-lake.mn.us", "A000063900"); + updateCounty(Redwood, "Redwood.frontdesk@swmhhs.com", "A000064700"); + updateCounty(Renville, "hs@renvillecountymn.com", "M000065500"); + updateCounty(Rice, "RCsocialservices@co.rice.mn.com", "M000066300"); + updateCounty(Rock, "luverne.frontdesk@swmhhs.com", "M000067100"); + updateCounty(Roseau, "case.bank@co.roseau.mn.us", "A000068000"); + updateCounty(Scott, "scottcountyincomemaintenance@co.scott.mn.us", "A000070100"); + updateCounty(Sherburne, "PADocs@co.sherburne.mn.us", "1447381660"); + updateCounty(Sibley, "ContactPHHS@co.sibley.mn.us", "A000072800"); + updateCounty(Stearns, "HSGatewayOSIII@co.stearns.mn.us", "A000073600"); + updateCounty(Steele, "OSS@MNPrairie.org", "A000074400"); + updateCounty(Stevens, "mariaburns@co.stevens.mn.us", "A000075200"); + updateCounty(StLouis, "ESS@stlouiscountymn.gov", "A000069800"); + updateCounty(Swift, "julie.jahn@co.swift.mn.us", "A000076100"); + updateCounty(Todd, "Ricoh@co.todd.mn.us", "1336372465"); + updateCounty(Traverse, "stacey.hennen@co.traverse.mn.us", "A000078700"); + updateCounty(Wabasha, "imuinterview@co.wabasha.mn.us", "A000079500"); + updateCounty(Wadena, "wchs.benefits@co.wadena.mn.us", "A000080900"); + updateCounty(Waseca, "OSS@MNPrairie.org", "A000081700"); + updateCounty(Washington, "stephanie.schlageter@co.washington.mn.us", "1700969334"); + updateCounty(Watonwan, "randee.nelson@co.watonwan.mn.us", "1942539846"); + updateCounty(Wilkin, "cnoetzelman@co.wilkin.mn.us", "1962567529"); + updateCounty(Winona, "dhs@co.winona.mn.us", "A000085000"); + updateCounty(Wright, "HSFSPrograms@co.wright.mn.us", "1124197249"); + updateCounty(YellowMedicine, "robin.schoep@co.ym.mn.gov", "A000087600"); countyMap.setDefaultValue(countyMap.get(Hennepin)); return countyMap; } private void initializeDefaultCountyMap() { countyMap = new CountyMap<>(); - addCounty(Aitkin, "800-328-3744"); - addCounty(Anoka, - "763-422-7200", - "help+dev@mnbenefits.org", - "1023250115" - ); - addCounty(Becker, "218-847-5628"); - addCounty(Beltrami, "218-333-8300"); - addCounty(Benton, "800-530-6254"); - addCounty(BigStone, "320-839-2555"); - addCounty(BlueEarth, "507-304-4335"); - addCounty(Brown, "800-450-8246"); - addCounty(Carlton, "800-642-9082"); - addCounty(Carver, "952-361-1600", - "help+dev@mnbenefits.org", - "A000010800" - ); - addCounty(Cass, "218-547-1340"); - addCounty(Chippewa, "320-269-6401"); - addCounty(Chisago, "888-234-1246"); - addCounty(Clay, "800-757-3880", - "help+dev@mnbenefits.org", - "A000014100" - ); - addCounty(Clearwater, "800-245-6064"); - addCounty(Cook, - "218-387-3620", - "help+dev@mnbenefits.org", - "A000016700"); - addCounty(Cottonwood, "507-831-1891"); - addCounty(CrowWing, "888-772-8212"); - addCounty(Dakota, "651-554-5611"); - addCounty(Dodge, - "507-923-2900", - "help+dev@mnbenefits.org", - "A000020500"); - addCounty(Douglas, "320-762-2302"); - addCounty(Faribault, "507-526-3265"); - addCounty(Fillmore, "507-765-2175"); - addCounty(Freeborn, "507-377-5400"); - addCounty(Goodhue, "651-385-3200"); - addCounty(Grant, "320-634-7758", //Grant and Pope share same phone number and NPI - "help+dev@mnbenefits.org", - "A000061200"); - addCounty(Hennepin, - "612-596-1300", - "help+dev@mnbenefits.org", - "A000027200", - "100 S 1st St", "Minneapolis", "55401"); - addCounty(Houston, "507-725-5811"); - addCounty(Hubbard, "877-450-1451"); - addCounty(Isanti, "763-689-1711"); - addCounty(Itasca, "800-422-0312"); - addCounty(Jackson, "507-847-4000"); - addCounty(Kanabec, "320-679-6350"); - addCounty(Kandiyohi, "877-464-7800"); - addCounty(Kittson, "800-672-8026"); - addCounty(Koochiching, "800-950-4630"); - addCounty(LacQuiParle, "320-598-7594"); - addCounty(Lake, "218-834-8400"); - addCounty(LakeOfTheWoods, "218-634-2642"); - addCounty(LeSueur, "507-357-8288"); - addCounty(Lincoln, "800-657-3781"); - addCounty(Lyon, "800-657-3760"); - addCounty(McLeod, "800-247-1756"); - addCounty(Mahnomen, "218-935-2568"); - addCounty(Marshall, "800-642-5444"); - addCounty(Martin, "507-238-4757"); - addCounty(Meeker, "877-915-5300"); - addCounty(MilleLacs, "888-270-8208"); - addCounty(Morrison, - "800-269-1464", - "help+dev@mnbenefits.org", - "1255406286"); - addCounty(Mower, "507-437-9700"); - addCounty(Murray, "800-657-3811"); - addCounty(Nicollet, "507-934-8559"); - addCounty(Nobles, "507-295-5213"); - addCounty(Norman, "218-784-5400"); - addCounty(Olmsted, - "507-328-6500", - "help+dev@mnbenefits.org", - "A000055800"); - addCounty(OtterTail, - "218-998-8230", - "help+dev@mnbenefits.org", - "A000056600"); - addCounty(Pennington, "218-681-2880"); - addCounty(Pine, "320-591-1570"); - addCounty(Pipestone, "507-825-6720"); - addCounty(Polk, "877-281-3127"); - addCounty(Pope, "320-634-7758", //Grant and Pope share same phone number and NPI - "help+dev@mnbenefits.org", - "A000061200"); - addCounty(Ramsey, "651-266-4444"); - addCounty(RedLake, "877-294-0846"); - addCounty(Redwood, "888-234-1292"); - addCounty(Renville, "320-523-2202"); - addCounty(Rice, "507-332-6115"); - addCounty(Rock, "507-283-5070"); - addCounty(Roseau, "866-255-2932"); - addCounty(Scott, "952-496-8686"); - addCounty(Sherburne, - "800-433-5239", - "help+dev@mnbenefits.org", - "1447381660"); - addCounty(Sibley, "507-237-4000"); - addCounty(Stearns, "800-450-3663"); - addCounty(Steele, - "507-431-5600", - "help+dev@mnbenefits.org", - "A000074400"); - addCounty(Stevens, "800-950-4429"); - addCounty(StLouis, - "800-450-9777 or 218-726-2101", - "help+dev@mnbenefits.org", - "A000069800"); - addCounty(Swift, "320-843-3160"); - addCounty(Todd, "888-838-4066"); - addCounty(Traverse, "855-735-8916"); - addCounty(Wabasha, - "888-315-8815", - "help+dev@mnbenefits.org", - "A000079500"); - addCounty(Wadena, - "888-662-2737", - "help+dev@mnbenefits.org", - "A000080900"); - addCounty(Waseca, - "507-837-6600", - "help+dev@mnbenefits.org", - "A000081700"); - addCounty(Washington, "651-430-6455"); - addCounty(Watonwan, "888-299-5941"); - addCounty(Wilkin, "218-643-7161"); - addCounty(Winona, "507-457-6200"); - addCounty(Wright, - "800-362-3667", - "help+dev@mnbenefits.org", - "1124197249"); - addCounty(YellowMedicine, "320-564-2211"); - } - - private void addCounty(County county, String phoneNumber, String email, - String dhsProviderId, String mailingStreetAddress, String mailingCity, - String mailingZipcode) { - addCounty(county, CountyRoutingDestination.builder() - .email(email) - .phoneNumber(phoneNumber) - .dhsProviderId(dhsProviderId) - .postOfficeAddress( - new Address(mailingStreetAddress, mailingCity, "MN", mailingZipcode, "", - county.displayName()))); - } - - private void addCounty(County county, String phoneNumber, String email, - String dhsProviderId) { - addCounty(county, CountyRoutingDestination.builder().email(email) - .phoneNumber(phoneNumber) - .dhsProviderId(dhsProviderId)); + addCountyDefaults(Aitkin, "A000001900", "800-328-3744"); + addCountyDefaults(Anoka, "1023250115", "763-422-7200"); + addCountyDefaults(Becker, "A000003500", "218-847-5628"); + addCountyDefaults(Beltrami, "A000004300", "218-333-8300"); + addCountyDefaults(Benton, "1174697148", "800-530-6254"); + addCountyDefaults(BigStone, "A000006000", "320-839-2555"); + addCountyDefaults(BlueEarth, "A000007800", "507-304-4335"); + addCountyDefaults(Brown, "A000008600", "800-450-8246"); + addCountyDefaults(Carlton, "1003921875", "800-642-9082"); + addCountyDefaults(Carver, "A000010800", "952-361-1600"); + addCountyDefaults(Cass, "1760489769", "218-547-1340"); + addCountyDefaults(Chippewa, "A000012400", "320-269-6401"); + addCountyDefaults(Chisago, "1659408904", "888-234-1246"); + addCountyDefaults(Clay, "A000014100", "800-757-3880"); + addCountyDefaults(Clearwater, "A000015900", "800-245-6064"); + addCountyDefaults(Cook, "A000016700", "218-387-3620"); + addCountyDefaults(Cottonwood, "A000017500", "507-831-1891"); + addCountyDefaults(CrowWing, "A000018300", "888-772-8212"); + addCountyDefaults(Dakota, "1427127620", "651-554-5611"); + addCountyDefaults(Dodge, "A000020500", "507-923-2900"); + addCountyDefaults(Douglas, "A000021300", "320-762-2302"); + addCountyDefaults(Faribault, "A000022100", "507-526-3265"); + addCountyDefaults(Fillmore, "1437228236", "507-765-2175"); + addCountyDefaults(Freeborn, "A000024800", "507-377-5400"); + addCountyDefaults(Goodhue, "A000025600", "651-385-3200"); + addCountyDefaults(Grant, "A000061200", "320-634-7758"); + addCountyDefaults(Hennepin, "A000027200", "612-596-1300", new Address( + "100 S 1st St", "Minneapolis", "MN", "55401", "", + Hennepin.displayName() + )); + addCountyDefaults(Houston, "A000028100", "507-725-5811"); + addCountyDefaults(Hubbard, "A000029900", "877-450-1451"); + addCountyDefaults(Isanti, "A000030200", "763-689-1711"); + addCountyDefaults(Itasca, "A000031100", "800-422-0312"); + addCountyDefaults(Jackson, "A000032900", "507-847-4000"); + addCountyDefaults(Kanabec, "1396819108", "320-679-6350"); + addCountyDefaults(Kandiyohi, "A000034500", "877-464-7800"); + addCountyDefaults(Kittson, "A000035300", "800-672-8026"); + addCountyDefaults(Koochiching, "A000036100", "800-950-4630"); + addCountyDefaults(LacQuiParle, "A000037000", "320-598-7594"); + addCountyDefaults(Lake, "A000038800", "218-834-8400"); + addCountyDefaults(LakeOfTheWoods, "A000039600", "218-634-2642"); + addCountyDefaults(LeSueur, "A000040000", "507-357-8288"); + addCountyDefaults(Lincoln, "A000041800", "800-657-3781"); + addCountyDefaults(Lyon, "A000042600", "800-657-3760"); + addCountyDefaults(McLeod, "A000043400", "800-247-1756"); + addCountyDefaults(Mahnomen, "A000044200", "218-935-2568"); + addCountyDefaults(Marshall, "A000045100", "800-642-5444"); + addCountyDefaults(Martin, "A000046900", "507-238-4757"); + addCountyDefaults(Meeker, "A000047700", "877-915-5300"); + addCountyDefaults(MilleLacs, "A000048500", "888-270-8208"); + addCountyDefaults(Morrison, "1255406286", "800-269-1464"); + addCountyDefaults(Mower, "M000050700", "507-437-9700"); + addCountyDefaults(Murray, "M000051500", "800-657-3811"); + addCountyDefaults(Nicollet, "M000052300", "507-934-8559"); + addCountyDefaults(Nobles, "M000053100", "507-295-5213"); + addCountyDefaults(Norman, "A000054000", "218-784-5400"); + addCountyDefaults(Olmsted, "A000055800", "507-328-6500"); + addCountyDefaults(OtterTail, "A000056600", "218-998-8230"); + addCountyDefaults(Pennington, "A000057400", "218-681-2880"); + addCountyDefaults(Pine, "A000058200", "320-591-1570"); + addCountyDefaults(Pipestone, "A000059100", "507-825-6720"); + addCountyDefaults(Polk, "A000060400", "877-281-3127"); + addCountyDefaults(Pope, "A000061200", "320-634-7758"); + addCountyDefaults(Ramsey, "1811055957", "651-266-4444"); + addCountyDefaults(RedLake, "A000063900", "877-294-0846"); + addCountyDefaults(Redwood, "A000064700", "888-234-1292"); + addCountyDefaults(Renville, "M000065500", "320-523-2202"); + addCountyDefaults(Rice, "M000066300", "507-332-6115"); + addCountyDefaults(Rock, "M000067100", "507-283-5070"); + addCountyDefaults(Roseau, "A000068000", "866-255-2932"); + addCountyDefaults(Scott, "A000070100", "952-496-8686"); + addCountyDefaults(Sherburne, "1447381660", "800-433-5239"); + addCountyDefaults(Sibley, "A000072800", "507-237-4000"); + addCountyDefaults(Stearns, "A000073600", "800-450-3663"); + addCountyDefaults(Steele, "A000074400", "507-431-5600"); + addCountyDefaults(Stevens, "A000075200", "800-950-4429"); + addCountyDefaults(StLouis, "A000069800", "800-450-9777"); + addCountyDefaults(Swift, "A000076100", "320-843-3160"); + addCountyDefaults(Todd, "1336372465", "888-838-4066"); + addCountyDefaults(Traverse, "A000078700", "855-735-8916"); + addCountyDefaults(Wabasha, "A000079500", "888-315-8815"); + addCountyDefaults(Wadena, "A000080900", "888-662-2737"); + addCountyDefaults(Waseca, "A000081700", "507-837-6600"); + addCountyDefaults(Washington, "1700969334", "651-430-6455"); + addCountyDefaults(Watonwan, "1942539846", "888-299-5941"); + addCountyDefaults(Wilkin, "1962567529", "218-643-7161"); + addCountyDefaults(Winona, "A000085000", "507-457-6200"); + addCountyDefaults(Wright, "1124197249", "800-362-3667"); + addCountyDefaults(YellowMedicine, "A000087600", "320-564-2211"); + countyMap.setDefaultValue(countyMap.get(Hennepin)); } - private void addCounty(County county, String phoneNumber) { - addCounty(county, CountyRoutingDestination.builder().phoneNumber(phoneNumber)); + private void addCountyDefaults(County county, String dhsProviderId, String phoneNumber, + Address address) { + countyMap.getCounties().put(county, + new CountyRoutingDestination(county, dhsProviderId, DEV_EMAIL, phoneNumber, + address)); } - private void addCounty(County county, - CountyRoutingDestinationBuilder builder) { - countyMap.getCounties().put(county, builder.county(county).build()); + private void addCountyDefaults(County county, String dhsProviderId, String phoneNumber) { + countyMap.getCounties().put(county, + new CountyRoutingDestination(county, dhsProviderId, DEV_EMAIL, + phoneNumber)); } private void updateCounty(County county, String email, String dhsProviderId) { diff --git a/src/main/java/org/codeforamerica/shiba/mnit/CountyRoutingDestination.java b/src/main/java/org/codeforamerica/shiba/mnit/CountyRoutingDestination.java index 36f7aedd7..bb865c3c4 100644 --- a/src/main/java/org/codeforamerica/shiba/mnit/CountyRoutingDestination.java +++ b/src/main/java/org/codeforamerica/shiba/mnit/CountyRoutingDestination.java @@ -1,21 +1,17 @@ package org.codeforamerica.shiba.mnit; -import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; import org.codeforamerica.shiba.County; import org.codeforamerica.shiba.pages.enrichment.Address; @Data @EqualsAndHashCode(callSuper = true) -@NoArgsConstructor public class CountyRoutingDestination extends RoutingDestination { private County county; private Address postOfficeAddress; - @Builder public CountyRoutingDestination(County county, String dhsProviderId, String email, String phoneNumber, Address postOfficeAddress) { super(dhsProviderId, email, phoneNumber); @@ -23,6 +19,12 @@ public CountyRoutingDestination(County county, String dhsProviderId, this.postOfficeAddress = postOfficeAddress; } + public CountyRoutingDestination(County county, String dhsProviderId, String email, + String phoneNumber) { + super(dhsProviderId, email, phoneNumber); + this.county = county; + } + @Override public String getName() { return county.displayName(); diff --git a/src/test/java/org/codeforamerica/shiba/ResubmissionServiceTest.java b/src/test/java/org/codeforamerica/shiba/ResubmissionServiceTest.java index 345b0a42c..a9acf0e0c 100644 --- a/src/test/java/org/codeforamerica/shiba/ResubmissionServiceTest.java +++ b/src/test/java/org/codeforamerica/shiba/ResubmissionServiceTest.java @@ -2,6 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.codeforamerica.shiba.County.Anoka; +import static org.codeforamerica.shiba.County.Hennepin; import static org.codeforamerica.shiba.County.Olmsted; import static org.codeforamerica.shiba.TribalNationRoutingDestination.MILLE_LACS_BAND_OF_OJIBWE; import static org.codeforamerica.shiba.application.Status.DELIVERED_BY_EMAIL; @@ -11,17 +12,27 @@ import static org.codeforamerica.shiba.output.Document.CCAP; import static org.codeforamerica.shiba.output.Document.UPLOADED_DOC; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import java.util.List; import java.util.Map; -import org.codeforamerica.shiba.application.*; +import org.codeforamerica.shiba.application.Application; +import org.codeforamerica.shiba.application.ApplicationRepository; +import org.codeforamerica.shiba.application.ApplicationStatus; +import org.codeforamerica.shiba.application.ApplicationStatusRepository; +import org.codeforamerica.shiba.application.Status; import org.codeforamerica.shiba.mnit.CountyRoutingDestination; import org.codeforamerica.shiba.mnit.TribalNationConfiguration; import org.codeforamerica.shiba.output.ApplicationFile; import org.codeforamerica.shiba.output.Document; import org.codeforamerica.shiba.output.Recipient; -import org.codeforamerica.shiba.output.caf.FilenameGenerator; import org.codeforamerica.shiba.output.caf.SnapExpeditedEligibilityDecider; import org.codeforamerica.shiba.output.pdf.PdfGenerator; import org.codeforamerica.shiba.pages.RoutingDecisionService; @@ -60,26 +71,20 @@ class ResubmissionServiceTest { private ApplicationStatusRepository applicationStatusRepository; @Mock private PageEventPublisher pageEventPublisher; - @Mock - private FilenameGenerator filenameGenerator ; @BeforeEach void setUp() { - countyMap.setDefaultValue(CountyRoutingDestination.builder() - .dhsProviderId("defaultDhsProviderId") - .email(DEFAULT_EMAIL) // TODO test other counties besides DEFAULT - .build()); + countyMap.setDefaultValue(new CountyRoutingDestination(Hennepin, "defaultDhsProviderId", DEFAULT_EMAIL, "phoneNumber")); String OLMSTED_EMAIL = "olmsted@example.com"; countyMap.setCounties(Map.of( - Anoka, CountyRoutingDestination.builder().county(Anoka).email(ANOKA_EMAIL).build(), - Olmsted, CountyRoutingDestination.builder().county(Olmsted).email(OLMSTED_EMAIL).build() + Anoka, new CountyRoutingDestination(Anoka, "dpi1", ANOKA_EMAIL, "phoneNumber"), + Olmsted, new CountyRoutingDestination(Olmsted, "dpi2", OLMSTED_EMAIL, "phoneNumber") )); Map tribalNations = new TribalNationConfiguration().localTribalNations(); routingDecisionService = new RoutingDecisionService(tribalNations, countyMap, mock( FeatureFlagConfiguration.class)); FeatureFlagConfiguration featureFlagConfiguration = new FeatureFlagConfiguration(Map.of()); SnapExpeditedEligibilityDecider decider = mock(SnapExpeditedEligibilityDecider.class); - filenameGenerator = new FilenameGenerator(countyMap, decider); resubmissionService = new ResubmissionService(applicationRepository, emailClient, pdfGenerator, routingDecisionService, applicationStatusRepository, pageEventPublisher, featureFlagConfiguration); } diff --git a/src/test/java/org/codeforamerica/shiba/RoutingDestinationMessageServiceTest.java b/src/test/java/org/codeforamerica/shiba/RoutingDestinationMessageServiceTest.java index b29076475..49efd4522 100644 --- a/src/test/java/org/codeforamerica/shiba/RoutingDestinationMessageServiceTest.java +++ b/src/test/java/org/codeforamerica/shiba/RoutingDestinationMessageServiceTest.java @@ -32,7 +32,7 @@ class RoutingDestinationMessageServiceTest { void generatesMessageStringsWhenCountyAndTribalNation() { routingDestinations = new ArrayList<>(); routingDestinations.add( - CountyRoutingDestination.builder().county(Anoka).phoneNumber("555-5555").build()); + new CountyRoutingDestination(Anoka, "DPI", "email", "555-5555")); routingDestinations.add(new TribalNationRoutingDestination(MILLE_LACS_BAND_OF_OJIBWE, "someProviderId", "someEmail", "222-2222")); RoutingDestinationMessageService routingDestinationMessageService = new RoutingDestinationMessageService( @@ -49,7 +49,7 @@ void generatesMessageStringsWhenCountyAndTribalNation() { void generatesMessageStringsWithoutPhoneNumbers() { routingDestinations = new ArrayList<>(); routingDestinations.add( - CountyRoutingDestination.builder().county(Anoka).phoneNumber("555-5555").build()); + new CountyRoutingDestination(Anoka, "DPI", "email", "555-5555")); routingDestinations.add(new TribalNationRoutingDestination(MILLE_LACS_BAND_OF_OJIBWE, "someProviderId", "someEmail", "222-2222")); RoutingDestinationMessageService routingDestinationMessageService = new RoutingDestinationMessageService( @@ -65,7 +65,7 @@ void generatesMessageStringsWithoutPhoneNumbers() { @Test void generatesMessageStringsWhenCountyOnly() { routingDestinations = new ArrayList<>(); - routingDestinations.add(CountyRoutingDestination.builder().county(Anoka).phoneNumber("555-5555").build()); + routingDestinations.add(new CountyRoutingDestination(Anoka, "DPI", "email", "555-5555")); RoutingDestinationMessageService routingDestinationMessageService = new RoutingDestinationMessageService(messageSource); when(routingDecisionService.getRoutingDestinations(any(), any())).thenReturn(routingDestinations); diff --git a/src/test/java/org/codeforamerica/shiba/application/ApplicationStatusRepositoryTest.java b/src/test/java/org/codeforamerica/shiba/application/ApplicationStatusRepositoryTest.java index f73429c14..b0551c965 100644 --- a/src/test/java/org/codeforamerica/shiba/application/ApplicationStatusRepositoryTest.java +++ b/src/test/java/org/codeforamerica/shiba/application/ApplicationStatusRepositoryTest.java @@ -38,7 +38,6 @@ public class ApplicationStatusRepositoryTest extends AbstractRepositoryTest { private ApplicationStatusRepository applicationStatusRepository; private final RoutingDecisionService routingDecisionService = mock(RoutingDecisionService.class); - private CountyMap countyMap; @MockBean private FilenameGenerator filenameGenerator; private CountyRoutingDestination routingDestination; @@ -47,10 +46,8 @@ public class ApplicationStatusRepositoryTest extends AbstractRepositoryTest { @BeforeEach void setUp() { - countyMap = new CountyMap<>(); - routingDestination = CountyRoutingDestination.builder() - .county(Olmsted) - .build(); + CountyMap countyMap = new CountyMap<>(); + routingDestination = new CountyRoutingDestination(Olmsted, "dpi", "email", "phoneNumber"); countyMap.setDefaultValue(routingDestination); SnapExpeditedEligibilityDecider decider = mock(SnapExpeditedEligibilityDecider.class); filenameGenerator = new FilenameGenerator(countyMap, decider); diff --git a/src/test/java/org/codeforamerica/shiba/mnit/FilenetWebServiceClientTest.java b/src/test/java/org/codeforamerica/shiba/mnit/FilenetWebServiceClientTest.java index 7c634a568..c36bed2f3 100644 --- a/src/test/java/org/codeforamerica/shiba/mnit/FilenetWebServiceClientTest.java +++ b/src/test/java/org/codeforamerica/shiba/mnit/FilenetWebServiceClientTest.java @@ -94,20 +94,14 @@ class FilenetWebServiceClientTest { void setUp() { when(clock.instant()).thenReturn(Instant.now()); when(clock.getZone()).thenReturn(ZoneId.of("UTC")); - mockWebServiceServer = MockWebServiceServer.createServer(webServiceTemplate); - olmsted = new CountyRoutingDestination(); - olmsted.setCounty(Olmsted); - olmsted.setDhsProviderId("A000055800"); - - hennepin = new CountyRoutingDestination(); - hennepin.setCounty(Hennepin); - hennepin.setDhsProviderId("A000027200"); + olmsted = new CountyRoutingDestination(Olmsted, "A000055800", "email", "8004112222"); + hennepin = new CountyRoutingDestination(Hennepin, "A000027200", "email", "8004112222"); + mockWebServiceServer = MockWebServiceServer.createServer(webServiceTemplate); String routerRequest = String.format("%s/%s", sftpUploadUrl, filenetIdd); Mockito.when(restTemplate.getForObject(routerRequest, String.class)).thenReturn(routerResponse); } - //TODO: namespaces change order. Need to figure out how to use a wildcard in the xpath assertions. @Test void sendsTheDocument() { mockWebServiceServer.expect(connectionTo(url)) @@ -160,7 +154,7 @@ void sendsTheDocument() { ); verify(applicationStatusRepository).createOrUpdate("someId", Document.CAF, olmsted.getName(), - DELIVERED,fileName); + DELIVERED, fileName); mockWebServiceServer.verify(); } diff --git a/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/CoverPagePreparerTest.java b/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/CoverPagePreparerTest.java index 65ebb8d04..2a8a035d2 100644 --- a/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/CoverPagePreparerTest.java +++ b/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/CoverPagePreparerTest.java @@ -1,6 +1,7 @@ package org.codeforamerica.shiba.output.documentfieldpreparers; import static org.assertj.core.api.Assertions.assertThat; +import static org.codeforamerica.shiba.County.Hennepin; import static org.codeforamerica.shiba.County.Olmsted; import static org.codeforamerica.shiba.County.Other; import static org.codeforamerica.shiba.output.Document.CAF; @@ -61,11 +62,8 @@ public void setUp() { countyInstructionsMapping.getCounties().put(Other, Map.of( Recipient.CLIENT, "county-to-instructions.default-client", Recipient.CASEWORKER, "county-to-instructions.default-caseworker")); - CountyRoutingDestination countyRoutingDestination = CountyRoutingDestination.builder() - .dhsProviderId("someDhsProviderId") - .email("someEmail") - .phoneNumber("555-123-4567") - .build(); + CountyRoutingDestination countyRoutingDestination = new CountyRoutingDestination( + Hennepin, "someDhsProviderId", "someEmail", "555-123-4567"); when(routingDecisionService.getRoutingDestinations(any(ApplicationData.class), any(Document.class))) .thenReturn(List.of(countyRoutingDestination)); @@ -112,7 +110,7 @@ void shouldIncludeProgramsInputWithCombinedProgramSelection() { DocumentFieldType.SINGLE_VALUE )); } - + @Test void shouldIncludeTribalAffiliation() { new TestApplicationDataBuilder(applicationData) diff --git a/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/FilenameGeneratorTest.java b/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/FilenameGeneratorTest.java index 6a97d75fa..8160c95b5 100644 --- a/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/FilenameGeneratorTest.java +++ b/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/FilenameGeneratorTest.java @@ -2,14 +2,14 @@ import static java.util.Collections.emptyList; import static org.assertj.core.api.Assertions.assertThat; -import static org.codeforamerica.shiba.County.*; +import static org.codeforamerica.shiba.County.Hennepin; +import static org.codeforamerica.shiba.County.Olmsted; +import static org.codeforamerica.shiba.County.Other; import static org.codeforamerica.shiba.TribalNationRoutingDestination.RED_LAKE_NATION; import static org.codeforamerica.shiba.output.caf.SnapExpeditedEligibility.ELIGIBLE; -import static org.codeforamerica.shiba.output.caf.SnapExpeditedEligibility.NOT_ELIGIBLE; -import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import java.math.BigDecimal; + import java.time.Instant; import java.time.ZoneOffset; import java.time.ZonedDateTime; @@ -19,28 +19,19 @@ import java.util.Map; import org.codeforamerica.shiba.County; import org.codeforamerica.shiba.CountyMap; -import org.codeforamerica.shiba.Money; import org.codeforamerica.shiba.TribalNationRoutingDestination; import org.codeforamerica.shiba.application.Application; -import org.codeforamerica.shiba.application.parsers.GrossMonthlyIncomeParser; import org.codeforamerica.shiba.mnit.CountyRoutingDestination; import org.codeforamerica.shiba.mnit.RoutingDestination; import org.codeforamerica.shiba.mnit.TribalNationConfiguration; import org.codeforamerica.shiba.output.Document; -import org.codeforamerica.shiba.output.caf.Eligibility; -import org.codeforamerica.shiba.output.caf.EligibilityListBuilder; -import org.codeforamerica.shiba.output.caf.ExpeditedEligibility; import org.codeforamerica.shiba.output.caf.FilenameGenerator; import org.codeforamerica.shiba.output.caf.SnapExpeditedEligibilityDecider; -import org.codeforamerica.shiba.output.caf.TotalIncomeCalculator; -import org.codeforamerica.shiba.output.caf.UnearnedIncomeCalculator; -import org.codeforamerica.shiba.output.caf.UtilityDeductionCalculator; import org.codeforamerica.shiba.pages.data.ApplicationData; import org.codeforamerica.shiba.testutilities.TestApplicationDataBuilder; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; import org.springframework.http.MediaType; import org.springframework.mock.web.MockMultipartFile; @@ -51,18 +42,16 @@ class FilenameGeneratorTest { private Application.ApplicationBuilder defaultApplicationBuilder; private Map tribalNations; private CountyRoutingDestination defaultCountyRoutingDestination; - + SnapExpeditedEligibilityDecider decider = mock(SnapExpeditedEligibilityDecider.class); - + @BeforeEach void setUp() { countyMap = new CountyMap<>(); ApplicationData applicationData = new TestApplicationDataBuilder() .withApplicantPrograms(emptyList()).build(); - defaultCountyRoutingDestination = CountyRoutingDestination.builder() - .dhsProviderId("defaultCountyDhsProviderId") - .email("defaultCountyEmail@example.com") - .build(); + defaultCountyRoutingDestination = new CountyRoutingDestination(Hennepin, + "defaultCountyDhsProviderId", "defaultCountyEmail@example.com", "phoneNumber"); countyMap.setDefaultValue(defaultCountyRoutingDestination); tribalNations = new TribalNationConfiguration().localTribalNations(); defaultApplicationBuilder = Application.builder() @@ -117,7 +106,7 @@ void shouldIncludeCorrectCountyNPI() { String countyNPI = "someNPI"; County county = Hennepin; countyMap.getCounties() - .put(county, CountyRoutingDestination.builder().dhsProviderId(countyNPI).build()); + .put(county, new CountyRoutingDestination(county, countyNPI, "email", "phoneNumber")); Application application = defaultApplicationBuilder.county(county).build(); String fileName = filenameGenerator.generatePdfFilename(application, Document.CAF); @@ -171,7 +160,7 @@ void shouldArrangeNameCorrectlyForPdf() { String countyNPI = "someNPI"; County county = Hennepin; countyMap.getCounties() - .put(county, CountyRoutingDestination.builder().dhsProviderId(countyNPI).build()); + .put(county, new CountyRoutingDestination(county, countyNPI, "email", "phoneNumber")); String applicationId = "someId"; @@ -197,7 +186,7 @@ void shouldArrangeNameCorrectlyForXML() { String countyNPI = "someNPI"; County county = Hennepin; countyMap.getCounties() - .put(county, CountyRoutingDestination.builder().dhsProviderId(countyNPI).build()); + .put(county, new CountyRoutingDestination(county, countyNPI, "email", "phoneNumber")); String applicationId = "someId"; @@ -234,7 +223,7 @@ void setUp() { County county = Olmsted; countyMap.getCounties() - .put(county, CountyRoutingDestination.builder().dhsProviderId(countyNPI).build()); + .put(county, new CountyRoutingDestination(county, countyNPI, "email", "phoneNumber")); application = defaultApplicationBuilder .id(applicationId) @@ -282,10 +271,10 @@ void shouldBeDocInsteadOfMnbIfCountyIsHennepin() { County hennepinCounty = Hennepin; String olmstedCountyNPI = "olmstedNPI"; County olmstedCounty = County.Olmsted; - countyMap.getCounties().put(hennepinCounty, - CountyRoutingDestination.builder().dhsProviderId(hennepinCountyNPI).build()); - countyMap.getCounties().put(olmstedCounty, - CountyRoutingDestination.builder().dhsProviderId(olmstedCountyNPI).build()); + countyMap.getCounties() + .put(hennepinCounty, new CountyRoutingDestination(hennepinCounty, hennepinCountyNPI, "email", "phoneNumber")); + countyMap.getCounties() + .put(olmstedCounty, new CountyRoutingDestination(olmstedCounty, olmstedCountyNPI, "email", "phoneNumber")); String applicationId = "someId"; Application hennepinApplication = defaultApplicationBuilder @@ -317,43 +306,44 @@ void shouldBeDocInsteadOfMnbIfCountyIsHennepin() { @Test void shouldBeDocInsteadOfMnbIfCountyIsOther() { ApplicationData applicationData = new TestApplicationDataBuilder() - .withApplicantPrograms(List.of("SNAP")).build(); + .withApplicantPrograms(List.of("SNAP")).build(); - String OtherCountyNPI = "hennepinNPI"; + String otherCountyNpi = "hennepinNPI"; County hennepinCounty = Other; - countyMap.getCounties().put(hennepinCounty, - CountyRoutingDestination.builder().dhsProviderId(OtherCountyNPI).build()); + countyMap.getCounties() + .put(hennepinCounty, new CountyRoutingDestination(hennepinCounty, otherCountyNpi, "email", "phoneNumber")); String applicationId = "someId"; Application hennepinApplication = defaultApplicationBuilder - .id(applicationId) - .county(hennepinCounty) - .completedAt( - ZonedDateTime.ofInstant(Instant.parse("2007-09-10T04:59:59.00Z"), ZoneOffset.UTC)) - .applicationData(applicationData) - .build(); + .id(applicationId) + .county(hennepinCounty) + .completedAt( + ZonedDateTime.ofInstant(Instant.parse("2007-09-10T04:59:59.00Z"), ZoneOffset.UTC)) + .applicationData(applicationData) + .build(); String fileName = filenameGenerator.generateUploadedDocumentName(hennepinApplication, 0, "pdf"); assertThat(fileName).contains("hennepinNPI_DOC"); assertThat(fileName).doesNotContain("hennepinNPI_MNB"); } + @Test void shouldAppendExpeditedFileNameCorrectlyForCAFPdf() { TestApplicationDataBuilder applicationDataBuilder = new TestApplicationDataBuilder() .withApplicantPrograms(List.of("SNAP")); - + ApplicationData applicationData = applicationDataBuilder .build(); String countyNPI = "someNPI"; County county = Hennepin; countyMap.getCounties() - .put(county, CountyRoutingDestination.builder().dhsProviderId(countyNPI).build()); + .put(county, new CountyRoutingDestination(county, countyNPI, "email", "phoneNumber")); String applicationId = "someId"; when(decider.decide(applicationData)).thenReturn(ELIGIBLE); - + Application application = defaultApplicationBuilder .id(applicationId) .county(county) @@ -361,9 +351,9 @@ void shouldAppendExpeditedFileNameCorrectlyForCAFPdf() { ZonedDateTime.ofInstant(Instant.parse("2007-09-10T04:59:59.00Z"), ZoneOffset.UTC)) .applicationData(applicationData) .build(); - - String fileName = filenameGenerator.generatePdfFilename(application, Document.CAF); - + + String fileName = filenameGenerator.generatePdfFilename(application, Document.CAF); + assertThat(fileName).isEqualTo(String.format("%s_MNB_%s_%s_%s_%s_%s%s.pdf", countyNPI, "20070909", "235959", applicationId, "F", "CAF", "_EXPEDITED")); } diff --git a/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/MailingAddressStreetPreparerTest.java b/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/MailingAddressStreetPreparerTest.java index fe591fd50..9a5db7b67 100644 --- a/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/MailingAddressStreetPreparerTest.java +++ b/src/test/java/org/codeforamerica/shiba/output/documentfieldpreparers/MailingAddressStreetPreparerTest.java @@ -57,11 +57,10 @@ void setup() { Address hennepinPostOfficeAddress = new Address("123 hennepin st", "Minneapolis", "MN", "55555", null, "Hennepin"); countyMap.getCounties().putAll(Map.of( - Hennepin, CountyRoutingDestination.builder() - .county(Hennepin).phoneNumber("765-4321") - .postOfficeAddress(hennepinPostOfficeAddress).build(), - OtterTail, CountyRoutingDestination.builder() - .county(OtterTail).phoneNumber("123-4567").build())); + Hennepin, new CountyRoutingDestination(Hennepin, "npi", "email", "765-4321", + hennepinPostOfficeAddress), + OtterTail, new CountyRoutingDestination(OtterTail, "npi", "email", "123-4567")) + ); cityInfo.getCityToZipAndCountyMapping().putAll(Map.of( "Ada",