You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HMAI-95 Add prison filters to prisoner endpoint (#558)
* If prisons filter present, only return prisoner if in matching prison.
* Add tests for more of the error cases.
* Add test for no conumer filters preserving backwards compatibility
* Simplify if condition for verifying if match.
* Extract function for whether a value should be filtered out.
* Fix the integration test.
* Add test for empty list of prisons has no access.
Copy file name to clipboardexpand all lines: src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/controllers/v1/prison/PrisonController.kt
Copy file name to clipboardexpand all lines: src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/controllers/v1/prison/PrisonControllerTest.kt
Copy file name to clipboardexpand all lines: src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/extensions/ConsumerConfigConverterTest.kt
+1-1
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,6 @@ class ConsumerConfigConverterTest {
13
13
val consumerConfig =""
14
14
val actual =ConsumerConfigConverter().convert(consumerConfig)
Copy file name to clipboardexpand all lines: src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/extensions/ConsumerFilterConverterTest.kt
+1-1
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,6 @@ class ConsumerFilterConverterTest {
12
12
val consumerConfig =""
13
13
val actual =ConsumerFilterConverter().convert(consumerConfig)
Copy file name to clipboardexpand all lines: src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/extensions/FiltersExtractionFilterTest.kt
+3-3
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ class FiltersExtractionFilterTest {
25
25
val mockResponse = mock(HttpServletResponse::class.java)
26
26
val mockChain = mock(FilterChain::class.java)
27
27
28
-
authorisationConfig.consumers =mapOf("consumer-name" to ConsumerConfig(include =null, filters =ConsumerFilters(emptyMap())))
28
+
authorisationConfig.consumers =mapOf("consumer-name" to ConsumerConfig(include =null, filters =ConsumerFilters(prisons =null)))
Copy file name to clipboardexpand all lines: src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/integration/prison/PrisonIntegrationTest.kt
0 commit comments