Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Access Token Provider
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gazelle
Applications
Test execution
Simulator
Access Token Provider
Commits
bdf514f9
Commit
bdf514f9
authored
4 years ago
by
Wylem Bars
Browse files
Options
Downloads
Patches
Plain Diff
IUAINFRA-52 | Fix sonar
parent
3492369e
No related branches found
No related tags found
1 merge request
!2
Feature/iuainfra 52
Pipeline
#165470
failed
4 years ago
Stage: build
Stage: tests
Stage: cleanup
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
audience-retriever/src/main/java/net/ihe/gazelle/app/audienceretriever/adapter/AudienceSecretRetrieverForSoapui.java
+24
-3
24 additions, 3 deletions
...ceretriever/adapter/AudienceSecretRetrieverForSoapui.java
with
24 additions
and
3 deletions
audience-retriever/src/main/java/net/ihe/gazelle/app/audienceretriever/adapter/AudienceSecretRetrieverForSoapui.java
+
24
−
3
View file @
bdf514f9
...
@@ -8,22 +8,40 @@ import java.io.FileInputStream;
...
@@ -8,22 +8,40 @@ import java.io.FileInputStream;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Properties
;
import
java.util.Properties
;
/**
* {@link AudienceSecretRetriever} used by SoapUI project to retrieve secrets.
*/
public
class
AudienceSecretRetrieverForSoapui
implements
AudienceSecretRetriever
{
public
class
AudienceSecretRetrieverForSoapui
implements
AudienceSecretRetriever
{
private
static
final
GazelleLogger
LOGGER
=
GazelleLoggerFactory
.
getInstance
().
getLogger
(
AudienceSecretRetrieverForSoapui
.
class
);
private
static
final
GazelleLogger
LOGGER
=
GazelleLoggerFactory
.
getInstance
().
getLogger
(
AudienceSecretRetrieverForSoapui
.
class
);
private
String
propertiesFile
=
"/opt/simulators/audience.properties"
;
private
String
propertiesFile
=
"/opt/simulators/audience.properties"
;
/**
* Default constructor for the class.
*/
public
AudienceSecretRetrieverForSoapui
()
{
public
AudienceSecretRetrieverForSoapui
()
{
//Empty Constructor
}
}
/**
* Constructor allowing to configure the properties file path.
*
* @param propertiesFile path to the properties file.
*/
public
AudienceSecretRetrieverForSoapui
(
String
propertiesFile
)
{
public
AudienceSecretRetrieverForSoapui
(
String
propertiesFile
)
{
this
.
propertiesFile
=
propertiesFile
;
this
.
propertiesFile
=
propertiesFile
;
}
}
public
static
Properties
readPropertiesFile
(
String
fileName
)
{
/**
* Read property file as {@link Properties}.
*
* @param filePath path to hte properties file.
* @return the {@link Properties} defined by the file.
*/
private
static
Properties
readPropertiesFile
(
String
filePath
)
{
Properties
prop
=
null
;
Properties
prop
=
null
;
try
(
FileInputStream
fis
=
new
FileInputStream
(
file
Name
))
{
try
(
FileInputStream
fis
=
new
FileInputStream
(
file
Path
))
{
prop
=
new
Properties
();
prop
=
new
Properties
();
prop
.
load
(
fis
);
prop
.
load
(
fis
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -32,9 +50,12 @@ public class AudienceSecretRetrieverForSoapui implements AudienceSecretRetriever
...
@@ -32,9 +50,12 @@ public class AudienceSecretRetrieverForSoapui implements AudienceSecretRetriever
return
prop
;
return
prop
;
}
}
/**
* {@inheritDoc}
*/
@Override
@Override
public
String
retrieveSecretForAudience
(
String
audience
)
{
public
String
retrieveSecretForAudience
(
String
audience
)
{
Properties
prop
=
readPropertiesFile
(
propertiesFile
);
Properties
prop
=
readPropertiesFile
(
propertiesFile
);
return
prop
.
getProperty
(
audience
);
return
prop
!=
null
?
prop
.
getProperty
(
audience
)
:
null
;
}
}
}
}
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