Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
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
DEMO
spring-boot
Commits
98d95268
Commit
98d95268
authored
Oct 16, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Align with changes to CouchbaseReactiveHealthIndicator
Closes gh-14799
parent
9350ef69
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
17 deletions
+15
-17
CouchbaseReactiveHealthIndicatorAutoConfiguration.java
...se/CouchbaseReactiveHealthIndicatorAutoConfiguration.java
+12
-14
CouchbaseReactiveHealthIndicatorAutoConfigurationTests.java
...uchbaseReactiveHealthIndicatorAutoConfigurationTests.java
+3
-3
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/couchbase/CouchbaseReactiveHealthIndicatorAutoConfiguration.java
View file @
98d95268
...
...
@@ -17,7 +17,7 @@ package org.springframework.boot.actuate.autoconfigure.couchbase;
import
java.util.Map
;
import
com.couchbase.client.java.
Bucket
;
import
com.couchbase.client.java.
Cluster
;
import
reactor.core.publisher.Flux
;
import
org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthIndicatorConfiguration
;
...
...
@@ -31,10 +31,9 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.
data.couchbase.CouchbaseReactiveData
AutoConfiguration
;
import
org.springframework.boot.autoconfigure.
couchbase.Couchbase
AutoConfiguration
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.couchbase.core.RxJavaCouchbaseOperations
;
/**
* {@link EnableAutoConfiguration Auto-configuration} for
...
...
@@ -45,31 +44,30 @@ import org.springframework.data.couchbase.core.RxJavaCouchbaseOperations;
* @since 2.1.0
*/
@Configuration
@ConditionalOnClass
({
Bucket
.
class
,
RxJavaCouchbaseOperations
.
class
,
Flux
.
class
})
@ConditionalOnBean
(
RxJavaCouchbaseOperations
.
class
)
@ConditionalOnClass
({
Cluster
.
class
,
Flux
.
class
})
@ConditionalOnBean
(
Cluster
.
class
)
@ConditionalOnEnabledHealthIndicator
(
"couchbase"
)
@AutoConfigureBefore
(
HealthIndicatorAutoConfiguration
.
class
)
@AutoConfigureAfter
(
Couchbase
ReactiveData
AutoConfiguration
.
class
)
@AutoConfigureAfter
(
CouchbaseAutoConfiguration
.
class
)
public
class
CouchbaseReactiveHealthIndicatorAutoConfiguration
extends
CompositeReactiveHealthIndicatorConfiguration
<
CouchbaseReactiveHealthIndicator
,
RxJavaCouchbaseOperations
>
{
CompositeReactiveHealthIndicatorConfiguration
<
CouchbaseReactiveHealthIndicator
,
Cluster
>
{
private
final
Map
<
String
,
RxJavaCouchbaseOperations
>
couchbaseOperation
s
;
private
final
Map
<
String
,
Cluster
>
cluster
s
;
public
CouchbaseReactiveHealthIndicatorAutoConfiguration
(
Map
<
String
,
RxJavaCouchbaseOperations
>
couchbaseOperation
s
)
{
this
.
c
ouchbaseOperations
=
couchbaseOperation
s
;
Map
<
String
,
Cluster
>
cluster
s
)
{
this
.
c
lusters
=
cluster
s
;
}
@Bean
@ConditionalOnMissingBean
(
name
=
"couchbaseReactiveHealthIndicator"
)
public
ReactiveHealthIndicator
couchbaseReactiveHealthIndicator
()
{
return
createHealthIndicator
(
this
.
c
ouchbaseOperation
s
);
return
createHealthIndicator
(
this
.
c
luster
s
);
}
@Override
protected
CouchbaseReactiveHealthIndicator
createHealthIndicator
(
RxJavaCouchbaseOperations
couchbaseOperations
)
{
return
new
CouchbaseReactiveHealthIndicator
(
couchbaseOperations
);
protected
CouchbaseReactiveHealthIndicator
createHealthIndicator
(
Cluster
cluster
)
{
return
new
CouchbaseReactiveHealthIndicator
(
cluster
);
}
}
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/couchbase/CouchbaseReactiveHealthIndicatorAutoConfigurationTests.java
View file @
98d95268
...
...
@@ -15,6 +15,7 @@
*/
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
couchbase
;
import
com.couchbase.client.java.Cluster
;
import
org.junit.Test
;
import
org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration
;
...
...
@@ -25,7 +26,6 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.couchbase.core.RxJavaCouchbaseOperations
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Mockito
.
mock
;
...
...
@@ -63,8 +63,8 @@ public class CouchbaseReactiveHealthIndicatorAutoConfigurationTests {
protected
static
class
CouchbaseMockConfiguration
{
@Bean
public
RxJavaCouchbaseOperations
couchbaseOperations
()
{
return
mock
(
RxJavaCouchbaseOperations
.
class
);
public
Cluster
couchbaseCluster
()
{
return
mock
(
Cluster
.
class
);
}
}
...
...
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