Use spring-javaformat to format and check code

Resolves: #1450
This commit is contained in:
Vedran Pavic
2019-06-17 23:44:55 +02:00
parent 0eaeb98b0c
commit 822db7fbbf
241 changed files with 2961 additions and 4660 deletions

View File

@@ -32,34 +32,34 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Eddú Meléndez
* @author Rob Winch
*/
public class AttributeTests {
class AttributeTests {
private WebDriver driver;
@BeforeEach
public void setup() {
void setup() {
this.driver = new HtmlUnitDriver();
}
@AfterEach
public void tearDown() {
void tearDown() {
this.driver.quit();
}
@Test
public void home() {
void home() {
HomePage home = HomePage.go(this.driver);
home.assertAt();
}
@Test
public void noAttributes() {
void noAttributes() {
HomePage home = HomePage.go(this.driver);
assertThat(home.attributes()).isEmpty();
}
@Test
public void createAttribute() {
void createAttribute() {
HomePage home = HomePage.go(this.driver);
// @formatter:off
home = home.form()

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2017 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.
@@ -77,6 +77,7 @@ public class HomePage {
}
public class Form {
@FindBy(name = "attributeName")
WebElement attributeName;
@@ -104,9 +105,11 @@ public class HomePage {
this.submit.click();
return PageFactory.initElements(HomePage.this.driver, page);
}
}
public static class Attribute {
@FindBy(xpath = ".//td[1]")
WebElement attributeName;
@@ -130,6 +133,7 @@ public class HomePage {
public String getAttributeValue() {
return this.attributeValue.getText();
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2017 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.
@@ -30,5 +30,6 @@ public class Config {
public LettuceConnectionFactory connectionFactory() {
return new LettuceConnectionFactory(); // <2>
}
}
// end::class[]

View File

@@ -32,8 +32,7 @@ public class EmbeddedRedisConfig {
@Bean
public GenericContainer redisContainer() {
GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE)
.withExposedPorts(6379);
GenericContainer redisContainer = new GenericContainer(DOCKER_IMAGE).withExposedPorts(6379);
redisContainer.start();
return redisContainer;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 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.
@@ -18,11 +18,14 @@ package sample;
import org.springframework.session.web.context.AbstractHttpSessionApplicationInitializer;
// @formatter:off
// tag::class[]
public class Initializer extends AbstractHttpSessionApplicationInitializer { // <1>
public Initializer() {
super(Config.class); // <2>
}
}
// end::class[]
// @formatter:on

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 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.
@@ -29,8 +29,7 @@ import javax.servlet.http.HttpServletResponse;
public class SessionServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String attributeName = req.getParameter("attributeName");
String attributeValue = req.getParameter("attributeValue");
req.getSession().setAttribute(attributeName, attributeValue);
@@ -38,5 +37,6 @@ public class SessionServlet extends HttpServlet {
}
private static final long serialVersionUID = 2878267318695777395L;
}
// tag::end[]