Fix failing tests
Issue gh-2107
This commit is contained in:
@@ -6,7 +6,7 @@ dependencyManagement {
|
||||
mavenBom 'org.springframework:spring-framework-bom:6.0.0-SNAPSHOT'
|
||||
mavenBom 'org.springframework.data:spring-data-bom:2022.0.0-M4'
|
||||
mavenBom 'org.springframework.security:spring-security-bom:6.0.0-SNAPSHOT'
|
||||
mavenBom 'org.testcontainers:testcontainers-bom:1.16.2'
|
||||
mavenBom 'org.testcontainers:testcontainers-bom:1.17.3'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -206,6 +207,7 @@ class RedisHttpSessionConfigurationTests {
|
||||
void multipleConnectionFactoryRedisConfig() {
|
||||
assertThatExceptionOfType(BeanCreationException.class)
|
||||
.isThrownBy(() -> registerAndRefresh(RedisConfig.class, MultipleConnectionFactoryRedisConfig.class))
|
||||
.withCauseInstanceOf(NoUniqueBeanDefinitionException.class).havingCause()
|
||||
.withMessageContaining("expected single matching bean but found 2");
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -219,6 +220,7 @@ class RedisIndexedHttpSessionConfigurationTests {
|
||||
void multipleConnectionFactoryRedisConfig() {
|
||||
assertThatExceptionOfType(BeanCreationException.class)
|
||||
.isThrownBy(() -> registerAndRefresh(RedisConfig.class, MultipleConnectionFactoryRedisConfig.class))
|
||||
.withRootCauseInstanceOf(NoUniqueBeanDefinitionException.class).havingRootCause()
|
||||
.withMessageContaining("expected single matching bean but found 2");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2022 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.
|
||||
@@ -21,6 +21,7 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -188,6 +189,7 @@ class RedisWebSessionConfigurationTests {
|
||||
void multipleConnectionFactoryRedisConfig() {
|
||||
assertThatExceptionOfType(BeanCreationException.class)
|
||||
.isThrownBy(() -> registerAndRefresh(RedisConfig.class, MultipleConnectionFactoryRedisConfig.class))
|
||||
.withCauseInstanceOf(NoUniqueBeanDefinitionException.class).havingCause()
|
||||
.withMessageContaining("expected single matching bean but found 2");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
* Copyright 2014-2022 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.
|
||||
@@ -22,6 +22,8 @@ import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -68,6 +70,7 @@ class HazelcastHttpSessionConfigurationTests {
|
||||
void noHazelcastInstanceConfiguration() {
|
||||
assertThatExceptionOfType(BeanCreationException.class)
|
||||
.isThrownBy(() -> registerAndRefresh(NoHazelcastInstanceConfiguration.class))
|
||||
.withCauseInstanceOf(NoSuchBeanDefinitionException.class).havingCause()
|
||||
.withMessageContaining("HazelcastInstance");
|
||||
}
|
||||
|
||||
@@ -222,6 +225,7 @@ class HazelcastHttpSessionConfigurationTests {
|
||||
void multipleHazelcastInstanceConfiguration() {
|
||||
assertThatExceptionOfType(BeanCreationException.class)
|
||||
.isThrownBy(() -> registerAndRefresh(MultipleHazelcastInstanceConfiguration.class))
|
||||
.withCauseInstanceOf(NoUniqueBeanDefinitionException.class).havingCause()
|
||||
.withMessageContaining("expected single matching bean but found 2");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2022 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.
|
||||
@@ -22,6 +22,8 @@ import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -75,6 +77,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
void noDataSourceConfiguration() {
|
||||
assertThatExceptionOfType(BeanCreationException.class)
|
||||
.isThrownBy(() -> registerAndRefresh(NoDataSourceConfiguration.class))
|
||||
.withRootCauseInstanceOf(NoSuchBeanDefinitionException.class).havingRootCause()
|
||||
.withMessageContaining("expected at least 1 bean which qualifies as autowire candidate");
|
||||
}
|
||||
|
||||
@@ -230,6 +233,7 @@ class JdbcHttpSessionConfigurationTests {
|
||||
assertThatExceptionOfType(BeanCreationException.class)
|
||||
.isThrownBy(
|
||||
() -> registerAndRefresh(DataSourceConfiguration.class, MultipleDataSourceConfiguration.class))
|
||||
.withRootCauseInstanceOf(NoUniqueBeanDefinitionException.class).havingRootCause()
|
||||
.withMessageContaining("expected single matching bean but found 2");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2022 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.
|
||||
@@ -34,7 +34,7 @@ class HazelcastSpringTests {
|
||||
|
||||
@BeforeEach
|
||||
void setup() {
|
||||
this.driver = new HtmlUnitDriver();
|
||||
this.driver = new HtmlUnitDriver(true);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
|
||||
Reference in New Issue
Block a user