Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to spring-java-format 0.0.42 #139

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spring-batch-excel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
<dependency>
<groupId>io.spring.javaformat</groupId>
<artifactId>spring-javaformat-checkstyle</artifactId>
<version>0.0.35</version>
<version>0.0.42</version>
</dependency>
</dependencies>
<executions>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2024 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.
Expand Down Expand Up @@ -32,12 +32,12 @@
* @author Marten Deinum
* @since 0.1.0
*/
public class BeanPropertyItemReaderTest {
class BeanPropertyItemReaderTests {

private MockExcelItemReader<Player> reader;

@BeforeEach
public void setup() throws Exception {
void setup() {
ExecutionContext executionContext = new ExecutionContext();

List<String[]> rows = new ArrayList<>();
Expand All @@ -60,7 +60,7 @@ public void setup() throws Exception {
}

@Test
public void readandMapPlayers() throws Exception {
void readandMapPlayers() throws Exception {
Player p1 = this.reader.read();
Player p2 = this.reader.read();
Player p3 = this.reader.read();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 the original author or authors.
* Copyright 2006-2024 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.
Expand Down Expand Up @@ -34,12 +34,12 @@
* @author Marten Deinum
* @since 0.1.0
*/
public class BeanPropertyWithStaticHeaderItemReaderTest {
class BeanPropertyWithStaticHeaderItemReaderTests {

private MockExcelItemReader<Player> reader;

@BeforeEach
public void setup() throws Exception {
void setup() {
ExecutionContext executionContext = new ExecutionContext();

List<String[]> rows = new ArrayList<>();
Expand All @@ -64,7 +64,7 @@ public void setup() throws Exception {
}

@Test
public void readandMapPlayers() throws Exception {
void readAndMapPlayers() throws Exception {
Player p1 = this.reader.read();
Player p2 = this.reader.read();
Player p3 = this.reader.read();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2024 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.
Expand Down Expand Up @@ -37,18 +37,18 @@
* @author Marten Deinum
* @since 0.1.0
*/
public class BeanWrapperRowMapperTest {
class BeanWrapperRowMapperTests {

@Test
public void givenNoNameWhenInitCompleteThenIllegalStateShouldOccur() {
void givenNoNameWhenInitCompleteThenIllegalStateShouldOccur() {
Assertions.assertThatThrownBy(() -> {
BeanWrapperRowMapper<Player> mapper = new BeanWrapperRowMapper<>();
mapper.afterPropertiesSet();
}).isInstanceOf(IllegalStateException.class);
}

@Test
public void givenAValidRowWhenMappingThenAValidPlayerShouldBeConstructed() throws Exception {
void givenAValidRowWhenMappingThenAValidPlayerShouldBeConstructed() throws Exception {
BeanWrapperRowMapper<Player> mapper = new BeanWrapperRowMapper<>();
mapper.setTargetType(Player.class);
mapper.afterPropertiesSet();
Expand Down Expand Up @@ -78,7 +78,7 @@ public void givenAValidRowWhenMappingThenAValidPlayerShouldBeConstructed() throw
}

@Test
public void givenAValidRowWhenMappingThenAValidPlayerShouldBeConstructedBasedOnPrototype() throws Exception {
void givenAValidRowWhenMappingThenAValidPlayerShouldBeConstructedBasedOnPrototype() throws Exception {

ApplicationContext ctx = new AnnotationConfigApplicationContext(TestConfig.class);
BeanWrapperRowMapper<Player> mapper = ctx.getBean("playerRowMapper", BeanWrapperRowMapper.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
import static org.assertj.core.api.Assertions.assertThat;


public class PoiItemReaderTypesTest {
class PoiItemReaderTypesTests {

@Test
public void shouldBeAbleToReadMultipleTypes() throws Exception {
void shouldBeAbleToReadMultipleTypes() throws Exception {
var reader = new PoiItemReader<String[]>();
reader.setResource(new ClassPathResource("types.xls"));
reader.setRowMapper(new PassThroughRowMapper());
Expand All @@ -49,7 +49,7 @@ public void shouldBeAbleToReadMultipleTypes() throws Exception {
}

@Test
public void shouldBeAbleToReadMultipleTypesWithDatesAsIso() throws Exception {
void shouldBeAbleToReadMultipleTypesWithDatesAsIso() throws Exception {
var reader = new PoiItemReader<String[]>();
reader.setResource(new ClassPathResource("types.xls"));
reader.setRowMapper(new PassThroughRowMapper());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2024 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.
Expand Down Expand Up @@ -35,14 +35,14 @@
* @author Marten Deinum
* @since 0.1.0
*/
public class PoiItemReaderWithBlankRowSheetTest {
class PoiItemReaderWithBlankRowSheetTests {

private final Log logger = LogFactory.getLog(this.getClass());

private PoiItemReader<String[]> itemReader;

@BeforeEach
public void setup() throws Exception {
void setup() {
this.itemReader = new PoiItemReader<>();
this.itemReader.setResource(new ClassPathResource("blankRow.xlsx"));
this.itemReader.setLinesToSkip(1); // First line is column names
Expand All @@ -55,7 +55,7 @@ public void setup() throws Exception {
}

@Test
public void readExcelFileWithBlankRow() throws Exception {
void readExcelFileWithBlankRow() throws Exception {
assertThat(this.itemReader.getNumberOfSheets()).isEqualTo(1);
String[] row;
do {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2024 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.
Expand Down Expand Up @@ -35,14 +35,14 @@
* @author Marten Deinum
* @since 0.1.0
*/
public class PoiItemReaderWithErrorsTest {
class PoiItemReaderWithErrorsTests {

private final Log logger = LogFactory.getLog(this.getClass());

private PoiItemReader<String[]> itemReader;

@BeforeEach
public void setup() throws Exception {
void setup() {
this.itemReader = new PoiItemReader<>();
this.itemReader.setResource(new ClassPathResource("errors.xlsx"));
this.itemReader.setLinesToSkip(1); // First line is column names
Expand All @@ -55,7 +55,7 @@ public void setup() throws Exception {
}

@Test
public void readExcelFileWithBlankRow() throws Exception {
void readExcelFileWithBlankRow() throws Exception {
assertThat(this.itemReader.getNumberOfSheets()).isEqualTo(1);
String[] row;
String[] lastRow = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 the original author or authors.
* Copyright 2006-2024 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.
Expand All @@ -24,7 +24,7 @@
* @author Marten Deinum
* @since 0.1.0
*/
class StreamingXlsxItemReaderTest extends AbstractExcelItemReaderTests {
class StreamingXlsxItemReaderTests extends AbstractExcelItemReaderTests {

@Override
protected void configureItemReader(AbstractExcelItemReader<String[]> itemReader) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 the original author or authors.
* Copyright 2006-2024 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.
Expand All @@ -24,7 +24,7 @@
* @author Marten Deinum
* @since 0.1.0
*/
class StreamingXlsxItemReaderWithBlankLinesTest extends AbstractExcelItemReaderTests {
class StreamingXlsxItemReaderWithBlankLinesTests extends AbstractExcelItemReaderTests {

@Override
protected void configureItemReader(AbstractExcelItemReader<String[]> itemReader) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

import static org.assertj.core.api.Assertions.assertThat;

public class StreamingXlsxTypesTest {
class StreamingXlsxTypesTests {

@Test
public void shouldBeAbleToReadMultipleTypes() throws Exception {
void shouldBeAbleToReadMultipleTypes() throws Exception {
var reader = new StreamingXlsxItemReader<String[]>();
reader.setResource(new ClassPathResource("types.xlsx"));
reader.setRowMapper(new PassThroughRowMapper());
Expand All @@ -47,7 +47,7 @@ public void shouldBeAbleToReadMultipleTypes() throws Exception {
}

@Test
public void shouldBeAbleToReadMultipleTypesWithDatesAsIso() throws Exception {
void shouldBeAbleToReadMultipleTypesWithDatesAsIso() throws Exception {
var reader = new StreamingXlsxItemReader<String[]>();
reader.setResource(new ClassPathResource("types.xlsx"));
reader.setRowMapper(new PassThroughRowMapper());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2024 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.
Expand Down Expand Up @@ -34,7 +34,7 @@
* @author Marten Deinum
* @since 0.1.0
*/
public class DefaultRowSetMetaDataTest {
class DefaultRowSetMetaDataTests {

private static final String[] COLUMNS = { "col1", "col2", "col3" };

Expand All @@ -45,14 +45,14 @@ public class DefaultRowSetMetaDataTest {
private ColumnNameExtractor columnNameExtractor;

@BeforeEach
public void setup() {
void setup() {
this.sheet = Mockito.mock(Sheet.class);
this.columnNameExtractor = Mockito.mock(ColumnNameExtractor.class);
this.rowSetMetaData = new DefaultRowSetMetaData(this.sheet, this.columnNameExtractor);
}

@Test
public void shouldReturnColumnsFromColumnNameExtractor() {
void shouldReturnColumnsFromColumnNameExtractor() {

given(this.columnNameExtractor.getColumnNames(this.sheet)).willReturn(COLUMNS);

Expand All @@ -65,7 +65,7 @@ public void shouldReturnColumnsFromColumnNameExtractor() {
}

@Test
public void shouldGetAndReturnNameOfTheSheet() {
void shouldGetAndReturnNameOfTheSheet() {

given(this.sheet.getName()).willReturn("testing123");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 the original author or authors.
* Copyright 2006-2024 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.
Expand All @@ -24,12 +24,12 @@
* @author Marten Deinum
* @since 0.1.0
*/
public class StaticColumnNameExtractorTest {
class StaticColumnNameExtractorTests {

private static final String[] COLUMNS = { "col1", "col2", "col3", "foo", "bar" };

@Test
public void shouldReturnSameHeadersAsPassedIn() {
void shouldReturnSameHeadersAsPassedIn() {

StaticColumnNameExtractor columnNameExtractor = new StaticColumnNameExtractor(COLUMNS);
String[] names = columnNameExtractor.getColumnNames(null);
Expand All @@ -39,7 +39,7 @@ public void shouldReturnSameHeadersAsPassedIn() {
}

@Test
public void shouldReturnACopyOfTheHeaders() {
void shouldReturnACopyOfTheHeaders() {

StaticColumnNameExtractor columnNameExtractor = new StaticColumnNameExtractor(COLUMNS);
String[] names = columnNameExtractor.getColumnNames(null);
Expand Down
Loading