Compare commits
1 Commits
2.7.1
...
remove-fla
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ef121e0fd |
@@ -1,6 +0,0 @@
|
||||
# Use sdkman to run "sdk env" to initialize with correct JDK version
|
||||
# Enable auto-env through the sdkman_auto_env config
|
||||
# See https://sdkman.io/usage#config
|
||||
# A summary is to add the following to ~/.sdkman/etc/config
|
||||
# sdkman_auto_env=true
|
||||
java=8.0.332-zulu
|
||||
@@ -25,13 +25,6 @@ If you are reporting a bug, please help to speed up problem diagnosis by providi
|
||||
information as possible. Ideally, that would include a small sample project that
|
||||
reproduces the problem.
|
||||
|
||||
== Create your branch from the oldest maintenance branch
|
||||
|
||||
Create your topic branch to be submitted as a pull request from the oldest impacted and supported maintenance branch.
|
||||
You can find the supported versions by looking at the https://github.com/spring-projects/spring-session/milestones[milestones page].
|
||||
Switch to a branch named `<major>.<minor>.x` from the smallest milestone in the format of `<major>.<minor>.<patch>(-<prerelease>)`.
|
||||
The spring team will ensure the code gets merged forward into additional branches.
|
||||
|
||||
|
||||
== Sign the Contributor License Agreement
|
||||
If you have not previously done so, please fill out and
|
||||
|
||||
@@ -25,7 +25,7 @@ Additional Spring Session modules can be found in the https://github.com/spring-
|
||||
|
||||
== Getting Started
|
||||
|
||||
We recommend you visit the https://docs.spring.io/spring-session/reference/index.html[Spring Session Reference] and look through the "Samples and Guides" section to see which one best suits your needs.
|
||||
We recommend you visit the https://docs.spring.io/spring-session/docs/current/reference/html5/#samples[Spring Session Reference] and look through the "Samples and Guides" section to see which one best suits your needs.
|
||||
|
||||
== Samples
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ buildscript {
|
||||
snapshotBuild = version.endsWith('SNAPSHOT')
|
||||
milestoneBuild = !(releaseBuild || snapshotBuild)
|
||||
|
||||
springBootVersion = '2.7.8'
|
||||
springBootVersion = '2.7.0-M3'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -66,7 +66,7 @@ dependencies {
|
||||
implementation 'io.spring.nohttp:nohttp-gradle:0.0.9'
|
||||
implementation 'net.sourceforge.htmlunit:htmlunit:2.55.0'
|
||||
implementation 'org.hidetake:gradle-ssh-plugin:2.10.1'
|
||||
implementation 'org.jfrog.buildinfo:build-info-extractor-gradle:4.29.0'
|
||||
implementation 'org.jfrog.buildinfo:build-info-extractor-gradle:4.24.20'
|
||||
implementation 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1'
|
||||
|
||||
testImplementation platform('org.junit:junit-bom:5.8.1')
|
||||
|
||||
@@ -18,7 +18,6 @@ package io.spring.gradle.convention
|
||||
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
|
||||
|
||||
class ArtifactoryPlugin implements Plugin<Project> {
|
||||
|
||||
@@ -38,14 +37,8 @@ class ArtifactoryPlugin implements Plugin<Project> {
|
||||
password = artifactoryPassword
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
project.plugins.withType(MavenPublishPlugin) {
|
||||
project.artifactory {
|
||||
publish {
|
||||
defaults {
|
||||
publications('mavenJava')
|
||||
}
|
||||
defaults {
|
||||
publications('mavenJava')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ class RootProjectPlugin implements Plugin<Project> {
|
||||
pluginManager.apply(SchemaPlugin)
|
||||
pluginManager.apply(NoHttpPlugin)
|
||||
pluginManager.apply(SpringNexusPublishPlugin)
|
||||
pluginManager.apply(ArtifactoryPlugin)
|
||||
pluginManager.apply("org.sonarqube")
|
||||
|
||||
project.repositories.mavenCentral()
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
#!/usr/bin/ruby
|
||||
require 'json'
|
||||
require 'net/http'
|
||||
require 'yaml'
|
||||
require 'logger'
|
||||
|
||||
$log = Logger.new(STDOUT)
|
||||
$log.level = Logger::WARN
|
||||
|
||||
class ForwardMerge
|
||||
attr_reader :issue, :milestone, :message, :line
|
||||
def initialize(issue, milestone, message, line)
|
||||
@issue = issue
|
||||
@milestone = milestone
|
||||
@message = message
|
||||
@line = line
|
||||
end
|
||||
end
|
||||
|
||||
def find_forward_merges(message_file)
|
||||
$log.debug "Searching for forward merge"
|
||||
rev=`git rev-parse -q --verify MERGE_HEAD`.strip
|
||||
$log.debug "Found #{rev} from git rev-parse"
|
||||
return nil unless rev
|
||||
message = File.read(message_file)
|
||||
forward_merges = []
|
||||
message.each_line do |line|
|
||||
$log.debug "Checking #{line} for message"
|
||||
match = /^(?:Fixes|Closes) gh-(\d+) in (\d\.\d\.[\dx](?:[\.\-](?:M|RC)\d)?)$/.match(line)
|
||||
if match then
|
||||
issue = match[1]
|
||||
milestone = match[2]
|
||||
$log.debug "Matched reference to issue #{issue} in milestone #{milestone}"
|
||||
forward_merges << ForwardMerge.new(issue, milestone, message, line)
|
||||
end
|
||||
end
|
||||
$log.debug "No match in merge message" unless forward_merges
|
||||
return forward_merges
|
||||
end
|
||||
|
||||
def get_issue(username, password, repository, number)
|
||||
$log.debug "Getting issue #{number} from GitHub repository #{repository}"
|
||||
uri = URI("https://api.github.com/repos/#{repository}/issues/#{number}")
|
||||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
http.use_ssl=true
|
||||
request = Net::HTTP::Get.new(uri.path)
|
||||
request.basic_auth(username, password)
|
||||
response = http.request(request)
|
||||
$log.debug "Get HTTP response #{response.code}"
|
||||
return JSON.parse(response.body) unless response.code != '200'
|
||||
puts "Failed to retrieve issue #{number}: #{response.message}"
|
||||
exit 1
|
||||
end
|
||||
|
||||
def find_milestone(username, password, repository, title)
|
||||
$log.debug "Finding milestone #{title} from GitHub repository #{repository}"
|
||||
uri = URI("https://api.github.com/repos/#{repository}/milestones")
|
||||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
http.use_ssl=true
|
||||
request = Net::HTTP::Get.new(uri.path)
|
||||
request.basic_auth(username, password)
|
||||
response = http.request(request)
|
||||
milestones = JSON.parse(response.body)
|
||||
if title.end_with?(".x")
|
||||
prefix = title.delete_suffix('.x')
|
||||
$log.debug "Finding nearest milestone from candidates starting with #{prefix}"
|
||||
titles = milestones.map { |milestone| milestone['title'] }
|
||||
titles = titles.select{ |title| title.start_with?(prefix) unless title.end_with?('.x')}
|
||||
titles = titles.sort_by { |v| Gem::Version.new(v) }
|
||||
$log.debug "Considering candidates #{titles}"
|
||||
if(titles.empty?)
|
||||
puts "Cannot find nearest milestone for prefix #{title}"
|
||||
exit 1
|
||||
end
|
||||
title = titles.first
|
||||
$log.debug "Found nearest milestone #{title}"
|
||||
end
|
||||
milestones.each do |milestone|
|
||||
$log.debug "Considering #{milestone['title']}"
|
||||
return milestone['number'] if milestone['title'] == title
|
||||
end
|
||||
puts "Milestone #{title} not found in #{repository}"
|
||||
exit 1
|
||||
end
|
||||
|
||||
def create_issue(username, password, repository, original, title, labels, milestone, milestone_name, dry_run)
|
||||
$log.debug "Finding forward-merge issue in GitHub repository #{repository} for '#{title}'"
|
||||
uri = URI("https://api.github.com/repos/#{repository}/issues")
|
||||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
http.use_ssl=true
|
||||
request = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')
|
||||
request.basic_auth(username, password)
|
||||
request.body = {
|
||||
title: title,
|
||||
labels: labels,
|
||||
milestone: milestone.to_i,
|
||||
body: "Forward port of issue ##{original} to #{milestone_name}."
|
||||
}.to_json
|
||||
if dry_run then
|
||||
puts "Dry run"
|
||||
puts "POSTing to #{uri} with body #{request.body}"
|
||||
return "dry-run"
|
||||
end
|
||||
response = JSON.parse(http.request(request).body)
|
||||
$log.debug "Created new issue #{response['number']}"
|
||||
return response['number']
|
||||
end
|
||||
|
||||
$log.debug "Running forward-merge hook script"
|
||||
message_file=ARGV[0]
|
||||
|
||||
forward_merges = find_forward_merges(message_file)
|
||||
exit 0 unless forward_merges
|
||||
|
||||
$log.debug "Loading config from ~/.spring-boot/forward_merge.yml"
|
||||
config = YAML.load_file(File.join(Dir.home, '.spring-boot', 'forward-merge.yml'))
|
||||
username = config['github']['credentials']['username']
|
||||
password = config['github']['credentials']['password']
|
||||
dry_run = config['dry_run']
|
||||
repository = 'spring-projects/spring-session'
|
||||
|
||||
forward_merges.each do |forward_merge|
|
||||
existing_issue = get_issue(username, password, repository, forward_merge.issue)
|
||||
title = existing_issue['title']
|
||||
labels = existing_issue['labels'].map { |label| label['name'] }
|
||||
labels << "status: forward-port"
|
||||
$log.debug "Processing issue '#{title}'"
|
||||
|
||||
milestone = find_milestone(username, password, repository, forward_merge.milestone)
|
||||
new_issue_number = create_issue(username, password, repository, forward_merge.issue, title, labels, milestone, forward_merge.milestone, dry_run)
|
||||
|
||||
puts "Created gh-#{new_issue_number} for forward port of gh-#{forward_merge.issue} into #{forward_merge.milestone}"
|
||||
rewritten_message = forward_merge.message.sub(forward_merge.line, "Closes gh-#{new_issue_number}\n")
|
||||
File.write(message_file, rewritten_message)
|
||||
end
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/usr/bin/ruby
|
||||
require 'json'
|
||||
require 'net/http'
|
||||
require 'yaml'
|
||||
require 'logger'
|
||||
|
||||
$main_branch = "3.0.x"
|
||||
|
||||
$log = Logger.new(STDOUT)
|
||||
$log.level = Logger::WARN
|
||||
|
||||
def get_fixed_issues()
|
||||
$log.debug "Searching for for forward merge"
|
||||
rev=`git rev-parse -q --verify MERGE_HEAD`.strip
|
||||
$log.debug "Found #{rev} from git rev-parse"
|
||||
return nil unless rev
|
||||
fixed = []
|
||||
message = `git log -1 --pretty=%B #{rev}`
|
||||
message.each_line do |line|
|
||||
$log.debug "Checking #{line} for message"
|
||||
fixed << line.strip if /^(?:Fixes|Closes) gh-(\d+)/.match(line)
|
||||
end
|
||||
$log.debug "Found fixed issues #{fixed}"
|
||||
return fixed;
|
||||
end
|
||||
|
||||
def rewrite_message(message_file, fixed)
|
||||
current_branch = `git rev-parse --abbrev-ref HEAD`.strip
|
||||
if current_branch == "main"
|
||||
current_branch = $main_branch
|
||||
end
|
||||
rewritten_message = ""
|
||||
message = File.read(message_file)
|
||||
message.each_line do |line|
|
||||
match = /^Merge.*branch\ '(.*)'(?:\ into\ (.*))?$/.match(line)
|
||||
if match
|
||||
from_branch = match[1]
|
||||
if from_branch.include? "/"
|
||||
from_branch = from_branch.partition("/").last
|
||||
end
|
||||
to_brach = match[2]
|
||||
$log.debug "Rewriting merge message"
|
||||
line = "Merge branch '#{from_branch}'" + (to_brach ? " into #{to_brach}\n" : "\n")
|
||||
end
|
||||
if fixed and line.start_with?("#")
|
||||
$log.debug "Adding fixed"
|
||||
rewritten_message << "\n"
|
||||
fixed.each do |fixes|
|
||||
rewritten_message << "#{fixes} in #{current_branch}\n"
|
||||
end
|
||||
fixed = nil
|
||||
end
|
||||
rewritten_message << line
|
||||
end
|
||||
return rewritten_message
|
||||
end
|
||||
|
||||
$log.debug "Running prepare-forward-merge hook script"
|
||||
|
||||
message_file=ARGV[0]
|
||||
message_type=ARGV[1]
|
||||
|
||||
if message_type != "merge"
|
||||
$log.debug "Not a merge commit"
|
||||
exit 0;
|
||||
end
|
||||
|
||||
$log.debug "Searching for for forward merge"
|
||||
fixed = get_fixed_issues()
|
||||
rewritten_message = rewrite_message(message_file, fixed)
|
||||
File.write(message_file, rewritten_message)
|
||||
@@ -1,3 +1,3 @@
|
||||
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
org.gradle.parallel=true
|
||||
version=2.7.1
|
||||
version=2.7.0-SNAPSHOT
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom 'io.projectreactor:reactor-bom:2020.0.30'
|
||||
mavenBom 'com.fasterxml.jackson:jackson-bom:2.13.5'
|
||||
mavenBom 'io.projectreactor:reactor-bom:2020.0.18'
|
||||
mavenBom 'com.fasterxml.jackson:jackson-bom:2.13.2.20220328'
|
||||
mavenBom 'org.junit:junit-bom:5.8.2'
|
||||
mavenBom 'org.springframework:spring-framework-bom:5.3.26'
|
||||
mavenBom 'org.springframework.data:spring-data-bom:2021.2.9'
|
||||
mavenBom 'org.springframework.security:spring-security-bom:5.7.7'
|
||||
mavenBom 'org.testcontainers:testcontainers-bom:1.17.6'
|
||||
mavenBom 'org.springframework:spring-framework-bom:5.3.19'
|
||||
mavenBom 'org.springframework.data:spring-data-bom:2021.2.0-RC1'
|
||||
mavenBom 'org.springframework.security:spring-security-bom:5.7.0-RC1'
|
||||
mavenBom 'org.testcontainers:testcontainers-bom:1.17.1'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -19,31 +19,31 @@ dependencyManagement {
|
||||
dependency 'ch.qos.logback:logback-core:1.2.11'
|
||||
dependency 'com.google.code.findbugs:jsr305:3.0.2'
|
||||
dependency 'com.h2database:h2:1.4.200'
|
||||
dependency 'com.ibm.db2:jcc:11.5.8.0'
|
||||
dependency 'com.ibm.db2:jcc:11.5.7.0'
|
||||
dependency 'com.microsoft.sqlserver:mssql-jdbc:9.4.1.jre8'
|
||||
dependency 'com.oracle.database.jdbc:ojdbc8:21.5.0.0'
|
||||
dependency 'com.zaxxer:HikariCP:4.0.3'
|
||||
dependency 'com.zaxxer:HikariCP:3.4.5'
|
||||
dependency 'edu.umd.cs.mtc:multithreadedtc:1.01'
|
||||
dependency 'io.lettuce:lettuce-core:6.1.10.RELEASE'
|
||||
dependency 'io.lettuce:lettuce-core:6.1.8.RELEASE'
|
||||
dependency 'jakarta.annotation:jakarta.annotation-api:1.3.5'
|
||||
dependency 'jakarta.servlet:jakarta.servlet-api:4.0.4'
|
||||
dependency 'mysql:mysql-connector-java:8.0.32'
|
||||
dependency 'mysql:mysql-connector-java:8.0.28'
|
||||
dependency 'org.apache.derby:derby:10.14.2.0'
|
||||
dependency 'org.assertj:assertj-core:3.22.0'
|
||||
dependency 'org.hamcrest:hamcrest:2.2'
|
||||
dependency 'org.hsqldb:hsqldb:2.5.2'
|
||||
dependency 'org.mariadb.jdbc:mariadb-java-client:2.7.8'
|
||||
dependencySet(group: 'org.mockito', version: '4.5.1') {
|
||||
dependency 'org.mariadb.jdbc:mariadb-java-client:2.7.5'
|
||||
dependencySet(group: 'org.mockito', version: '4.4.0') {
|
||||
entry 'mockito-core'
|
||||
entry 'mockito-junit-jupiter'
|
||||
}
|
||||
|
||||
dependencySet(group: 'org.mongodb', version: '4.6.1') {
|
||||
dependencySet(group: 'org.mongodb', version: '4.5.1') {
|
||||
entry 'mongodb-driver-core'
|
||||
entry 'mongodb-driver-sync'
|
||||
entry 'mongodb-driver-reactivestreams'
|
||||
}
|
||||
dependency 'org.postgresql:postgresql:42.3.8'
|
||||
dependency 'org.postgresql:postgresql:42.3.4'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -399,8 +399,8 @@ public abstract class AbstractMongoRepositoryITest extends AbstractITest {
|
||||
@Bean
|
||||
public MongoOperations mongoOperations(MongoDBContainer mongoContainer) {
|
||||
|
||||
MongoClient mongo = MongoClients
|
||||
.create("mongodb://" + mongoContainer.getHost() + ":" + mongoContainer.getFirstMappedPort());
|
||||
MongoClient mongo = MongoClients.create(
|
||||
"mongodb://" + mongoContainer.getContainerIpAddress() + ":" + mongoContainer.getFirstMappedPort());
|
||||
return new MongoTemplate(mongo, "test");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -185,8 +185,8 @@ public class MongoDbDeleteJacksonSessionVerificationTest {
|
||||
@Bean
|
||||
ReactiveMongoOperations mongoOperations(MongoDBContainer mongoContainer) {
|
||||
|
||||
MongoClient mongo = MongoClients
|
||||
.create("mongodb://" + mongoContainer.getHost() + ":" + mongoContainer.getFirstMappedPort());
|
||||
MongoClient mongo = MongoClients.create(
|
||||
"mongodb://" + mongoContainer.getContainerIpAddress() + ":" + mongoContainer.getFirstMappedPort());
|
||||
return new ReactiveMongoTemplate(mongo, "DB_Name_DeleteJacksonSessionVerificationTest");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -180,8 +180,8 @@ public class MongoDbLogoutVerificationTest {
|
||||
@Bean
|
||||
ReactiveMongoOperations mongoOperations(MongoDBContainer mongoContainer) {
|
||||
|
||||
MongoClient mongo = MongoClients
|
||||
.create("mongodb://" + mongoContainer.getHost() + ":" + mongoContainer.getFirstMappedPort());
|
||||
MongoClient mongo = MongoClients.create(
|
||||
"mongodb://" + mongoContainer.getContainerIpAddress() + ":" + mongoContainer.getFirstMappedPort());
|
||||
return new ReactiveMongoTemplate(mongo, "test");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,8 +42,8 @@ public abstract class AbstractRedisITests {
|
||||
|
||||
@Bean
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration(redisContainer().getHost(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration(
|
||||
redisContainer().getContainerIpAddress(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(configuration);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
name: ROOT
|
||||
version: '2.7.1'
|
||||
version: '2.7.0'
|
||||
prerelease: '-SNAPSHOT'
|
||||
|
||||
@@ -100,7 +100,7 @@ Spring Session provides `PrincipalNameExtractor` for this purpose.
|
||||
is not set, Hazelcast will serialize sessions using native Java serialization.
|
||||
<4> We create a `HazelcastInstance` that connects Spring Session to Hazelcast.
|
||||
By default, the application starts and connects to an embedded instance of Hazelcast.
|
||||
For more information on configuring Hazelcast, see the https://docs.hazelcast.com/hazelcast/latest/[reference documentation].
|
||||
For more information on configuring Hazelcast, see the https://docs.hazelcast.org/docs/{hazelcast-version}/manual/html-single/index.html#hazelcast-configuration[reference documentation].
|
||||
====
|
||||
|
||||
NOTE: If `HazelcastSessionSerializer` is preferred, it needs to be configured for all Hazelcast cluster members before they start.
|
||||
@@ -161,7 +161,7 @@ $ ./gradlew :spring-session-sample-javaconfig-hazelcast:tomcatRun
|
||||
====
|
||||
|
||||
NOTE: By default, Hazelcast runs in embedded mode with your application.
|
||||
However, if you want to connect to a standalone instance instead, you can configure it by following the instructions in the https://docs.hazelcast.com/hazelcast/latest/getting-started/get-started-cli[reference documentation].
|
||||
However, if you want to connect to a standalone instance instead, you can configure it by following the instructions in the https://docs.hazelcast.org/docs/{hazelcast-version}/manual/html-single/index.html#hazelcast-configuration[reference documentation].
|
||||
|
||||
You should now be able to access the application at http://localhost:8080/
|
||||
|
||||
@@ -188,9 +188,9 @@ You can view the cookies (with https://developers.google.com/web/tools/chrome-de
|
||||
|
||||
=== Interacting with the Data Store
|
||||
|
||||
You can remove the session by using https://docs.hazelcast.com/hazelcast/latest/clients/java[a Java client],
|
||||
https://hazelcast.com/clients/[one of the other clients], or the
|
||||
https://docs.hazelcast.com/management-center/latest/getting-started/overview[management center].
|
||||
You can remove the session by using https://docs.hazelcast.org/docs/{hazelcast-version}/manual/html-single/index.html#hazelcast-java-client[a Java client],
|
||||
https://docs.hazelcast.org/docs/{hazelcast-version}/manual/html-single/index.html#other-client-implementations[one of the other clients], or the
|
||||
https://docs.hazelcast.org/docs/{hazelcast-version}/manual/html-single/index.html#management-center[management center].
|
||||
|
||||
==== Using the Console
|
||||
|
||||
@@ -203,7 +203,7 @@ For example, to remove the session by using the management center console after
|
||||
----
|
||||
====
|
||||
|
||||
TIP: The Hazelcast documentation has instructions for https://docs.hazelcast.com/hazelcast/latest/clients/clc[the console].
|
||||
TIP: The Hazelcast documentation has instructions for https://docs.hazelcast.org/docs/{hazelcast-version}/manual/html-single/index.html#executing-console-commands[the console].
|
||||
|
||||
Alternatively, you can also delete the explicit key. Enter the following into the console, being sure to replace `7e8383a4-082c-4ffe-a4bc-c40fd3363c5e` with the value of your `SESSION` cookie:
|
||||
|
||||
@@ -218,7 +218,7 @@ Now visit the application at http://localhost:8080/ and observe that we are no l
|
||||
==== Using the REST API
|
||||
|
||||
As described in the section of the documentation that cover other clients, there is a
|
||||
https://docs.hazelcast.com/hazelcast/latest/clients/rest[REST API]
|
||||
https://docs.hazelcast.org/docs/{hazelcast-version}/manual/html-single/index.html#rest-client[REST API]
|
||||
provided by the Hazelcast node(s).
|
||||
|
||||
For example, you could delete an individual key as follows (being sure to replace `7e8383a4-082c-4ffe-a4bc-c40fd3363c5e` with the value of your SESSION cookie):
|
||||
|
||||
@@ -66,7 +66,8 @@ class ClientServerHazelcast4IndexedSessionRepositoryITests extends AbstractHazel
|
||||
@Bean
|
||||
HazelcastInstance hazelcastInstance() {
|
||||
ClientConfig clientConfig = new ClientConfig();
|
||||
clientConfig.getNetworkConfig().addAddress(container.getHost() + ":" + container.getFirstMappedPort());
|
||||
clientConfig.getNetworkConfig()
|
||||
.addAddress(container.getContainerIpAddress() + ":" + container.getFirstMappedPort());
|
||||
clientConfig.getUserCodeDeploymentConfig().setEnabled(true).addClass(Session.class)
|
||||
.addClass(MapSession.class).addClass(Hazelcast4SessionUpdateEntryProcessor.class);
|
||||
return HazelcastClient.newHazelcastClient(clientConfig);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -67,7 +67,8 @@ class ClientServerHazelcastIndexedSessionRepositoryITests extends AbstractHazelc
|
||||
@Bean
|
||||
HazelcastInstance hazelcastInstance() {
|
||||
ClientConfig clientConfig = new ClientConfig();
|
||||
clientConfig.getNetworkConfig().addAddress(container.getHost() + ":" + container.getFirstMappedPort());
|
||||
clientConfig.getNetworkConfig()
|
||||
.addAddress(container.getContainerIpAddress() + ":" + container.getFirstMappedPort());
|
||||
clientConfig.getUserCodeDeploymentConfig().setEnabled(true).addClass(Session.class)
|
||||
.addClass(MapSession.class).addClass(SessionUpdateEntryProcessor.class);
|
||||
return HazelcastClient.newHazelcastClient(clientConfig);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.session.jdbc;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import org.testcontainers.containers.Db2Container;
|
||||
import org.testcontainers.containers.JdbcDatabaseContainer;
|
||||
import org.testcontainers.containers.MSSQLServerContainer;
|
||||
@@ -23,6 +25,7 @@ import org.testcontainers.containers.MariaDBContainer;
|
||||
import org.testcontainers.containers.MySQLContainer;
|
||||
import org.testcontainers.containers.OracleContainer;
|
||||
import org.testcontainers.containers.PostgreSQLContainer;
|
||||
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
|
||||
|
||||
/**
|
||||
* Factories for various {@link JdbcDatabaseContainer}s.
|
||||
@@ -47,7 +50,21 @@ final class DatabaseContainers {
|
||||
}
|
||||
|
||||
static OracleContainer oracle() {
|
||||
return new OracleContainer("gvenzl/oracle-xe:18.4.0-slim");
|
||||
return new OracleContainer() {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
this.waitStrategy = new LogMessageWaitStrategy().withRegEx(".*DATABASE IS READY TO USE!.*\\s")
|
||||
.withStartupTimeout(Duration.ofMinutes(10));
|
||||
addEnv("ORACLE_PWD", getPassword());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void waitUntilContainerStarted() {
|
||||
getWaitStrategy().waitUntilReady(this);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
static PostgreSQLContainer<?> postgreSql() {
|
||||
|
||||
@@ -9,7 +9,7 @@ dependencyManagement {
|
||||
dependency 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.2'
|
||||
dependency 'javax.servlet.jsp:javax.servlet.jsp-api:2.3.3'
|
||||
dependency 'org.apache.taglibs:taglibs-standard-jstlel:1.2.5'
|
||||
dependency 'org.seleniumhq.selenium:htmlunit-driver:3.61.0'
|
||||
dependency 'org.seleniumhq.selenium:htmlunit-driver:3.60.0'
|
||||
dependency 'org.slf4j:jcl-over-slf4j:1.7.36'
|
||||
dependency 'org.slf4j:log4j-over-slf4j:1.7.36'
|
||||
dependency 'org.webjars:bootstrap:2.3.2'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -115,7 +115,8 @@ class FindByUsernameTests {
|
||||
|
||||
@Bean
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ dependencies {
|
||||
implementation "org.springframework.boot:spring-boot-starter-webflux"
|
||||
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
|
||||
implementation "org.springframework.boot:spring-boot-starter-data-mongodb-reactive"
|
||||
implementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo"
|
||||
implementation "org.testcontainers:mongodb"
|
||||
|
||||
testImplementation "org.springframework.boot:spring-boot-starter-test"
|
||||
testImplementation "org.seleniumhq.selenium:htmlunit-driver"
|
||||
|
||||
@@ -18,7 +18,16 @@ package org.springframework.session.mongodb.examples;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ApplicationContextInitializer;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.MapPropertySource;
|
||||
import org.springframework.session.data.mongo.config.annotation.web.reactive.EnableMongoWebSession;
|
||||
import org.testcontainers.containers.MongoDBContainer;
|
||||
import org.testcontainers.utility.DockerImageName;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Pure Spring-based application (using Spring Boot for dependency management), hence no
|
||||
@@ -31,8 +40,35 @@ import org.springframework.session.data.mongo.config.annotation.web.reactive.Ena
|
||||
@EnableMongoWebSession
|
||||
public class SpringSessionMongoReactiveApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SpringSessionMongoReactiveApplication.class);
|
||||
/**
|
||||
* Use Testcontainers to managed MongoDB through Docker.
|
||||
* <p>
|
||||
* @see https://bsideup.github.io/posts/local_development_with_testcontainers/
|
||||
*/
|
||||
static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
|
||||
|
||||
static MongoDBContainer mongo = new MongoDBContainer(DockerImageName.parse("mongo:5.0"));
|
||||
|
||||
public static Map<String, String> getProperties() {
|
||||
mongo.start();
|
||||
|
||||
HashMap<String, String> properties = new HashMap<>();
|
||||
properties.put("spring.data.mongodb.host", mongo.getHost());
|
||||
properties.put("spring.data.mongodb.port", mongo.getFirstMappedPort() + "");
|
||||
return properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(ConfigurableApplicationContext context) {
|
||||
ConfigurableEnvironment env = context.getEnvironment();
|
||||
env.getPropertySources().addFirst(new MapPropertySource("testcontainers", (Map) getProperties()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication application = new SpringApplication(SpringSessionMongoReactiveApplication.class);
|
||||
application.addInitializers(new Initializer());
|
||||
application.run(args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
logging.level.org.springframework.data.mongodb=DEBUG
|
||||
logging.level.org.springframework.session=DEBUG
|
||||
@@ -1,8 +0,0 @@
|
||||
logging:
|
||||
level:
|
||||
org.springframework.data.mongodb: DEBUG
|
||||
org.springframework.session: DEBUG
|
||||
spring:
|
||||
mongodb:
|
||||
embedded:
|
||||
version: 3.4.3
|
||||
@@ -16,21 +16,21 @@
|
||||
|
||||
package org.springframework.session.mongodb.examples;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.web.server.LocalServerPort;
|
||||
import org.springframework.session.mongodb.examples.pages.HomePage;
|
||||
import org.springframework.session.mongodb.examples.pages.HomePage.Attribute;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
@@ -39,6 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@ContextConfiguration(initializers = SpringSessionMongoReactiveApplication.Initializer.class)
|
||||
public class AttributeTests {
|
||||
|
||||
@LocalServerPort
|
||||
|
||||
@@ -8,7 +8,8 @@ dependencies {
|
||||
implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5"
|
||||
implementation "org.springframework.boot:spring-boot-starter-data-mongodb"
|
||||
implementation "org.springframework.boot:spring-boot-starter-security"
|
||||
implementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo"
|
||||
implementation "org.testcontainers:mongodb"
|
||||
|
||||
|
||||
testImplementation "org.springframework.boot:spring-boot-starter-test"
|
||||
testImplementation "org.seleniumhq.selenium:htmlunit-driver"
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.session.mongodb.examples;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.context.EnvironmentAware;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
class EmbeddedMongoPortLogger implements ApplicationRunner, EnvironmentAware {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(EmbeddedMongoPortLogger.class);
|
||||
|
||||
private Environment environment;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
String port = this.environment.getProperty("local.mongo.port");
|
||||
logger.info("Embedded Mongo started on port " + port + ", use 'mongo --port " + port + "' command to connect");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnvironment(Environment environment) {
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,15 @@ package org.springframework.session.mongodb.examples;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ApplicationContextInitializer;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.MapPropertySource;
|
||||
import org.testcontainers.containers.MongoDBContainer;
|
||||
import org.testcontainers.utility.DockerImageName;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Rob Winch
|
||||
@@ -25,8 +34,34 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@SpringBootApplication
|
||||
public class SpringSessionMongoTraditionalBoot {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SpringSessionMongoTraditionalBoot.class, args);
|
||||
/**
|
||||
* Use Testcontainers to managed MongoDB through Docker.
|
||||
* <p>
|
||||
* @see https://bsideup.github.io/posts/local_development_with_testcontainers/
|
||||
*/
|
||||
static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
|
||||
|
||||
static MongoDBContainer mongo = new MongoDBContainer(DockerImageName.parse("mongo:5.0"));
|
||||
|
||||
public static Map<String, String> getProperties() {
|
||||
mongo.start();
|
||||
|
||||
HashMap<String, String> properties = new HashMap<>();
|
||||
properties.put("spring.data.mongodb.host", mongo.getHost());
|
||||
properties.put("spring.data.mongodb.port", mongo.getFirstMappedPort() + "");
|
||||
return properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(ConfigurableApplicationContext context) {
|
||||
ConfigurableEnvironment env = context.getEnvironment();
|
||||
env.getPropertySources().addFirst(new MapPropertySource("testcontainers", (Map) getProperties()));
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication application = new SpringApplication(SpringSessionMongoTraditionalBoot.class);
|
||||
application.addInitializers(new Initializer());
|
||||
application.run(args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
spring.thymeleaf.cache=false
|
||||
spring.template.cache=false
|
||||
spring.data.mongodb.port=0
|
||||
spring.mongodb.embedded.version=3.4.3
|
||||
|
||||
logging.level.org.springframework.data.mongodb=DEBUG
|
||||
logging.level.org.springframework.session=DEBUG
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||
import org.springframework.session.mongodb.examples.pages.HomePage;
|
||||
import org.springframework.session.mongodb.examples.pages.LoginPage;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder;
|
||||
@@ -45,6 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@AutoConfigureMockMvc
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.MOCK)
|
||||
@ContextConfiguration(initializers = SpringSessionMongoTraditionalBoot.Initializer.class)
|
||||
public class BootTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -115,7 +115,8 @@ class HttpRedisJsonTest {
|
||||
|
||||
@Bean
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -64,7 +64,8 @@ class RedisSerializerTest {
|
||||
|
||||
@Bean
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -93,7 +93,8 @@ class BootTests {
|
||||
|
||||
@Bean
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -97,7 +97,8 @@ class BootTests {
|
||||
|
||||
@Bean
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -103,7 +103,8 @@ class AttributeTests {
|
||||
|
||||
@Bean
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -105,7 +105,8 @@ class AttributeTests {
|
||||
|
||||
@Bean
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -86,7 +86,8 @@ class ApplicationTests {
|
||||
|
||||
@Bean
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,7 +40,8 @@ public class EmbeddedRedisConfig {
|
||||
@Bean
|
||||
@Primary
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,7 +40,8 @@ public class EmbeddedRedisConfig {
|
||||
@Bean
|
||||
@Primary
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -99,7 +99,8 @@ class RestMockMvcTests {
|
||||
|
||||
@Bean
|
||||
LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,7 +40,8 @@ public class EmbeddedRedisConfig {
|
||||
@Bean
|
||||
@Primary
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,7 +40,8 @@ public class EmbeddedRedisConfig {
|
||||
@Bean
|
||||
@Primary
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,7 +40,8 @@ public class EmbeddedRedisConfig {
|
||||
@Bean
|
||||
@Primary
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory(redisContainer().getHost(), redisContainer().getFirstMappedPort());
|
||||
return new LettuceConnectionFactory(redisContainer().getContainerIpAddress(),
|
||||
redisContainer().getFirstMappedPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user