File tree Expand file tree Collapse file tree 2 files changed +40
-2
lines changed
intTest/java/uk/nhs/adaptors/gp2gp/common/configuration
main/java/uk/nhs/adaptors/gp2gp/common/configuration Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 1+ package uk .nhs .adaptors .gp2gp .common .configuration ;
2+
3+ import org .junit .jupiter .api .Nested ;
4+ import org .junit .jupiter .api .Test ;
5+ import org .springframework .beans .factory .annotation .Autowired ;
6+ import org .springframework .boot .test .context .SpringBootTest ;
7+ import org .springframework .test .context .ContextConfiguration ;
8+
9+ import static org .assertj .core .api .Assertions .assertThat ;
10+
11+ @ ContextConfiguration (classes = { RedactionsConfiguration .class })
12+ public class RedactionsConfigurationTest {
13+ @ Nested
14+ @ SpringBootTest (properties = { "gp2gp.redactions-enabled = false" })
15+ class FeatureFlagDisabled {
16+ @ Autowired
17+ private RedactionsContext redactionsContext ;
18+
19+ @ Test
20+ void ehrExtractInteractionIdIsUK07 () {
21+ final String result = redactionsContext .ehrExtractInteractionId ();
22+ assertThat (result ).isEqualTo (RedactionsConfiguration .EHR_EXTRACT_INTERACTION_ID );
23+ }
24+ }
25+
26+ @ Nested
27+ @ SpringBootTest (properties = { "gp2gp.redactions-enabled = true" })
28+ class FeatureFlagEnabled {
29+ @ Autowired
30+ private RedactionsContext redactionsContext ;
31+
32+ @ Test
33+ void ehrExtractInteractionIdIsUK07 () {
34+ final String result = redactionsContext .ehrExtractInteractionId ();
35+ assertThat (result ).isEqualTo (RedactionsConfiguration .EHR_EXTRACT_INTERACTION_ID_WITH_REDACTIONS );
36+ }
37+ }
38+ }
Original file line number Diff line number Diff line change 66
77@ Configuration
88class RedactionsConfiguration {
9- private static final String EHR_EXTRACT_INTERACTION_ID = "RCMR_IN030000UK06" ;
10- private static final String EHR_EXTRACT_INTERACTION_ID_WITH_REDACTIONS = "RCMR_IN030000UK07" ;
9+ public static final String EHR_EXTRACT_INTERACTION_ID = "RCMR_IN030000UK06" ;
10+ public static final String EHR_EXTRACT_INTERACTION_ID_WITH_REDACTIONS = "RCMR_IN030000UK07" ;
1111 private boolean redactionsEnabled ;
1212
1313 @ Value ("${gp2gp.redactions-enabled}" )
You can’t perform that action at this time.
0 commit comments