Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
98785c1a
Commit
98785c1a
authored
Jun 19, 2018
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix FindBugs issues
parent
e09cf820
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
51 deletions
+15
-51
AdminServerProperties.java
...ntric/boot/admin/server/config/AdminServerProperties.java
+0
-36
LetsChatNotifier.java
...odecentric/boot/admin/server/notify/LetsChatNotifier.java
+2
-1
FilteringNotifier.java
...ic/boot/admin/server/notify/filter/FilteringNotifier.java
+1
-3
LetsChatNotifierTest.java
...entric/boot/admin/server/notify/LetsChatNotifierTest.java
+7
-6
InfoUpdaterTest.java
...decentric/boot/admin/server/services/InfoUpdaterTest.java
+1
-1
StatusUpdaterTest.java
...centric/boot/admin/server/services/StatusUpdaterTest.java
+1
-1
ProbeEndpointsStrategyTest.java
...server/services/endpoints/ProbeEndpointsStrategyTest.java
+1
-1
AbstractInstancesProxyControllerIntegrationTest.java
.../web/AbstractInstancesProxyControllerIntegrationTest.java
+1
-1
InstanceWebClientTest.java
...c/boot/admin/server/web/client/InstanceWebClientTest.java
+1
-1
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerProperties.java
View file @
98785c1a
...
@@ -58,34 +58,6 @@ public class AdminServerProperties {
...
@@ -58,34 +58,6 @@ public class AdminServerProperties {
this
.
contextPath
=
PathUtils
.
normalizePath
(
contextPath
);
this
.
contextPath
=
PathUtils
.
normalizePath
(
contextPath
);
}
}
public
String
getContextPath
()
{
return
contextPath
;
}
public
MonitorProperties
getMonitor
()
{
return
monitor
;
}
public
String
[]
getMetadataKeysToSanitize
()
{
return
metadataKeysToSanitize
;
}
public
void
setMetadataKeysToSanitize
(
String
[]
metadataKeysToSanitize
)
{
this
.
metadataKeysToSanitize
=
metadataKeysToSanitize
;
}
public
String
[]
getProbedEndpoints
()
{
return
probedEndpoints
;
}
public
void
setProbedEndpoints
(
String
[]
probedEndpoints
)
{
this
.
probedEndpoints
=
probedEndpoints
;
}
public
InstanceProxyProperties
getInstanceProxy
()
{
return
instanceProxy
;
}
@lombok
.
Data
@lombok
.
Data
public
static
class
MonitorProperties
{
public
static
class
MonitorProperties
{
/**
/**
...
@@ -121,13 +93,5 @@ public class AdminServerProperties {
...
@@ -121,13 +93,5 @@ public class AdminServerProperties {
* Headers not to be forwarded when making requests to clients.
* Headers not to be forwarded when making requests to clients.
*/
*/
private
Set
<
String
>
ignoredHeaders
=
new
HashSet
<>(
asList
(
"Cookie"
,
"Set-Cookie"
,
"Authorization"
));
private
Set
<
String
>
ignoredHeaders
=
new
HashSet
<>(
asList
(
"Cookie"
,
"Set-Cookie"
,
"Authorization"
));
public
Set
<
String
>
getIgnoredHeaders
()
{
return
ignoredHeaders
;
}
public
void
setIgnoredHeaders
(
Set
<
String
>
ignoredHeaders
)
{
this
.
ignoredHeaders
=
ignoredHeaders
;
}
}
}
}
}
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/LetsChatNotifier.java
View file @
98785c1a
...
@@ -22,6 +22,7 @@ import de.codecentric.boot.admin.server.domain.events.InstanceEvent;
...
@@ -22,6 +22,7 @@ import de.codecentric.boot.admin.server.domain.events.InstanceEvent;
import
reactor.core.publisher.Mono
;
import
reactor.core.publisher.Mono
;
import
java.net.URI
;
import
java.net.URI
;
import
java.nio.charset.StandardCharsets
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.context.expression.MapAccessor
;
import
org.springframework.context.expression.MapAccessor
;
...
@@ -83,7 +84,7 @@ public class LetsChatNotifier extends AbstractStatusChangeNotifier {
...
@@ -83,7 +84,7 @@ public class LetsChatNotifier extends AbstractStatusChangeNotifier {
HttpHeaders
headers
=
new
HttpHeaders
();
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
// Let's Chat requiers the token as basic username, the password can be an arbitrary string.
// Let's Chat requiers the token as basic username, the password can be an arbitrary string.
String
auth
=
Base64Utils
.
encodeToString
(
String
.
format
(
"%s:%s"
,
token
,
username
).
getBytes
());
String
auth
=
Base64Utils
.
encodeToString
(
String
.
format
(
"%s:%s"
,
token
,
username
).
getBytes
(
StandardCharsets
.
UTF_8
));
headers
.
add
(
HttpHeaders
.
AUTHORIZATION
,
String
.
format
(
"Basic %s"
,
auth
));
headers
.
add
(
HttpHeaders
.
AUTHORIZATION
,
String
.
format
(
"Basic %s"
,
auth
));
return
Mono
.
fromRunnable
(()
->
restTemplate
.
exchange
(
createUrl
(),
HttpMethod
.
POST
,
return
Mono
.
fromRunnable
(()
->
restTemplate
.
exchange
(
createUrl
(),
HttpMethod
.
POST
,
new
HttpEntity
<>(
createMessage
(
event
,
instance
),
headers
),
Void
.
class
));
new
HttpEntity
<>(
createMessage
(
event
,
instance
),
headers
),
Void
.
class
));
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/filter/FilteringNotifier.java
View file @
98785c1a
...
@@ -104,9 +104,7 @@ public class FilteringNotifier extends AbstractEventNotifier {
...
@@ -104,9 +104,7 @@ public class FilteringNotifier extends AbstractEventNotifier {
}
}
public
Map
<
String
,
NotificationFilter
>
getNotificationFilters
()
{
public
Map
<
String
,
NotificationFilter
>
getNotificationFilters
()
{
synchronized
(
filters
)
{
return
Collections
.
unmodifiableMap
(
new
HashMap
<>(
filters
));
return
Collections
.
unmodifiableMap
(
new
HashMap
<>(
filters
));
}
}
}
public
void
setCleanupInterval
(
Duration
cleanupInterval
)
{
public
void
setCleanupInterval
(
Duration
cleanupInterval
)
{
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/LetsChatNotifierTest.java
View file @
98785c1a
...
@@ -26,6 +26,7 @@ import reactor.core.publisher.Mono;
...
@@ -26,6 +26,7 @@ import reactor.core.publisher.Mono;
import
reactor.test.StepVerifier
;
import
reactor.test.StepVerifier
;
import
java.net.URI
;
import
java.net.URI
;
import
java.nio.charset.StandardCharsets
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
org.junit.Before
;
import
org.junit.Before
;
...
@@ -44,11 +45,11 @@ import static org.mockito.Mockito.verify;
...
@@ -44,11 +45,11 @@ import static org.mockito.Mockito.verify;
import
static
org
.
mockito
.
Mockito
.
when
;
import
static
org
.
mockito
.
Mockito
.
when
;
public
class
LetsChatNotifierTest
{
public
class
LetsChatNotifierTest
{
private
final
String
room
=
"text_room"
;
private
static
final
String
room
=
"text_room"
;
private
final
String
token
=
"text_token"
;
private
static
final
String
token
=
"text_token"
;
private
final
String
user
=
"api_user"
;
private
static
final
String
user
=
"api_user"
;
private
final
String
host
=
"http://localhost"
;
private
static
final
String
host
=
"http://localhost"
;
private
final
Instance
instance
=
Instance
.
create
(
InstanceId
.
of
(
"-id-"
))
private
static
final
Instance
instance
=
Instance
.
create
(
InstanceId
.
of
(
"-id-"
))
.
register
(
Registration
.
create
(
"App"
,
"http://health"
).
build
());
.
register
(
Registration
.
create
(
"App"
,
"http://health"
).
build
());
private
LetsChatNotifier
notifier
;
private
LetsChatNotifier
notifier
;
private
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
...
@@ -103,7 +104,7 @@ public class LetsChatNotifierTest {
...
@@ -103,7 +104,7 @@ public class LetsChatNotifierTest {
private
HttpEntity
<?>
expectedMessage
(
String
message
)
{
private
HttpEntity
<?>
expectedMessage
(
String
message
)
{
HttpHeaders
httpHeaders
=
new
HttpHeaders
();
HttpHeaders
httpHeaders
=
new
HttpHeaders
();
httpHeaders
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
httpHeaders
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
String
auth
=
Base64Utils
.
encodeToString
(
String
.
format
(
"%s:%s"
,
token
,
user
).
getBytes
());
String
auth
=
Base64Utils
.
encodeToString
(
String
.
format
(
"%s:%s"
,
token
,
user
).
getBytes
(
StandardCharsets
.
UTF_8
));
httpHeaders
.
add
(
HttpHeaders
.
AUTHORIZATION
,
String
.
format
(
"Basic %s"
,
auth
));
httpHeaders
.
add
(
HttpHeaders
.
AUTHORIZATION
,
String
.
format
(
"Basic %s"
,
auth
));
Map
<
String
,
Object
>
messageJson
=
new
HashMap
<>();
Map
<
String
,
Object
>
messageJson
=
new
HashMap
<>();
messageJson
.
put
(
"text"
,
message
);
messageJson
.
put
(
"text"
,
message
);
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/InfoUpdaterTest.java
View file @
98785c1a
...
@@ -46,7 +46,7 @@ import static org.assertj.core.api.Java6Assertions.assertThat;
...
@@ -46,7 +46,7 @@ import static org.assertj.core.api.Java6Assertions.assertThat;
public
class
InfoUpdaterTest
{
public
class
InfoUpdaterTest
{
@ClassRule
@ClassRule
public
static
WireMockClassRule
wireMockClassRule
=
new
WireMockClassRule
(
Options
.
DYNAMIC_PORT
);
public
static
final
WireMockClassRule
wireMockClassRule
=
new
WireMockClassRule
(
Options
.
DYNAMIC_PORT
);
@Rule
@Rule
public
WireMockClassRule
wireMock
=
wireMockClassRule
;
public
WireMockClassRule
wireMock
=
wireMockClassRule
;
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/StatusUpdaterTest.java
View file @
98785c1a
...
@@ -51,7 +51,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -51,7 +51,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public
class
StatusUpdaterTest
{
public
class
StatusUpdaterTest
{
@ClassRule
@ClassRule
public
static
WireMockClassRule
wireMockClass
=
new
WireMockClassRule
(
Options
.
DYNAMIC_PORT
);
public
static
final
WireMockClassRule
wireMockClass
=
new
WireMockClassRule
(
Options
.
DYNAMIC_PORT
);
@Rule
@Rule
public
WireMockClassRule
wireMock
=
wireMockClass
;
public
WireMockClassRule
wireMock
=
wireMockClass
;
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/ProbeEndpointsStrategyTest.java
View file @
98785c1a
...
@@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
...
@@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
public
class
ProbeEndpointsStrategyTest
{
public
class
ProbeEndpointsStrategyTest
{
@ClassRule
@ClassRule
public
static
WireMockClassRule
wireMockClassRule
=
new
WireMockClassRule
(
Options
.
DYNAMIC_PORT
);
public
static
final
WireMockClassRule
wireMockClassRule
=
new
WireMockClassRule
(
Options
.
DYNAMIC_PORT
);
@Rule
@Rule
public
WireMockClassRule
wireMock
=
wireMockClassRule
;
public
WireMockClassRule
wireMock
=
wireMockClassRule
;
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/AbstractInstancesProxyControllerIntegrationTest.java
View file @
98785c1a
...
@@ -61,7 +61,7 @@ public abstract class AbstractInstancesProxyControllerIntegrationTest {
...
@@ -61,7 +61,7 @@ public abstract class AbstractInstancesProxyControllerIntegrationTest {
private
static
ParameterizedTypeReference
<
Map
<
String
,
Object
>>
RESPONSE_TYPE
=
new
ParameterizedTypeReference
<
Map
<
String
,
Object
>>()
{
private
static
ParameterizedTypeReference
<
Map
<
String
,
Object
>>
RESPONSE_TYPE
=
new
ParameterizedTypeReference
<
Map
<
String
,
Object
>>()
{
};
};
@ClassRule
@ClassRule
public
static
WireMockClassRule
wireMock
=
new
WireMockClassRule
(
public
static
final
WireMockClassRule
wireMock
=
new
WireMockClassRule
(
options
().
dynamicPort
().
extensions
(
new
ConnectionCloseExtension
()));
options
().
dynamicPort
().
extensions
(
new
ConnectionCloseExtension
()));
private
static
WebTestClient
client
;
private
static
WebTestClient
client
;
private
static
String
instanceId
;
private
static
String
instanceId
;
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/InstanceWebClientTest.java
View file @
98785c1a
...
@@ -54,7 +54,7 @@ import static org.springframework.http.HttpHeaders.EMPTY;
...
@@ -54,7 +54,7 @@ import static org.springframework.http.HttpHeaders.EMPTY;
public
class
InstanceWebClientTest
{
public
class
InstanceWebClientTest
{
@ClassRule
@ClassRule
public
static
WireMockClassRule
wireMockClass
=
new
WireMockClassRule
(
Options
.
DYNAMIC_PORT
);
public
static
final
WireMockClassRule
wireMockClass
=
new
WireMockClassRule
(
Options
.
DYNAMIC_PORT
);
@Rule
@Rule
public
WireMockClassRule
wireMock
=
wireMockClass
;
public
WireMockClassRule
wireMock
=
wireMockClass
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment