+
Description
+
This application demonstrates how to use a Redis instance to back your session. Notice that there is no
+ JSESSIONID cookie. We are also able to customize the way of identifying what the requested session id is.
+
+
Try it
+
+
+
+
+
+
+
+
+ | Attribute Name |
+ Attribute Value |
+
+
+
+
+ |
+ |
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-session-data-mongodb-reactive-boot/src/test/java/org/springframework/session/mongodb/examples/AttributeTests.java b/spring-session-data-mongodb-reactive-boot/src/test/java/org/springframework/session/mongodb/examples/AttributeTests.java
new file mode 100644
index 0000000..2fb2625
--- /dev/null
+++ b/spring-session-data-mongodb-reactive-boot/src/test/java/org/springframework/session/mongodb/examples/AttributeTests.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2014-2017 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
+ *
+ * http://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 static org.assertj.core.api.Assertions.*;
+
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+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.junit4.SpringRunner;
+
+/**
+ * @author Eddú Meléndez
+ * @author Rob Winch
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+public class AttributeTests {
+
+ @LocalServerPort
+ int port;
+
+ private WebDriver driver;
+
+ @Before
+ public void setup() {
+ this.driver = new HtmlUnitDriver();
+ }
+
+ @After
+ public void tearDown() {
+ this.driver.quit();
+ }
+
+ @Test
+ public void home() {
+ HomePage home = HomePage.go(this.driver, this.port);
+ home.assertAt();
+ }
+
+ @Test
+ public void noAttributes() {
+ HomePage home = HomePage.go(this.driver, this.port);
+ assertThat(home.attributes()).isEmpty();
+ }
+
+ @Test
+ public void createAttribute() {
+ HomePage home = HomePage.go(this.driver, this.port);
+ // @formatter:off
+ home = home.form()
+ .attributeName("a")
+ .attributeValue("b")
+ .submit(HomePage.class);
+ // @formatter:on
+
+ List