Skip to content

Commit

Permalink
Fix checkstyle issues
Browse files Browse the repository at this point in the history
Issue gh-2528
  • Loading branch information
marcusdacoregio committed Oct 19, 2023
1 parent 2b69cff commit 1cac130
Show file tree
Hide file tree
Showing 29 changed files with 15 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class CheckstylePlugin implements Plugin<Project> {
.named("libs")
project.plugins.withType(JavaPlugin) {
def checkstyleDir = project.rootProject.file(CHECKSTYLE_DIR)
if (checkstyleDir.exists() && checkstyleDir.directory) {
boolean isSampleProject = project.name.contains('sample')
if (checkstyleDir.exists() && checkstyleDir.directory && !isSampleProject) {
project.getPluginManager().apply('checkstyle')
project.dependencies.add('checkstyle', versionCatalog.findLibrary('io-spring-javaformat-spring-javaformat-checkstyle').get())
project.dependencies.add('checkstyle', versionCatalog.findLibrary('io-spring-nohttp-nohttp-checkstyle').get())
Expand Down
4 changes: 3 additions & 1 deletion etc/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>
<module name="io.spring.nohttp.checkstyle.check.NoHttpCheck"/>
<module name="io.spring.javaformat.checkstyle.SpringChecks"/>
<module name="io.spring.javaformat.checkstyle.SpringChecks">
<property name="excludes" value="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck" />
</module>
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
<module name="io.spring.javaformat.checkstyle.check.SpringJUnit5Check"/>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import jakarta.servlet.ServletContext;
import jakarta.servlet.SessionCookieConfig;
import jakarta.servlet.http.HttpSessionListener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import jakarta.servlet.http.HttpSession;
import jakarta.servlet.http.HttpSessionBindingEvent;
import jakarta.servlet.http.HttpSessionBindingListener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import jakarta.servlet.http.HttpServletRequestWrapper;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.concurrent.ConcurrentHashMap;

import jakarta.servlet.ServletContext;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* Tests for {@link SpringSessionBackedSessionRegistry}.
*/
@ExtendWith(MockitoExtension.class)
class SpringSessionBackedSessionRegistryTest {
class SpringSessionBackedSessionRegistryTests {

private static final String SESSION_ID = "sessionId";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import org.junit.jupiter.api.Test;

import org.springframework.security.core.Authentication;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.Collections;

import jakarta.servlet.http.Cookie;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.Base64;

import jakarta.servlet.http.Cookie;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletResponse;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpSessionEvent;
import jakarta.servlet.http.HttpSessionListener;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import jakarta.servlet.http.HttpSession;
import jakarta.servlet.http.HttpSessionBindingEvent;
import jakarta.servlet.http.HttpSessionBindingListener;

import org.assertj.core.data.Offset;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.concurrent.TimeUnit;

import jakarta.servlet.http.HttpSession;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
* @author Greg Turnquist
*/
public abstract class AbstractMongoSessionConverterTest {
public abstract class AbstractMongoSessionConverterTests {

abstract AbstractMongoSessionConverter getMongoSessionConverter();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @author Jakub Kubrynski
* @author Greg Turnquist
*/
public class JacksonMongoSessionConverterTest extends AbstractMongoSessionConverterTest {
public class JacksonMongoSessionConverterTests extends AbstractMongoSessionConverterTests {

JacksonMongoSessionConverter mongoSessionConverter = new JacksonMongoSessionConverter();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @author Rob Winch
* @author Greg Turnquist
*/
public class JdkMongoSessionConverterTest extends AbstractMongoSessionConverterTest {
public class JdkMongoSessionConverterTests extends AbstractMongoSessionConverterTests {

Duration inactiveInterval = Duration.ofMinutes(30);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* @author Greg Turnquist
*/
@ExtendWith(MockitoExtension.class)
public class MongoIndexedSessionRepositoryTest {
public class MongoIndexedSessionRepositoryTests {

@Mock
private AbstractMongoSessionConverter converter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @author Rob Winch
* @author Greg Turnquist
*/
public class MongoSessionTest {
public class MongoSessionTests {

@Test
void isExpiredWhenIntervalNegativeThenFalse() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
* @author Greg Turnquist
*/
@ExtendWith(MockitoExtension.class)
public class ReactiveMongoSessionRepositoryTest {
public class ReactiveMongoSessionRepositoryTests {

@Mock
private AbstractMongoSessionConverter converter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
* @author Eddú Meléndez
* @author Vedran Pavic
*/
public class MongoHttpSessionConfigurationTest {
public class MongoHttpSessionConfigurationTests {

private static final String COLLECTION_NAME = "testSessions";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
* @author Greg Turnquist
* @author Vedran Pavic
*/
public class ReactiveMongoWebSessionConfigurationTest {
public class ReactiveMongoWebSessionConfigurationTests {

private AnnotationConfigApplicationContext context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.Base64;

import jakarta.servlet.http.Cookie;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.Base64;

import jakarta.servlet.http.Cookie;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

class SessionUpdateEntryProcessorTest {
class SessionUpdateEntryProcessorTests {

private SessionUpdateEntryProcessor processor;

Expand Down

0 comments on commit 1cac130

Please sign in to comment.