Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FIT-Connect-SDK - Java
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FIT-Connect
FIT-Connect-SDK - Java
Commits
f3b032f5
Commit
f3b032f5
authored
1 year ago
by
Martin Vogel
Browse files
Options
Downloads
Patches
Plain Diff
refactor: use static import (
planning#1684
))
parent
be8f744f
No related branches found
No related tags found
1 merge request
!322
Fix ARS Validation Scope (planning#1684)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/java/dev/fitko/fitconnect/core/routing/RouteVerifier.java
+5
-5
5 additions, 5 deletions
...java/dev/fitko/fitconnect/core/routing/RouteVerifier.java
with
5 additions
and
5 deletions
core/src/main/java/dev/fitko/fitconnect/core/routing/RouteVerifier.java
+
5
−
5
View file @
f3b032f5
...
...
@@ -31,11 +31,11 @@ import java.util.Arrays;
import
java.util.List
;
import
java.util.Map
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
static
dev
.
fitko
.
fitconnect
.
api
.
domain
.
validation
.
ValidationResult
.
error
;
import
static
dev
.
fitko
.
fitconnect
.
api
.
domain
.
validation
.
ValidationResult
.
ok
;
import
static
java
.
util
.
Collections
.
emptyList
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
public
class
RouteVerifier
implements
RoutingVerificationService
{
...
...
@@ -135,7 +135,7 @@ public class RouteVerifier implements RoutingVerificationService {
final
List
<
RouteService
>
services
=
claims
.
getListClaim
(
"services"
).
stream
()
.
map
(
service
->
new
RouteService
((
Map
<
String
,
List
<
String
>>)
service
))
.
collect
(
Collectors
.
toList
());
.
collect
(
toList
());
final
var
serviceId
=
getIdFromIdentifier
(
requestedServiceIdentifier
);
if
(
services
.
stream
().
noneMatch
(
service
->
service
.
hasMatchingService
(
serviceId
)))
{
...
...
@@ -200,8 +200,8 @@ public class RouteVerifier implements RoutingVerificationService {
private
final
List
<
String
>
serviceIds
;
protected
RouteService
(
final
Map
<
String
,
List
<
String
>>
service
)
{
regionIds
=
service
.
getOrDefault
(
"gebietIDs"
,
emptyList
()).
stream
().
map
(
RouteVerifier:
:
getIdFromIdentifier
).
collect
(
Collectors
.
toList
());
serviceIds
=
service
.
getOrDefault
(
"leistungIDs"
,
emptyList
()).
stream
().
map
(
RouteVerifier:
:
getIdFromIdentifier
).
collect
(
Collectors
.
toList
());
regionIds
=
service
.
getOrDefault
(
"gebietIDs"
,
emptyList
()).
stream
().
map
(
RouteVerifier:
:
getIdFromIdentifier
).
collect
(
toList
());
serviceIds
=
service
.
getOrDefault
(
"leistungIDs"
,
emptyList
()).
stream
().
map
(
RouteVerifier:
:
getIdFromIdentifier
).
collect
(
toList
());
}
public
boolean
hasMatchingRegionAndService
(
final
String
regionId
,
final
String
serviceId
)
{
...
...
@@ -213,7 +213,7 @@ public class RouteVerifier implements RoutingVerificationService {
}
public
boolean
hasMatchingService
(
final
String
serviceId
)
{
return
serviceIds
.
stream
().
anyMatch
(
serviceId:
:
contains
);
return
serviceIds
.
contains
(
serviceId
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment