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

@@ -48,7 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(SpringExtension.class)
@SpringBootTest(webEnvironment = WebEnvironment.MOCK)
@AutoConfigureMockMvc
public class HttpRedisJsonTest {
class HttpRedisJsonTest {
private static final String DOCKER_IMAGE = "redis:5.0.5";
@@ -58,29 +58,29 @@ public class HttpRedisJsonTest {
private WebDriver driver;
@BeforeEach
public void setup() {
void setup() {
this.driver = MockMvcHtmlUnitDriverBuilder.mockMvcSetup(this.mockMvc).build();
}
@AfterEach
public void tearDown() {
void tearDown() {
this.driver.quit();
}
@Test
public void goLoginRedirectToLogin() {
void goLoginRedirectToLogin() {
LoginPage login = HomePage.go(this.driver, LoginPage.class);
login.assertAt();
}
@Test
public void goHomeRedirectLoginPage() {
void goHomeRedirectLoginPage() {
LoginPage login = HomePage.go(this.driver, LoginPage.class);
login.assertAt();
}
@Test
public void login() {
void login() {
LoginPage login = HomePage.go(this.driver, LoginPage.class);
HomePage home = login.form().login(HomePage.class);
home.containCookie("SESSION");
@@ -88,7 +88,7 @@ public class HttpRedisJsonTest {
}
@Test
public void createAttribute() {
void createAttribute() {
LoginPage login = HomePage.go(this.driver, LoginPage.class);
HomePage home = login.form().login(HomePage.class);
// @formatter:off
@@ -108,8 +108,7 @@ public class HttpRedisJsonTest {
@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

@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@ExtendWith(SpringExtension.class)
@SpringBootTest
public class RedisSerializerTest {
class RedisSerializerTest {
private static final String DOCKER_IMAGE = "redis:5.0.5";
@@ -45,7 +45,7 @@ public class RedisSerializerTest {
private RedisTemplate<Object, Object> sessionRedisTemplate;
@Test
public void testRedisTemplate() {
void testRedisTemplate() {
assertThat(this.sessionRedisTemplate).isNotNull();
assertThat(this.sessionRedisTemplate.getDefaultSerializer()).isNotNull();
assertThat(this.sessionRedisTemplate.getDefaultSerializer())
@@ -57,8 +57,7 @@ public class RedisSerializerTest {
@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-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.
@@ -73,8 +73,7 @@ public class HomePage {
}
public HomePage logout() {
WebElement logout = this.driver
.findElement(By.cssSelector("input[type=\"submit\"]"));
WebElement logout = this.driver.findElement(By.cssSelector("input[type=\"submit\"]"));
logout.click();
return PageFactory.initElements(this.driver, HomePage.class);
}
@@ -93,6 +92,7 @@ public class HomePage {
}
public class Form {
@FindBy(name = "key")
WebElement attributeName;
@@ -120,9 +120,11 @@ public class HomePage {
this.submit.click();
return PageFactory.initElements(HomePage.this.driver, page);
}
}
public static class Attribute {
@FindBy(xpath = ".//td[1]")
WebElement attributeName;
@@ -146,6 +148,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.
@@ -64,6 +64,7 @@ public class LoginPage extends BasePage {
this.button.click();
return PageFactory.initElements(getDriver(), page);
}
}
}

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.
@@ -27,4 +27,5 @@ public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}

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.
@@ -40,7 +40,6 @@ public class SessionConfig implements BeanClassLoaderAware {
/**
* Customized {@link ObjectMapper} to add mix-in for class that doesn't have default
* constructors
*
* @return the {@link ObjectMapper} to use
*/
private ObjectMapper objectMapper() {
@@ -60,4 +59,5 @@ public class SessionConfig implements BeanClassLoaderAware {
public void setBeanClassLoader(ClassLoader classLoader) {
this.loader = classLoader;
}
}

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,11 +30,11 @@ public class HomeController {
@RequestMapping("/setValue")
public String setValue(@RequestParam(name = "key", required = false) String key,
@RequestParam(name = "value", required = false) String value,
HttpServletRequest request) {
@RequestParam(name = "value", required = false) String value, HttpServletRequest request) {
if (!ObjectUtils.isEmpty(key) && !ObjectUtils.isEmpty(value)) {
request.getSession().setAttribute(key, value);
}
return "home";
}
}