Skip to content

Commit d74bad0

Browse files
committed
Reformatting the code.. spring-projects#96
1 parent c6b215c commit d74bad0

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

src/main/java/org/springframework/session/data/mongo/config/annotation/web/http/MongoHttpSessionConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public void setMaxInactiveIntervalInSeconds(Integer maxInactiveIntervalInSeconds
9898

9999
public void setImportMetadata(AnnotationMetadata importMetadata) {
100100

101-
AnnotationAttributes attributes = AnnotationAttributes.fromMap(
102-
importMetadata.getAnnotationAttributes(EnableMongoHttpSession.class.getName()));
101+
AnnotationAttributes attributes = AnnotationAttributes
102+
.fromMap(importMetadata.getAnnotationAttributes(EnableMongoHttpSession.class.getName()));
103103

104104
if (attributes != null) {
105105
this.maxInactiveIntervalInSeconds = attributes.getNumber("maxInactiveIntervalInSeconds");

src/test/java/org/springframework/session/data/mongo/config/annotation/web/http/MongoHttpSessionConfigurationTest.java

+16-15
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@
1515
*/
1616
package org.springframework.session.data.mongo.config.annotation.web.http;
1717

18+
import static org.assertj.core.api.Assertions.*;
19+
import static org.mockito.ArgumentMatchers.anyString;
20+
import static org.mockito.BDDMockito.*;
21+
22+
1823
import org.junit.After;
1924
import org.junit.Rule;
2025
import org.junit.Test;
2126
import org.junit.rules.ExpectedException;
2227
import org.springframework.beans.factory.BeanCreationException;
23-
import org.springframework.context.annotation.*;
28+
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
29+
import org.springframework.context.annotation.Bean;
30+
import org.springframework.context.annotation.Configuration;
31+
import org.springframework.context.annotation.Import;
32+
import org.springframework.context.annotation.Primary;
2433
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
2534
import org.springframework.data.mongodb.core.MongoOperations;
2635
import org.springframework.data.mongodb.core.index.IndexOperations;
@@ -29,12 +38,6 @@
2938
import org.springframework.session.data.mongo.MongoOperationsSessionRepository;
3039
import org.springframework.test.util.ReflectionTestUtils;
3140

32-
import static org.assertj.core.api.Assertions.assertThat;
33-
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
34-
import static org.mockito.ArgumentMatchers.anyString;
35-
import static org.mockito.BDDMockito.given;
36-
import static org.mockito.BDDMockito.mock;
37-
3841
/**
3942
* Tests for {@link MongoHttpSessionConfiguration}.
4043
*
@@ -47,8 +50,7 @@ public class MongoHttpSessionConfigurationTest {
4750

4851
private static final int MAX_INACTIVE_INTERVAL_IN_SECONDS = 600;
4952

50-
@Rule
51-
public final ExpectedException thrown = ExpectedException.none();
53+
@Rule public final ExpectedException thrown = ExpectedException.none();
5254

5355
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
5456

@@ -106,8 +108,8 @@ public void customMaxInactiveIntervalInSeconds() {
106108
MongoOperationsSessionRepository repository = this.context.getBean(MongoOperationsSessionRepository.class);
107109

108110
assertThat(repository).isNotNull();
109-
assertThat(ReflectionTestUtils.getField(repository, "maxInactiveIntervalInSeconds")).isEqualTo(
110-
MAX_INACTIVE_INTERVAL_IN_SECONDS);
111+
assertThat(ReflectionTestUtils.getField(repository, "maxInactiveIntervalInSeconds"))
112+
.isEqualTo(MAX_INACTIVE_INTERVAL_IN_SECONDS);
111113
}
112114

113115
@Test
@@ -118,8 +120,8 @@ public void setCustomMaxInactiveIntervalInSeconds() {
118120
MongoOperationsSessionRepository repository = this.context.getBean(MongoOperationsSessionRepository.class);
119121

120122
assertThat(repository).isNotNull();
121-
assertThat(ReflectionTestUtils.getField(repository, "maxInactiveIntervalInSeconds")).isEqualTo(
122-
MAX_INACTIVE_INTERVAL_IN_SECONDS);
123+
assertThat(ReflectionTestUtils.getField(repository, "maxInactiveIntervalInSeconds"))
124+
.isEqualTo(MAX_INACTIVE_INTERVAL_IN_SECONDS);
123125
}
124126

125127
@Test
@@ -138,8 +140,7 @@ public void setCustomSessionConverterConfiguration() {
138140
@Test
139141
public void resolveCollectionNameByPropertyPlaceholder() {
140142

141-
this.context.setEnvironment(
142-
new MockEnvironment().withProperty("session.mongo.collectionName", COLLECTION_NAME));
143+
this.context.setEnvironment(new MockEnvironment().withProperty("session.mongo.collectionName", COLLECTION_NAME));
143144
registerAndRefresh(CustomMongoJdbcSessionConfiguration.class);
144145

145146
MongoHttpSessionConfiguration configuration = this.context.getBean(MongoHttpSessionConfiguration.class);

0 commit comments

Comments
 (0)