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
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
72 additions
and
86 deletions
+72
-86
SpringBootAdminApplication.java
...de/codecentric/boot/admin/SpringBootAdminApplication.java
+0
-1
SpringBootAdminApplication.java
...de/codecentric/boot/admin/SpringBootAdminApplication.java
+19
-19
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
+1
-1
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
+1
-1
InMemoryFileResource.java
...ecentric/boot/admin/io/resource/InMemoryFileResource.java
+1
-1
Application.java
...ain/java/de/codecentric/boot/admin/model/Application.java
+2
-2
AbstractEventNotifier.java
.../codecentric/boot/admin/notify/AbstractEventNotifier.java
+1
-3
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
+1
-1
ApplicationNameNotificationFilter.java
...dmin/notify/filter/ApplicationNameNotificationFilter.java
+1
-1
ApplicationRegistry.java
.../codecentric/boot/admin/registry/ApplicationRegistry.java
+4
-7
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
+1
-1
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
+1
-1
ApplicationRegistryTest.java
...ecentric/boot/admin/registry/ApplicationRegistryTest.java
+13
-13
ApplicationTest.java
.../codecentric/boot/admin/registration/ApplicationTest.java
+0
-1
RegistrationApplicationListenerTest.java
...min/registration/RegistrationApplicationListenerTest.java
+6
-9
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;
import
de.codecentric.boot.admin.config.EnableAdminServer
;
// tag::application-eureka[]
@Configuration
@EnableAutoConfiguration
...
...
spring-boot-admin-samples/spring-boot-admin-sample/src/main/java/de/codecentric/boot/admin/SpringBootAdminApplication.java
View file @
ad70d6cd
...
...
@@ -69,27 +69,27 @@ public class SpringBootAdminApplication {
@Configuration
public
static
class
NotifierConfig
{
@Bean
@Primary
public
RemindingNotifier
remindingNotifier
()
{
RemindingNotifier
notifier
=
new
RemindingNotifier
(
filteringNotifier
(
loggerNotifier
()));
notifier
.
setReminderPeriod
(
TimeUnit
.
SECONDS
.
toMillis
(
10
));
return
notifier
;
}
@Bean
@Primary
public
RemindingNotifier
remindingNotifier
()
{
RemindingNotifier
notifier
=
new
RemindingNotifier
(
filteringNotifier
(
loggerNotifier
()));
notifier
.
setReminderPeriod
(
TimeUnit
.
SECONDS
.
toMillis
(
10
));
return
notifier
;
}
@Scheduled
(
fixedRate
=
1_000L
)
public
void
remind
()
{
remindingNotifier
().
sendReminders
();
}
@Scheduled
(
fixedRate
=
1_000L
)
public
void
remind
()
{
remindingNotifier
().
sendReminders
();
}
@Bean
public
FilteringNotifier
filteringNotifier
(
Notifier
delegate
)
{
return
new
FilteringNotifier
(
delegate
);
}
@Bean
public
FilteringNotifier
filteringNotifier
(
Notifier
delegate
)
{
return
new
FilteringNotifier
(
delegate
);
}
@Bean
public
LoggingNotifier
loggerNotifier
()
{
return
new
LoggingNotifier
();
}
@Bean
public
LoggingNotifier
loggerNotifier
()
{
return
new
LoggingNotifier
();
}
}
}
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 {
*/
private
boolean
enabled
=
true
;
public
String
[]
getClusters
()
{
return
clusters
;
}
...
...
spring-boot-admin-server-ui-turbine/src/main/java/spring/boot/admin/turbine/web/TurbineController.java
View file @
ad70d6cd
...
...
@@ -27,7 +27,7 @@ import de.codecentric.boot.admin.web.AdminController;
/**
* Provides informations for the turbine view. Only available clusters until now.
*
*
* @author Johannes Edmeier
*/
@AdminController
...
...
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 {
private
final
Map
<
String
,
ZuulRoute
>
routes
;
private
DiscoveryClient
discovery
;
public
TurbineRouteLocator
(
ZuulRoute
route
,
String
servletPath
,
ZuulProperties
zuulProperties
,
DiscoveryClient
discovery
)
{
public
TurbineRouteLocator
(
ZuulRoute
route
,
String
servletPath
,
ZuulProperties
zuulProperties
,
DiscoveryClient
discovery
)
{
super
(
servletPath
,
zuulProperties
);
this
.
routes
=
singletonMap
(
route
.
getPath
(),
route
);
this
.
discovery
=
discovery
;
...
...
@@ -68,8 +68,7 @@ public class TurbineRouteLocator extends SimpleRouteLocator {
private
String
resolveServiceId
(
String
location
)
{
List
<
ServiceInstance
>
instances
=
discovery
.
getInstances
(
location
);
if
(
instances
.
isEmpty
())
{
throw
new
IllegalStateException
(
"No instance found for serviceId '"
+
location
+
"'"
);
throw
new
IllegalStateException
(
"No instance found for serviceId '"
+
location
+
"'"
);
}
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;
public
class
TurbineControllerTest
{
private
MockMvc
mvc
=
MockMvcBuilders
.
standaloneSetup
(
new
TurbineController
(
new
String
[]
{
"c1"
,
"c2"
}))
.
build
();
.
standaloneSetup
(
new
TurbineController
(
new
String
[]
{
"c1"
,
"c2"
})).
build
();
@Test
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
@Override
public
Application
convert
(
ServiceInstance
instance
)
{
LOGGER
.
debug
(
"Converting service '{}' running at '{}' with metadata {}"
,
instance
.
getServiceId
(),
instance
.
getUri
(),
instance
.
getMetadata
());
instance
.
getServiceId
(),
instance
.
getUri
(),
instance
.
getMetadata
());
Application
.
Builder
builder
=
Application
.
create
(
instance
.
getServiceId
());
URI
healthUrl
=
getHealthUrl
(
instance
);
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/event/RoutesOutdatedEvent.java
View file @
ad70d6cd
...
...
@@ -19,7 +19,7 @@ import java.io.Serializable;
/**
* Signals that the routes needs to be recalculated.
*
*
* @author Johannes Edmeier
*/
public
class
RoutesOutdatedEvent
implements
Serializable
{
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/io/resource/InMemoryFileResource.java
View file @
ad70d6cd
...
...
@@ -6,7 +6,7 @@ import org.springframework.core.io.ByteArrayResource;
/**
* Extension of ByteArrayResource with lastModified and filename.
*
*
* @author Johannes Edmeier
*/
public
class
InMemoryFileResource
extends
ByteArrayResource
{
...
...
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 {
@Override
public
String
toString
()
{
return
"Application [id="
+
id
+
", name="
+
name
+
", managementUrl="
+
managementUrl
+
", healthUrl="
+
healthUrl
+
", serviceUrl="
+
serviceUrl
+
"]"
;
return
"Application [id="
+
id
+
", name="
+
name
+
", managementUrl="
+
managementUrl
+
", healthUrl="
+
healthUrl
+
", serviceUrl="
+
serviceUrl
+
"]"
;
}
@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 {
}
}
protected
boolean
shouldNotify
(
ClientApplicationEvent
event
)
{
return
true
;
}
...
...
@@ -61,4 +60,4 @@ public abstract class AbstractEventNotifier implements Notifier {
public
boolean
isEnabled
()
{
return
enabled
;
}
}
\ No newline at end of file
}
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 {
protected
void
doNotify
(
ClientApplicationEvent
event
)
throws
Exception
{
if
(
event
instanceof
ClientApplicationStatusChangedEvent
)
{
LOGGER
.
info
(
"Application {} ({}) is {}"
,
event
.
getApplication
().
getName
(),
event
.
getApplication
().
getId
(),
((
ClientApplicationStatusChangedEvent
)
event
).
getTo
().
getStatus
());
event
.
getApplication
().
getId
(),
((
ClientApplicationStatusChangedEvent
)
event
).
getTo
().
getStatus
());
}
else
{
LOGGER
.
info
(
"Application {} ({}) {}"
,
event
.
getApplication
().
getName
(),
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 {
protected
String
getColor
(
ClientApplicationEvent
event
)
{
if
(
event
instanceof
ClientApplicationStatusChangedEvent
)
{
return
"UP"
.
equals
(((
ClientApplicationStatusChangedEvent
)
event
).
getTo
().
getStatus
())
?
"good"
:
"danger"
;
return
"UP"
.
equals
(((
ClientApplicationStatusChangedEvent
)
event
).
getTo
().
getStatus
())
?
"good"
:
"danger"
;
}
else
{
return
"#439FE0"
;
}
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/filter/ApplicationIdNotificationFilter.java
View file @
ad70d6cd
...
...
@@ -17,7 +17,7 @@ package de.codecentric.boot.admin.notify.filter;
import
de.codecentric.boot.admin.event.ClientApplicationEvent
;
public
class
ApplicationIdNotificationFilter
extends
ExpiringNotificationFilter
{
public
class
ApplicationIdNotificationFilter
extends
ExpiringNotificationFilter
{
private
final
String
id
;
public
ApplicationIdNotificationFilter
(
String
id
,
long
expiry
)
{
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/filter/ApplicationNameNotificationFilter.java
View file @
ad70d6cd
...
...
@@ -17,7 +17,7 @@ package de.codecentric.boot.admin.notify.filter;
import
de.codecentric.boot.admin.event.ClientApplicationEvent
;
public
class
ApplicationNameNotificationFilter
extends
ExpiringNotificationFilter
{
public
class
ApplicationNameNotificationFilter
extends
ExpiringNotificationFilter
{
private
final
String
name
;
public
ApplicationNameNotificationFilter
(
String
name
,
long
expiry
)
{
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/ApplicationRegistry.java
View file @
ad70d6cd
...
...
@@ -59,12 +59,10 @@ public class ApplicationRegistry implements ApplicationEventPublisherAware {
Assert
.
hasText
(
application
.
getName
(),
"Name 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
(
StringUtils
.
isEmpty
(
application
.
getManagementUrl
())
||
checkUrl
(
application
.
getManagementUrl
()),
"URL is not valid"
);
Assert
.
isTrue
(
StringUtils
.
isEmpty
(
application
.
getServiceUrl
())
||
checkUrl
(
application
.
getServiceUrl
()),
"URL is not valid"
);
Assert
.
isTrue
(
StringUtils
.
isEmpty
(
application
.
getManagementUrl
())
||
checkUrl
(
application
.
getManagementUrl
()),
"URL is not valid"
);
Assert
.
isTrue
(
StringUtils
.
isEmpty
(
application
.
getServiceUrl
())
||
checkUrl
(
application
.
getServiceUrl
()),
"URL is not valid"
);
String
applicationId
=
generator
.
generateId
(
application
);
Assert
.
notNull
(
applicationId
,
"ID must not be null"
);
...
...
@@ -91,7 +89,6 @@ public class ApplicationRegistry implements ApplicationEventPublisherAware {
return
registering
;
}
/**
* 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;
* Generates an SHA-1 Hash based on the applications url.
*/
public
class
HashingApplicationUrlIdGenerator
implements
ApplicationIdGenerator
{
private
static
final
char
[]
HEX_CHARS
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'
a'
,
'
b'
,
'c'
,
'd'
,
'e'
,
'f'
};
private
static
final
char
[]
HEX_CHARS
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
};
@Override
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;
import
de.codecentric.boot.admin.event.ClientApplicationRegisteredEvent
;
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
StatusUpdater
statusUpdater
;
private
long
updatePeriod
=
10_000L
;
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/web/client/BasicAuthHttpHeaderProvider.java
View file @
ad70d6cd
...
...
@@ -11,7 +11,7 @@ import de.codecentric.boot.admin.model.Application;
/**
* Provides Basic Auth headers for the {@link Application} using the metadata for "user.name" and
* "user.password".
*
*
* @author Johannes Edmeier
*/
public
class
BasicAuthHttpHeaderProvider
implements
HttpHeadersProvider
{
...
...
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;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
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 {
@Test
public
void
test_registration
()
{
ClientApplicationEvent
emittedEvent
=
new
ClientApplicationRegisteredEvent
(
Application
.
create
(
"foo"
).
withId
(
"bar"
).
withHealthUrl
(
"http://health"
).
build
());
ClientApplicationEvent
emittedEvent
=
new
ClientApplicationRegisteredEvent
(
Application
.
create
(
"foo"
).
withId
(
"bar"
).
withHealthUrl
(
"http://health"
).
build
());
journal
.
onClientApplicationEvent
(
emittedEvent
);
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 {
public
void
setup
()
{
HazelcastInstance
hazelcast
=
HazelcastInstanceFactory
.
newHazelcastInstance
(
new
Config
());
store
=
new
HazelcastJournaledEventStore
(
hazelcast
.<
ClientApplicationEvent
>
getList
(
"testList"
));
hazelcast
.<
ClientApplicationEvent
>
getList
(
"testList"
));
}
@Test
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/model/StatusInfoTest.java
View file @
ad70d6cd
package
de
.
codecentric
.
boot
.
admin
.
model
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
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 {
public
void
test_all_notifiers_get_notified
()
throws
Exception
{
TestNotifier
notifier1
=
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
);
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/notify/RemindingNotifierTest.java
View file @
ad70d6cd
package
de
.
codecentric
.
boot
.
admin
.
notify
;
import
static
java
.
util
.
Arrays
.
asList
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
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 {
public
void
test_filterByName
()
{
NotificationFilter
filter
=
new
ApplicationIdNotificationFilter
(
"cafebabe"
,
-
1L
);
ClientApplicationRegisteredEvent
fooEvent
=
new
ClientApplicationRegisteredEvent
(
Application
.
create
(
"foo"
).
withId
(
"cafebabe"
).
withHealthUrl
(
"http://health"
)
.
build
());
ClientApplicationRegisteredEvent
fooEvent
=
new
ClientApplicationRegisteredEvent
(
Application
.
create
(
"foo"
).
withId
(
"cafebabe"
).
withHealthUrl
(
"http://health"
).
build
());
assertThat
(
filter
.
filter
(
fooEvent
)).
isTrue
();
ClientApplicationRegisteredEvent
barEvent
=
new
ClientApplicationRegisteredEvent
(
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/notify/filter/web/NotificationFilterControllerTest.java
View file @
ad70d6cd
...
...
@@ -48,7 +48,7 @@ public class NotificationFilterControllerTest {
String
id
=
extractId
(
response
);
mvc
.
perform
(
get
(
"/api/notifications/filters"
)).
andExpect
(
status
().
isOk
())
.
andExpect
(
jsonPath
(
"$..id"
).
value
(
"1337"
));
.
andExpect
(
jsonPath
(
"$..id"
).
value
(
"1337"
));
mvc
.
perform
(
delete
(
"/api/notifications/filters/{id}"
,
id
)).
andExpect
(
status
().
isOk
());
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/registry/ApplicationRegistryTest.java
View file @
ad70d6cd
...
...
@@ -73,8 +73,8 @@ public class ApplicationRegistryTest {
@Test
public
void
register
()
throws
Exception
{
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost:8080/health"
).
build
());
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost:8080/health"
).
build
());
assertThat
(
app
.
getHealthUrl
()).
isEqualTo
(
"http://localhost:8080/health"
);
assertThat
(
app
.
getName
()).
isEqualTo
(
"abc"
);
...
...
@@ -102,17 +102,17 @@ public class ApplicationRegistryTest {
@Test
public
void
getApplication
()
throws
Exception
{
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost/health"
)
.
withManagementUrl
(
"http://localhost:8080/"
).
build
());
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
).
withHealthUrl
(
"http://localhost/health"
)
.
withManagementUrl
(
"http://localhost:8080/"
).
build
());
assertThat
(
registry
.
getApplication
(
app
.
getId
())).
isEqualTo
(
app
);
assertThat
(
app
.
getManagementUrl
()).
isEqualTo
(
"http://localhost:8080/"
);
}
@Test
public
void
getApplications
()
throws
Exception
{
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost/health"
).
build
());
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost/health"
).
build
());
Collection
<
Application
>
applications
=
registry
.
getApplications
();
assertThat
(
applications
).
containsOnly
(
app
);
...
...
@@ -120,12 +120,12 @@ public class ApplicationRegistryTest {
@Test
public
void
getApplicationsByName
()
throws
Exception
{
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost/health"
).
build
());
Application
app2
=
registry
.
register
(
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost:8081/health"
).
build
());
Application
app3
=
registry
.
register
(
Application
.
create
(
"zzz"
)
.
withHealthUrl
(
"http://localhost:8082/health"
).
build
());
Application
app
=
registry
.
register
(
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost/health"
).
build
());
Application
app2
=
registry
.
register
(
Application
.
create
(
"abc"
)
.
withHealthUrl
(
"http://localhost:8081/health"
).
build
());
Application
app3
=
registry
.
register
(
Application
.
create
(
"zzz"
)
.
withHealthUrl
(
"http://localhost:8082/health"
).
build
());
Collection
<
Application
>
applications
=
registry
.
getApplicationsByName
(
"abc"
);
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
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
java.io.IOException
;
...
...
spring-boot-admin-starter-client/src/test/java/de/codecentric/boot/admin/registration/RegistrationApplicationListenerTest.java
View file @
ad70d6cd
...
...
@@ -29,9 +29,8 @@ public class RegistrationApplicationListenerTest {
RegistrationApplicationListener
listener
=
new
RegistrationApplicationListener
(
registrator
,
scheduler
);
listener
.
onApplicationReady
(
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
mock
(
ConfigurableWebApplicationContext
.
class
)));
listener
.
onApplicationReady
(
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
mock
(
ConfigurableWebApplicationContext
.
class
)));
verify
(
scheduler
).
scheduleAtFixedRate
(
isA
(
Runnable
.
class
),
eq
(
10_000L
));
}
...
...
@@ -44,9 +43,8 @@ public class RegistrationApplicationListenerTest {
scheduler
);
listener
.
setAutoRegister
(
false
);
listener
.
onApplicationReady
(
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
mock
(
ConfigurableWebApplicationContext
.
class
)));
listener
.
onApplicationReady
(
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
mock
(
ConfigurableWebApplicationContext
.
class
)));
verify
(
scheduler
,
never
()).
scheduleAtFixedRate
(
isA
(
Runnable
.
class
),
eq
(
10_000L
));
}
...
...
@@ -62,9 +60,8 @@ public class RegistrationApplicationListenerTest {
ScheduledFuture
task
=
mock
(
ScheduledFuture
.
class
);
when
(
scheduler
.
scheduleAtFixedRate
(
isA
(
Runnable
.
class
),
eq
(
10_000L
))).
thenReturn
(
task
);
listener
.
onApplicationReady
(
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
mock
(
ConfigurableWebApplicationContext
.
class
)));
listener
.
onApplicationReady
(
new
ApplicationReadyEvent
(
mock
(
SpringApplication
.
class
),
null
,
mock
(
ConfigurableWebApplicationContext
.
class
)));
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