Skip to content

Commit 229eac7

Browse files
authored
Merge pull request #18 from mkopylec/testcontainers
Testcontainers
2 parents 0aa394e + 3e7fd0d commit 229eac7

33 files changed

+622
-172
lines changed

.travis.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
language: java
22
jdk:
3-
- oraclejdk8
4-
before_install:
5-
- sudo apt-get -qq update
6-
- sudo apt-get install -y libssl1.0.0
7-
- sudo wget http://packages.couchbase.com/releases/4.1.1/couchbase-server-community_4.1.1-ubuntu12.04_amd64.deb
8-
- sudo dpkg -i couchbase-server-community_4.1.1-ubuntu12.04_amd64.deb
9-
- sleep 10
10-
- sudo /opt/couchbase/bin/couchbase-cli cluster-init -c localhost:8091 -u Administrator -p password --cluster-ramsize=256 --service=data,index,query
11-
- sudo /opt/couchbase/bin/couchbase-cli bucket-create -c localhost:8091 -u Administrator -p password --bucket=default --bucket-ramsize=256 --bucket-replica=1
3+
- openjdk8
4+
services:
5+
- docker
126
script:
137
- ./gradlew test -i
148
after_success:

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ The starter supports HTTP session namespaces to prevent session attribute's name
101101
The name of the namespace can be set in _application.yml_ file:
102102

103103
```yaml
104-
session-couchbase:
105-
application-namespace: <application_namespace>
104+
session-couchbase.application-namespace: <application_namespace>
106105
```
107106

108107
Each web application in a distributed system can have one application namespace under which the application's session attributes are stored.
@@ -142,6 +141,16 @@ public void doSomething(HttpSession session) {
142141

143142
When changing HTTP session ID every attribute is copied to the new session, no matter what namespace it belongs.
144143

144+
## Metrics
145+
By default no metrics are collected.
146+
It can be enabled in _application.yml_ file:
147+
148+
```yaml
149+
session-couchbase.metrics.enabled: true
150+
```
151+
Metrics are collected using [Micrometer](https://micrometer.io/).
152+
When collecting metrics is enabled a `MeterRegistry` Spring bean must be created.
153+
145154
## Configuration properties list
146155

147156
```yaml
@@ -156,6 +165,8 @@ session-couchbase:
156165
max-attempts: 1 # Maximum number of attempts to repeat a query to Couchbase when an error occurs.
157166
in-memory:
158167
enabled: false # Flag for enabling and disabling in-memory mode.
168+
metrics:
169+
enabled: false # Flag for enabling and disabling metrics collecting.
159170
```
160171

161172
## Examples

build.gradle

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ plugins {
22
id 'groovy'
33
id 'maven-publish'
44
id 'jacoco'
5-
id 'com.github.kt3k.coveralls' version '2.8.2'
5+
id 'com.github.kt3k.coveralls' version '2.8.4'
66
id 'maven'
77
id 'signing'
8-
id 'pl.allegro.tech.build.axion-release' version '1.9.2'
9-
id 'io.codearte.nexus-staging' version '0.11.0'
8+
id 'pl.allegro.tech.build.axion-release' version '1.10.2'
9+
id 'io.codearte.nexus-staging' version '0.21.0'
1010
}
1111

1212
scmVersion {
@@ -26,25 +26,27 @@ repositories {
2626
mavenCentral()
2727
}
2828

29-
ext.springBootVersion = '2.0.3.RELEASE'
29+
ext.springBootVersion = '2.1.8.RELEASE'
3030

3131
dependencies {
3232

3333
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootVersion
3434
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-couchbase', version: springBootVersion
35-
compile group: 'org.springframework.session', name: 'spring-session-core', version: '2.0.4.RELEASE'
36-
compile group: 'org.springframework.retry', name: 'spring-retry', version: '1.2.2.RELEASE'
37-
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7'
38-
compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.1'
35+
compile group: 'org.springframework.session', name: 'spring-session-core', version: '2.1.8.RELEASE'
36+
compile group: 'org.springframework.retry', name: 'spring-retry', version: '1.2.4.RELEASE'
37+
compile group: 'io.micrometer', name: 'micrometer-core', version: '1.1.5'
38+
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
39+
compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'
3940

4041
compileOnly group: 'org.springframework.boot', name: 'spring-boot-configuration-processor', version: springBootVersion
4142

4243
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springBootVersion
43-
testCompile group: 'org.spockframework', name: 'spock-spring', version: '1.1-groovy-2.4'
44+
testCompile group: 'org.spockframework', name: 'spock-spring', version: '1.3-groovy-2.5'
45+
testCompile group: 'org.testcontainers', name: 'couchbase', version: '1.12.4'
4446
}
4547

46-
task wrapper(type: Wrapper) {
47-
gradleVersion = '4.8'
48+
wrapper {
49+
gradleVersion = '6.0.1'
4850
}
4951

5052
task javadocJar(type: Jar) {
@@ -120,7 +122,7 @@ publishing {
120122
}
121123

122124
jacoco {
123-
toolVersion = '0.8.1'
125+
toolVersion = '0.8.5'
124126
}
125127

126128
jacocoTestReport {

gradle/wrapper/gradle-wrapper.jar

4.27 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 31 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 100 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)