// Path: batch-web-spring-boot-autoconfigure/src/test/java/de/codecentric/batch/item/DummyItemReader.java
// public class DummyItemReader implements ItemReader<String> {
// 
// 	private static final Logger LOGGER = LoggerFactory.getLogger(DummyItemReader.class);
// 
// 	private String[] input = { "Good", "morning!", "This", "is", "your", "ItemReader", "speaking!" };
// 
// 	private int index = 0;
// 
// 	/**
// 	 * Reads next record from input
// 	 */
// 	@Override
// 	public String read() throws Exception {
// 		String item = null;
// 		if (index < input.length) {
// 			item = input[index++];
// 			LOGGER.info(item);
// 			return item;
// 		} else {
// 			return null;
// 		}
// 
// 	}
// 
// }
// 
// Path: batch-web-spring-boot-autoconfigure/src/test/java/de/codecentric/batch/item/LogItemProcessor.java
// public class LogItemProcessor implements ItemProcessor<String, String> {
// 
// 	private static final Logger LOGGER = LoggerFactory.getLogger(LogItemProcessor.class);
// 
// 	@Override
// 	public String process(String item) throws Exception {
// 		LOGGER.info(item);
// 		return item;
// 	}
// 
// }
// 
// Path: batch-web-spring-boot-autoconfigure/src/test/java/de/codecentric/batch/item/LogItemWriter.java
// public class LogItemWriter implements ItemWriter<Object> {
// 
// 	private static final Logger LOGGER = LoggerFactory.getLogger(LogItemWriter.class);
// 
// 	/**
// 	 * @see ItemWriter#write(java.util.List)
// 	 */
// 	@Override
// 	public void write(List<? extends Object> data) throws Exception {
// 		LOGGER.info("{}", data);
// 	}
// 
// }


import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.core.launch.support.RunIdIncrementer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import de.codecentric.batch.item.DummyItemReader;
import de.codecentric.batch.item.LogItemProcessor;
import de.codecentric.batch.item.LogItemWriter;
/*
 * Copyright 2018 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 de.codecentric.batch.jobs;



@Configuration
public class IncrementerJobConfiguration {

	@Autowired
	private JobBuilderFactory jobBuilderFactory;

	@Autowired
	private StepBuilderFactory stepBuilderFactory;

	@Bean
	public Job incrementerJob() {
		return jobBuilderFactory.get("incrementerJob")//
				.start(step())//
				.incrementer(incrementer())//
				.build();
	}

	@Bean
// Path: batch-web-spring-boot-autoconfigure/src/test/java/de/codecentric/batch/item/DummyItemReader.java
// public class DummyItemReader implements ItemReader<String> {
// 
// 	private static final Logger LOGGER = LoggerFactory.getLogger(DummyItemReader.class);
// 
// 	private String[] input = { "Good", "morning!", "This", "is", "your", "ItemReader", "speaking!" };
// 
// 	private int index = 0;
// 
// 	/**
// 	 * Reads next record from input
// 	 */
// 	@Override
// 	public String read() throws Exception {
// 		String item = null;
// 		if (index < input.length) {
// 			item = input[index++];
// 			LOGGER.info(item);
// 			return item;
// 		} else {
// 			return null;
// 		}
// 
// 	}
// 
// }
// 
// Path: batch-web-spring-boot-autoconfigure/src/test/java/de/codecentric/batch/item/LogItemProcessor.java
// public class LogItemProcessor implements ItemProcessor<String, String> {
// 
// 	private static final Logger LOGGER = LoggerFactory.getLogger(LogItemProcessor.class);
// 
// 	@Override
// 	public String process(String item) throws Exception {
// 		LOGGER.info(item);
// 		return item;
// 	}
// 
// }
// 
// Path: batch-web-spring-boot-autoconfigure/src/test/java/de/codecentric/batch/item/LogItemWriter.java
// public class LogItemWriter implements ItemWriter<Object> {
// 
// 	private static final Logger LOGGER = LoggerFactory.getLogger(LogItemWriter.class);
// 
// 	/**
// 	 * @see ItemWriter#write(java.util.List)
// 	 */
// 	@Override
// 	public void write(List<? extends Object> data) throws Exception {
// 		LOGGER.info("{}", data);
// 	}
// 
// }


// Path: batch-web-spring-boot-autoconfigure/src/test/java/de/codecentric/batch/jobs/IncrementerJobConfiguration.java
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.core.launch.support.RunIdIncrementer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import de.codecentric.batch.item.DummyItemReader;
import de.codecentric.batch.item.LogItemProcessor;
import de.codecentric.batch.item.LogItemWriter;

/*
 * Copyright 2018 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 de.codecentric.batch.jobs;



@Configuration
public class IncrementerJobConfiguration {

	@Autowired
	private JobBuilderFactory jobBuilderFactory;

	@Autowired
	private StepBuilderFactory stepBuilderFactory;

	@Bean
	public Job incrementerJob() {
		return jobBuilderFactory.get("incrementerJob")//
				.start(step())//
				.incrementer(incrementer())//
				.build();
	}

	@Bean
	public Step step() {