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
ad70d6cd
Commit
ad70d6cd
authored
Jan 01, 2017
by
Johannes Edmeier
Committed by
Johannes Edmeier
Jul 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up sources
parent
eb8b9709
Show whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
39 additions
and
52 deletions
+39
-52
SpringBootAdminApplication.java
...de/codecentric/boot/admin/SpringBootAdminApplication.java
+0
-1
SpringBootAdminApplication.java
...de/codecentric/boot/admin/SpringBootAdminApplication.java
+0
-0
package-lock.json
spring-boot-admin-server-ui-turbine/package-lock.json
+0
-0
TurbineProperties.java
...a/spring/boot/admin/turbine/config/TurbineProperties.java
+0
-1
TurbineController.java
...java/spring/boot/admin/turbine/web/TurbineController.java
+0
-0
TurbineRouteLocator.java
.../boot/admin/turbine/zuul/filters/TurbineRouteLocator.java
+3
-4
TurbineControllerTest.java
.../spring/boot/admin/turbine/web/TurbineControllerTest.java
+1
-2
DefaultServiceInstanceConverter.java
...boot/admin/discovery/DefaultServiceInstanceConverter.java
+1
-2
RoutesOutdatedEvent.java
.../de/codecentric/boot/admin/event/RoutesOutdatedEvent.java
+0
-0
InMemoryFileResource.java
...ecentric/boot/admin/io/resource/InMemoryFileResource.java
+0
-0
Application.java
...ain/java/de/codecentric/boot/admin/model/Application.java
+2
-2
AbstractEventNotifier.java
.../codecentric/boot/admin/notify/AbstractEventNotifier.java
+0
-1
LoggingNotifier.java
...ava/de/codecentric/boot/admin/notify/LoggingNotifier.java
+2
-1
SlackNotifier.java
.../java/de/codecentric/boot/admin/notify/SlackNotifier.java
+2
-1
ApplicationIdNotificationFilter.java
.../admin/notify/filter/ApplicationIdNotificationFilter.java
+0
-0
ApplicationNameNotificationFilter.java
...dmin/notify/filter/ApplicationNameNotificationFilter.java
+0
-0
ApplicationRegistry.java
.../codecentric/boot/admin/registry/ApplicationRegistry.java
+2
-5
HashingApplicationUrlIdGenerator.java
...boot/admin/registry/HashingApplicationUrlIdGenerator.java
+2
-2
StatusUpdateApplicationListener.java
.../boot/admin/registry/StatusUpdateApplicationListener.java
+2
-1
BasicAuthHttpHeaderProvider.java
...ic/boot/admin/web/client/BasicAuthHttpHeaderProvider.java
+0
-0
NotifierConfigurationTest.java
...ecentric/boot/admin/config/NotifierConfigurationTest.java
+0
-1
ApplicationEventJournalTest.java
...ntric/boot/admin/journal/ApplicationEventJournalTest.java
+2
-2
HazelcastJournaledEventStoreTest.java
...admin/journal/store/HazelcastJournaledEventStoreTest.java
+1
-1
StatusInfoTest.java
.../java/de/codecentric/boot/admin/model/StatusInfoTest.java
+0
-1
CompositeNotifierTest.java
.../codecentric/boot/admin/notify/CompositeNotifierTest.java
+2
-1
RemindingNotifierTest.java
.../codecentric/boot/admin/notify/RemindingNotifierTest.java
+0
-1
ApplicationIdNotificationFilterTest.java
...in/notify/filter/ApplicationIdNotificationFilterTest.java
+2
-3
NotificationFilterControllerTest.java
...n/notify/filter/web/NotificationFilterControllerTest.java
+0
-0
ApplicationRegistryTest.java
...ecentric/boot/admin/registry/ApplicationRegistryTest.java
+12
-12
ApplicationTest.java
.../codecentric/boot/admin/registration/ApplicationTest.java
+0
-1
RegistrationApplicationListenerTest.java
...min/registration/RegistrationApplicationListenerTest.java
+3
-6
No files found.
spring-boot-admin-samples/spring-boot-admin-sample-eureka/src/main/java/de/codecentric/boot/admin/SpringBootAdminApplication.java
View file @
ad70d6cd
...
@@ -22,7 +22,6 @@ import org.springframework.context.annotation.Configuration;
...
@@ -22,7 +22,6 @@ import org.springframework.context.annotation.Configuration;
import
de.codecentric.boot.admin.config.EnableAdminServer
;
import
de.codecentric.boot.admin.config.EnableAdminServer
;
// tag::application-eureka[]
// tag::application-eureka[]
@Configuration
@Configuration
@EnableAutoConfiguration
@EnableAutoConfiguration
...
...
spring-boot-admin-samples/spring-boot-admin-sample/src/main/java/de/codecentric/boot/admin/SpringBootAdminApplication.java
View file @
ad70d6cd
spring-boot-admin-server-ui-turbine/package-lock.json
deleted
100644 → 0
View file @
eb8b9709
This source diff could not be displayed because it is too large. You can
view the blob
instead.
spring-boot-admin-server-ui-turbine/src/main/java/spring/boot/admin/turbine/config/TurbineProperties.java
View file @
ad70d6cd
...
@@ -39,7 +39,6 @@ public class TurbineProperties {
...
@@ -39,7 +39,6 @@ public class TurbineProperties {
*/
*/
private
boolean
enabled
=
true
;
private
boolean
enabled
=
true
;
public
String
[]
getClusters
()
{
public
String
[]
getClusters
()
{
return
clusters
;
return
clusters
;
}
}
...
...
spring-boot-admin-server-ui-turbine/src/main/java/spring/boot/admin/turbine/web/TurbineController.java
View file @
ad70d6cd
spring-boot-admin-server-ui-turbine/src/main/java/spring/boot/admin/turbine/zuul/filters/TurbineRouteLocator.java
View file @
ad70d6cd
...
@@ -36,8 +36,8 @@ public class TurbineRouteLocator extends SimpleRouteLocator {
...
@@ -36,8 +36,8 @@ public class TurbineRouteLocator extends SimpleRouteLocator {
private
final
Map
<
String
,
ZuulRoute
>
routes
;
private
final
Map
<
String
,
ZuulRoute
>
routes
;
private
DiscoveryClient
discovery
;
private
DiscoveryClient
discovery
;
public
TurbineRouteLocator
(
ZuulRoute
route
,
String
servletPath
,
public
TurbineRouteLocator
(
ZuulRoute
route
,
String
servletPath
,
ZuulProperties
zuulProperties
,
ZuulProperties
zuulProperties
,
DiscoveryClient
discovery
)
{
DiscoveryClient
discovery
)
{
super
(
servletPath
,
zuulProperties
);
super
(
servletPath
,
zuulProperties
);
this
.
routes
=
singletonMap
(
route
.
getPath
(),
route
);
this
.
routes
=
singletonMap
(
route
.
getPath
(),
route
);
this
.
discovery
=
discovery
;
this
.
discovery
=
discovery
;
...
@@ -68,8 +68,7 @@ public class TurbineRouteLocator extends SimpleRouteLocator {
...
@@ -68,8 +68,7 @@ public class TurbineRouteLocator extends SimpleRouteLocator {
private
String
resolveServiceId
(
String
location
)
{
private
String
resolveServiceId
(
String
location
)
{
List
<
ServiceInstance
>
instances
=
discovery
.
getInstances
(
location
);
List
<
ServiceInstance
>
instances
=
discovery
.
getInstances
(
location
);
if
(
instances
.
isEmpty
())
{
if
(
instances
.
isEmpty
())
{
throw
new
IllegalStateException
(
throw
new
IllegalStateException
(
"No instance found for serviceId '"
+
location
+
"'"
);
"No instance found for serviceId '"
+
location
+
"'"
);
}
}
return
instances
.
get
(
0
).
getUri
().
toString
();
return
instances
.
get
(
0
).
getUri
().
toString
();
...
...
spring-boot-admin-server-ui-turbine/src/test/java/spring/boot/admin/turbine/web/TurbineControllerTest.java
View file @
ad70d6cd
...
@@ -13,8 +13,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
...
@@ -13,8 +13,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
public
class
TurbineControllerTest
{
public
class
TurbineControllerTest
{
private
MockMvc
mvc
=
MockMvcBuilders
private
MockMvc
mvc
=
MockMvcBuilders
.
standaloneSetup
(
new
TurbineController
(
new
String
[]
{
"c1"
,
"c2"
}))
.
standaloneSetup
(
new
TurbineController
(
new
String
[]
{
"c1"
,
"c2"
})).
build
();
.
build
();
@Test
@Test
public
void
test_clusters
()
throws
Exception
{
public
void
test_clusters
()
throws
Exception
{
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/discovery/DefaultServiceInstanceConverter.java
View file @
ad70d6cd
...
@@ -57,8 +57,7 @@ public class DefaultServiceInstanceConverter implements ServiceInstanceConverter
...
@@ -57,8 +57,7 @@ public class DefaultServiceInstanceConverter implements ServiceInstanceConverter
@Override
@Override
public
Application
convert
(
ServiceInstance
instance
)
{
public
Application
convert
(
ServiceInstance
instance
)
{
LOGGER
.
debug
(
"Converting service '{}' running at '{}' with metadata {}"
,
LOGGER
.
debug
(
"Converting service '{}' running at '{}' with metadata {}"
,
instance
.
getServiceId
(),
instance
.
getServiceId
(),
instance
.
getUri
(),
instance
.
getMetadata
());
instance
.
getUri
(),
instance
.
getMetadata
());
Application
.
Builder
builder
=
Application
.
create
(
instance
.
getServiceId
());
Application
.
Builder
builder
=
Application
.
create
(
instance
.
getServiceId
());
URI
healthUrl
=
getHealthUrl
(
instance
);
URI
healthUrl
=
getHealthUrl
(
instance
);
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/event/RoutesOutdatedEvent.java
View file @
ad70d6cd
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/io/resource/InMemoryFileResource.java
View file @
ad70d6cd
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/model/Application.java
View file @
ad70d6cd
...
@@ -198,8 +198,8 @@ public class Application implements Serializable {
...
@@ -198,8 +198,8 @@ public class Application implements Serializable {
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"Application [id="
+
id
+
", name="
+
name
+
", managementUrl="
return
"Application [id="
+
id
+
", name="
+
name
+
", managementUrl="
+
managementUrl
+
managementUrl
+
", healthUrl="
+
healthUrl
+
", serviceUrl="
+
serviceUrl
+
"]"
;
+
", healthUrl="
+
healthUrl
+
", serviceUrl="
+
serviceUrl
+
"]"
;
}
}
@Override
@Override
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/AbstractEventNotifier.java
View file @
ad70d6cd
...
@@ -43,7 +43,6 @@ public abstract class AbstractEventNotifier implements Notifier {
...
@@ -43,7 +43,6 @@ public abstract class AbstractEventNotifier implements Notifier {
}
}
}
}
protected
boolean
shouldNotify
(
ClientApplicationEvent
event
)
{
protected
boolean
shouldNotify
(
ClientApplicationEvent
event
)
{
return
true
;
return
true
;
}
}
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/LoggingNotifier.java
View file @
ad70d6cd
...
@@ -33,7 +33,8 @@ public class LoggingNotifier extends AbstractStatusChangeNotifier {
...
@@ -33,7 +33,8 @@ public class LoggingNotifier extends AbstractStatusChangeNotifier {
protected
void
doNotify
(
ClientApplicationEvent
event
)
throws
Exception
{
protected
void
doNotify
(
ClientApplicationEvent
event
)
throws
Exception
{
if
(
event
instanceof
ClientApplicationStatusChangedEvent
)
{
if
(
event
instanceof
ClientApplicationStatusChangedEvent
)
{
LOGGER
.
info
(
"Application {} ({}) is {}"
,
event
.
getApplication
().
getName
(),
LOGGER
.
info
(
"Application {} ({}) is {}"
,
event
.
getApplication
().
getName
(),
event
.
getApplication
().
getId
(),
((
ClientApplicationStatusChangedEvent
)
event
).
getTo
().
getStatus
());
event
.
getApplication
().
getId
(),
((
ClientApplicationStatusChangedEvent
)
event
).
getTo
().
getStatus
());
}
else
{
}
else
{
LOGGER
.
info
(
"Application {} ({}) {}"
,
event
.
getApplication
().
getName
(),
LOGGER
.
info
(
"Application {} ({}) {}"
,
event
.
getApplication
().
getName
(),
event
.
getApplication
().
getId
(),
event
.
getType
());
event
.
getApplication
().
getId
(),
event
.
getType
());
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/SlackNotifier.java
View file @
ad70d6cd
...
@@ -92,7 +92,8 @@ public class SlackNotifier extends AbstractStatusChangeNotifier {
...
@@ -92,7 +92,8 @@ public class SlackNotifier extends AbstractStatusChangeNotifier {
protected
String
getColor
(
ClientApplicationEvent
event
)
{
protected
String
getColor
(
ClientApplicationEvent
event
)
{
if
(
event
instanceof
ClientApplicationStatusChangedEvent
)
{
if
(
event
instanceof
ClientApplicationStatusChangedEvent
)
{
return
"UP"
.
equals
(((
ClientApplicationStatusChangedEvent
)
event
).
getTo
().
getStatus
())
?
"good"
:
"danger"
;
return
"UP"
.
equals
(((
ClientApplicationStatusChangedEvent
)
event
).
getTo
().
getStatus
())
?
"good"
:
"danger"
;
}
else
{
}
else
{
return
"#439FE0"
;
return
"#439FE0"
;
}
}
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/filter/ApplicationIdNotificationFilter.java
View file @
ad70d6cd
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/filter/ApplicationNameNotificationFilter.java
View file @
ad70d6cd
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/ApplicationRegistry.java
View file @
ad70d6cd
...
@@ -59,11 +59,9 @@ public class ApplicationRegistry implements ApplicationEventPublisherAware {
...
@@ -59,11 +59,9 @@ public class ApplicationRegistry implements ApplicationEventPublisherAware {
Assert
.
hasText
(
application
.
getName
(),
"Name must not be null"
);
Assert
.
hasText
(
application
.
getName
(),
"Name must not be null"
);
Assert
.
hasText
(
application
.
getHealthUrl
(),
"Health-URL must not be null"
);
Assert
.
hasText
(
application
.
getHealthUrl
(),
"Health-URL must not be null"
);
Assert
.
isTrue
(
checkUrl
(
application
.
getHealthUrl
()),
"Health-URL is not valid"
);
Assert
.
isTrue
(
checkUrl
(
application
.
getHealthUrl
()),
"Health-URL is not valid"
);
Assert
.
isTrue
(
Assert
.
isTrue
(
StringUtils
.
isEmpty
(
application
.
getManagementUrl
())
StringUtils
.
isEmpty
(
application
.
getManagementUrl
())
||
checkUrl
(
application
.
getManagementUrl
()),
"URL is not valid"
);
||
checkUrl
(
application
.
getManagementUrl
()),
"URL is not valid"
);
Assert
.
isTrue
(
Assert
.
isTrue
(
StringUtils
.
isEmpty
(
application
.
getServiceUrl
())
StringUtils
.
isEmpty
(
application
.
getServiceUrl
())
||
checkUrl
(
application
.
getServiceUrl
()),
"URL is not valid"
);
||
checkUrl
(
application
.
getServiceUrl
()),
"URL is not valid"
);
String
applicationId
=
generator
.
generateId
(
application
);
String
applicationId
=
generator
.
generateId
(
application
);
...
@@ -91,7 +89,6 @@ public class ApplicationRegistry implements ApplicationEventPublisherAware {
...
@@ -91,7 +89,6 @@ public class ApplicationRegistry implements ApplicationEventPublisherAware {
return
registering
;
return
registering
;
}
}
/**
/**
* Checks the syntax of the given URL.
* Checks the syntax of the given URL.
*
*
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/HashingApplicationUrlIdGenerator.java
View file @
ad70d6cd
...
@@ -25,8 +25,8 @@ import de.codecentric.boot.admin.model.Application;
...
@@ -25,8 +25,8 @@ import de.codecentric.boot.admin.model.Application;
* Generates an SHA-1 Hash based on the applications url.
* Generates an SHA-1 Hash based on the applications url.
*/
*/
public
class
HashingApplicationUrlIdGenerator
implements
ApplicationIdGenerator
{
public
class
HashingApplicationUrlIdGenerator
implements
ApplicationIdGenerator
{
private
static
final
char
[]
HEX_CHARS
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
private
static
final
char
[]
HEX_CHARS
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'a'
,
'
a'
,
'
b'
,
'c'
,
'd'
,
'e'
,
'f'
};
'b'
,
'c'
,
'd'
,
'e'
,
'f'
};
@Override
@Override
public
String
generateId
(
Application
a
)
{
public
String
generateId
(
Application
a
)
{
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/StatusUpdateApplicationListener.java
View file @
ad70d6cd
...
@@ -13,7 +13,8 @@ import org.springframework.web.context.WebApplicationContext;
...
@@ -13,7 +13,8 @@ import org.springframework.web.context.WebApplicationContext;
import
de.codecentric.boot.admin.event.ClientApplicationRegisteredEvent
;
import
de.codecentric.boot.admin.event.ClientApplicationRegisteredEvent
;
public
class
StatusUpdateApplicationListener
{
public
class
StatusUpdateApplicationListener
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
StatusUpdateApplicationListener
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
StatusUpdateApplicationListener
.
class
);
private
final
ThreadPoolTaskScheduler
taskScheduler
;
private
final
ThreadPoolTaskScheduler
taskScheduler
;
private
final
StatusUpdater
statusUpdater
;
private
final
StatusUpdater
statusUpdater
;
private
long
updatePeriod
=
10_000L
;
private
long
updatePeriod
=
10_000L
;
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/web/client/BasicAuthHttpHeaderProvider.java
View file @
ad70d6cd
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/config/NotifierConfigurationTest.java
View file @
ad70d6cd
...
@@ -18,7 +18,6 @@ package de.codecentric.boot.admin.config;
...
@@ -18,7 +18,6 @@ package de.codecentric.boot.admin.config;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
org.junit.After
;
import
org.junit.After
;
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/journal/ApplicationEventJournalTest.java
View file @
ad70d6cd
...
@@ -32,8 +32,8 @@ public class ApplicationEventJournalTest {
...
@@ -32,8 +32,8 @@ public class ApplicationEventJournalTest {
@Test
@Test
public
void
test_registration
()
{
public
void
test_registration
()
{
ClientApplicationEvent
emittedEvent
=
new
ClientApplicationRegisteredEvent
(
Application
ClientApplicationEvent
emittedEvent
=
new
ClientApplicationRegisteredEvent
(
.
create
(
"foo"
).
withId
(
"bar"
).
withHealthUrl
(
"http://health"
).
build
());
Application
.
create
(
"foo"
).
withId
(
"bar"
).
withHealthUrl
(
"http://health"
).
build
());
journal
.
onClientApplicationEvent
(
emittedEvent
);
journal
.
onClientApplicationEvent
(
emittedEvent
);
Collection
<
ClientApplicationEvent
>
events
=
journal
.
getEvents
();
Collection
<
ClientApplicationEvent
>
events
=
journal
.
getEvents
();
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/journal/store/HazelcastJournaledEventStoreTest.java
View file @
ad70d6cd
...
@@ -42,7 +42,7 @@ public class HazelcastJournaledEventStoreTest {
...
@@ -42,7 +42,7 @@ public class HazelcastJournaledEventStoreTest {
public
void
setup
()
{
public
void
setup
()
{
HazelcastInstance
hazelcast
=
HazelcastInstanceFactory
.
newHazelcastInstance
(
new
Config
());
HazelcastInstance
hazelcast
=
HazelcastInstanceFactory
.
newHazelcastInstance
(
new
Config
());
store
=
new
HazelcastJournaledEventStore
(
store
=
new
HazelcastJournaledEventStore
(
hazelcast
.<
ClientApplicationEvent
>
getList
(
"testList"
));
hazelcast
.<
ClientApplicationEvent
>
getList
(
"testList"
));
}
}
@Test
@Test
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/model/StatusInfoTest.java
View file @
ad70d6cd
package
de
.
codecentric
.
boot
.
admin
.
model
;
package
de
.
codecentric
.
boot
.
admin
.
model
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
org.junit.Test
;
import
org.junit.Test
;
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/notify/CompositeNotifierTest.java
View file @
ad70d6cd
...
@@ -28,7 +28,8 @@ public class CompositeNotifierTest {
...
@@ -28,7 +28,8 @@ public class CompositeNotifierTest {
public
void
test_all_notifiers_get_notified
()
throws
Exception
{
public
void
test_all_notifiers_get_notified
()
throws
Exception
{
TestNotifier
notifier1
=
new
TestNotifier
();
TestNotifier
notifier1
=
new
TestNotifier
();
TestNotifier
notifier2
=
new
TestNotifier
();
TestNotifier
notifier2
=
new
TestNotifier
();
CompositeNotifier
compositeNotifier
=
new
CompositeNotifier
(
Arrays
.<
Notifier
>
asList
(
notifier1
,
notifier2
));
CompositeNotifier
compositeNotifier
=
new
CompositeNotifier
(
Arrays
.<
Notifier
>
asList
(
notifier1
,
notifier2
));
compositeNotifier
.
notify
(
APP_DOWN
);
compositeNotifier
.
notify
(
APP_DOWN
);
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/notify/RemindingNotifierTest.java
View file @
ad70d6cd
package
de
.
codecentric
.
boot
.
admin
.
notify
;
package
de
.
codecentric
.
boot
.
admin
.
notify
;
import
static
java
.
util
.
Arrays
.
asList
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
org.junit.Test
;
import
org.junit.Test
;
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/notify/filter/ApplicationIdNotificationFilterTest.java
View file @
ad70d6cd
...
@@ -13,9 +13,8 @@ public class ApplicationIdNotificationFilterTest {
...
@@ -13,9 +13,8 @@ public class ApplicationIdNotificationFilterTest {
public
void
test_filterByName
()
{
public
void
test_filterByName
()
{
NotificationFilter
filter
=
new
ApplicationIdNotificationFilter
(
"cafebabe"
,
-
1L
);
NotificationFilter
filter
=
new
ApplicationIdNotificationFilter
(
"cafebabe"
,
-
1L
);
ClientApplicationRegisteredEvent
fooEvent
=
new
ClientApplicationRegisteredEvent
(
ClientApplicationRegisteredEvent
fooEvent
=
new
ClientApplicationRegisteredEvent
(
Application
Application
.
create
(
"foo"
).
withId
(
"cafebabe"
).
withHealthUrl
(
"http://health"
)
.
create
(
"foo"
).
withId
(
"cafebabe"
).
withHealthUrl
(
"http://health"
).
build
());
.
build
());
assertThat
(
filter
.
filter
(
fooEvent
)).
isTrue
();
assertThat
(
filter
.
filter
(
fooEvent
)).
isTrue
();
ClientApplicationRegisteredEvent
barEvent
=
new
ClientApplicationRegisteredEvent
(
ClientApplicationRegisteredEvent
barEvent
=
new
ClientApplicationRegisteredEvent
(
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/notify/filter/web/NotificationFilterControllerTest.java
View file @
ad70d6cd
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/registry/ApplicationRegistryTest.java
View file @
ad70d6cd
...
@@ -73,8 +73,8 @@ public class ApplicationRegistryTest {
...
@@ -73,8 +73,8 @@ public class ApplicationRegistryTest {
@Test
@Test
public
void
register
()
throws
Exception
{
public
void
register
()
throws
Exception
{
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
)
Application
app
=
registry
.
register
(
.
withHealthUrl
(
"http://localhost:8080/health"
).
build
());
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost:8080/health"
).
build
());
assertThat
(
app
.
getHealthUrl
()).
isEqualTo
(
"http://localhost:8080/health"
);
assertThat
(
app
.
getHealthUrl
()).
isEqualTo
(
"http://localhost:8080/health"
);
assertThat
(
app
.
getName
()).
isEqualTo
(
"abc"
);
assertThat
(
app
.
getName
()).
isEqualTo
(
"abc"
);
...
@@ -102,8 +102,8 @@ public class ApplicationRegistryTest {
...
@@ -102,8 +102,8 @@ public class ApplicationRegistryTest {
@Test
@Test
public
void
getApplication
()
throws
Exception
{
public
void
getApplication
()
throws
Exception
{
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
)
Application
app
=
registry
.
withHealthUrl
(
"http://localhost/health"
)
.
register
(
Application
.
create
(
"abc"
).
withHealthUrl
(
"http://localhost/health"
)
.
withManagementUrl
(
"http://localhost:8080/"
).
build
());
.
withManagementUrl
(
"http://localhost:8080/"
).
build
());
assertThat
(
registry
.
getApplication
(
app
.
getId
())).
isEqualTo
(
app
);
assertThat
(
registry
.
getApplication
(
app
.
getId
())).
isEqualTo
(
app
);
assertThat
(
app
.
getManagementUrl
()).
isEqualTo
(
"http://localhost:8080/"
);
assertThat
(
app
.
getManagementUrl
()).
isEqualTo
(
"http://localhost:8080/"
);
...
@@ -111,8 +111,8 @@ public class ApplicationRegistryTest {
...
@@ -111,8 +111,8 @@ public class ApplicationRegistryTest {
@Test
@Test
public
void
getApplications
()
throws
Exception
{
public
void
getApplications
()
throws
Exception
{
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
)
Application
app
=
registry
.
register
(
.
withHealthUrl
(
"http://localhost/health"
).
build
());
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost/health"
).
build
());
Collection
<
Application
>
applications
=
registry
.
getApplications
();
Collection
<
Application
>
applications
=
registry
.
getApplications
();
assertThat
(
applications
).
containsOnly
(
app
);
assertThat
(
applications
).
containsOnly
(
app
);
...
@@ -120,12 +120,12 @@ public class ApplicationRegistryTest {
...
@@ -120,12 +120,12 @@ public class ApplicationRegistryTest {
@Test
@Test
public
void
getApplicationsByName
()
throws
Exception
{
public
void
getApplicationsByName
()
throws
Exception
{
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
)
Application
app
=
registry
.
register
(
.
withHealthUrl
(
"http://localhost/health"
).
build
());
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost/health"
).
build
());
Application
app2
=
registry
.
register
(
Application
.
create
(
"abc"
)
Application
app2
=
registry
.
register
(
.
withHealthUrl
(
"http://localhost:8081/health"
).
build
());
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost:8081/health"
).
build
());
Application
app3
=
registry
.
register
(
Application
.
create
(
"zzz"
)
Application
app3
=
registry
.
register
(
.
withHealthUrl
(
"http://localhost:8082/health"
).
build
());
Application
.
create
(
"zzz"
)
.
withHealthUrl
(
"http://localhost:8082/health"
).
build
());
Collection
<
Application
>
applications
=
registry
.
getApplicationsByName
(
"abc"
);
Collection
<
Application
>
applications
=
registry
.
getApplicationsByName
(
"abc"
);
assertThat
(
applications
).
containsOnly
(
app
,
app2
);
assertThat
(
applications
).
containsOnly
(
app
,
app2
);
...
...
spring-boot-admin-starter-client/src/test/java/de/codecentric/boot/admin/registration/ApplicationTest.java
View file @
ad70d6cd
package
de
.
codecentric
.
boot
.
admin
.
registration
;
package
de
.
codecentric
.
boot
.
admin
.
registration
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
java.io.IOException
;
import
java.io.IOException
;
...
...
spring-boot-admin-starter-client/src/test/java/de/codecentric/boot/admin/registration/RegistrationApplicationListenerTest.java
View file @
ad70d6cd
...
@@ -29,8 +29,7 @@ public class RegistrationApplicationListenerTest {
...
@@ -29,8 +29,7 @@ public class RegistrationApplicationListenerTest {
RegistrationApplicationListener
listener
=
new
RegistrationApplicationListener
(
registrator
,
RegistrationApplicationListener
listener
=
new
RegistrationApplicationListener
(
registrator
,
scheduler
);
scheduler
);
listener
.
onApplicationReady
(
listener
.
onApplicationReady
(
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
mock
(
ConfigurableWebApplicationContext
.
class
)));
mock
(
ConfigurableWebApplicationContext
.
class
)));
verify
(
scheduler
).
scheduleAtFixedRate
(
isA
(
Runnable
.
class
),
eq
(
10_000L
));
verify
(
scheduler
).
scheduleAtFixedRate
(
isA
(
Runnable
.
class
),
eq
(
10_000L
));
...
@@ -44,8 +43,7 @@ public class RegistrationApplicationListenerTest {
...
@@ -44,8 +43,7 @@ public class RegistrationApplicationListenerTest {
scheduler
);
scheduler
);
listener
.
setAutoRegister
(
false
);
listener
.
setAutoRegister
(
false
);
listener
.
onApplicationReady
(
listener
.
onApplicationReady
(
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
mock
(
ConfigurableWebApplicationContext
.
class
)));
mock
(
ConfigurableWebApplicationContext
.
class
)));
verify
(
scheduler
,
never
()).
scheduleAtFixedRate
(
isA
(
Runnable
.
class
),
eq
(
10_000L
));
verify
(
scheduler
,
never
()).
scheduleAtFixedRate
(
isA
(
Runnable
.
class
),
eq
(
10_000L
));
...
@@ -62,8 +60,7 @@ public class RegistrationApplicationListenerTest {
...
@@ -62,8 +60,7 @@ public class RegistrationApplicationListenerTest {
ScheduledFuture
task
=
mock
(
ScheduledFuture
.
class
);
ScheduledFuture
task
=
mock
(
ScheduledFuture
.
class
);
when
(
scheduler
.
scheduleAtFixedRate
(
isA
(
Runnable
.
class
),
eq
(
10_000L
))).
thenReturn
(
task
);
when
(
scheduler
.
scheduleAtFixedRate
(
isA
(
Runnable
.
class
),
eq
(
10_000L
))).
thenReturn
(
task
);
listener
.
onApplicationReady
(
listener
.
onApplicationReady
(
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
mock
(
ConfigurableWebApplicationContext
.
class
)));
mock
(
ConfigurableWebApplicationContext
.
class
)));
verify
(
scheduler
).
scheduleAtFixedRate
(
isA
(
Runnable
.
class
),
eq
(
10_000L
));
verify
(
scheduler
).
scheduleAtFixedRate
(
isA
(
Runnable
.
class
),
eq
(
10_000L
));
...
...
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