-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CNFT1-3431] Simplifies how routing to the modernized patient profile…
… is handled (#2007) (#2019) * simplifies the redirection to the modernized patient profile * fix cookie test * handling drr * wip * consolidation * smells (cherry picked from commit 945deb7)
- Loading branch information
1 parent
67fd564
commit 074bce6
Showing
21 changed files
with
237 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
...java/gov/cdc/nbs/patient/profile/redirect/incoming/PatientProfileReturningRedirector.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 12 additions & 29 deletions
41
...ov/cdc/nbs/patient/profile/redirect/incoming/PatientProfileReturningRedirectionSteps.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,40 @@ | ||
package gov.cdc.nbs.patient.profile.redirect.incoming; | ||
|
||
import gov.cdc.nbs.patient.identifier.PatientIdentifier; | ||
import gov.cdc.nbs.testing.interaction.http.Authenticated; | ||
import gov.cdc.nbs.testing.support.Active; | ||
import io.cucumber.java.en.When; | ||
import jakarta.servlet.http.Cookie; | ||
import org.springframework.test.web.servlet.MockMvc; | ||
import org.springframework.test.web.servlet.ResultActions; | ||
|
||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; | ||
|
||
public class PatientProfileReturningRedirectionSteps { | ||
|
||
private final Authenticated authenticated; | ||
|
||
private final Active<PatientIdentifier> activePatient; | ||
|
||
private final MockMvc mvc; | ||
private final PatientProfileRedirectRequester requester; | ||
|
||
private final Active<ResultActions> activeResponse; | ||
|
||
PatientProfileReturningRedirectionSteps( | ||
final Authenticated authenticated, | ||
final Active<PatientIdentifier> activePatient, | ||
final MockMvc mvc, | ||
final PatientProfileRedirectRequester requester, | ||
final Active<ResultActions> activeResponse | ||
) { | ||
this.authenticated = authenticated; | ||
this.activePatient = activePatient; | ||
this.mvc = mvc; | ||
this.requester = requester; | ||
this.activeResponse = activeResponse; | ||
} | ||
|
||
@When("Returning to a Patient Profile") | ||
public void returning_to_a_patient_profile() throws Exception { | ||
|
||
long patient = activePatient.active().id(); | ||
|
||
activeResponse.active( | ||
mvc.perform( | ||
this.authenticated.withSession(get("/nbs/redirect/patientProfile/return")) | ||
.cookie(new Cookie("Return-Patient", String.valueOf(patient)))) | ||
); | ||
public void returning_to_a_patient_profile() { | ||
activePatient.maybeActive() | ||
.map(patient -> requester.returningTo(patient, "summary")) | ||
.ifPresent(activeResponse::active); | ||
} | ||
|
||
@When("Returning to a Patient Profile {patientProfileTab} tab") | ||
public void returning_to_a_patient_profile_tab(final String tab) throws Exception { | ||
|
||
long patient = activePatient.active().id(); | ||
|
||
activeResponse.active( | ||
mvc.perform(authenticated.withSession(get("/nbs/redirect/patientProfile/{tab}/return", tab)) | ||
.cookie(new Cookie("Return-Patient", String.valueOf(patient)))) | ||
); | ||
public void returning_to_a_patient_profile_tab(final String tab) { | ||
activePatient.maybeActive() | ||
.map(patient -> requester.returningTo(patient, tab)) | ||
.ifPresent(activeResponse::active); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 0 additions & 52 deletions
52
.../cdc/nbs/gateway/patient/profile/PatientProfileSearchResultRouteLocatorConfiguration.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.