IN PROGRESS - BATCH-711: Upgrade ItemWriter and implementations to use parameterized types
This commit is contained in:
@@ -63,7 +63,7 @@ public class BatchSqlCustomerCreditIncreaseWriterTests {
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.sample.item.writer.BatchSqlCustomerCreditIncreaseWriter#write(java.lang.Object)}.
|
||||
* {@link org.springframework.batch.sample.item.writer.BatchSqlCustomerCreditIncreaseWriter#write(CustomerCredit)}.
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
package org.springframework.batch.sample.item.writer;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.batch.core.UnexpectedJobExecutionException;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.sample.domain.Order;
|
||||
|
||||
public class OrderWriterTests {
|
||||
|
||||
private MockControl writerControl;
|
||||
private OrderWriter processor;
|
||||
private ItemWriter writer;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
||||
//create mock writer
|
||||
writerControl = MockControl.createControl(ItemWriter.class);
|
||||
writer = (ItemWriter)writerControl.getMock();
|
||||
|
||||
//create processor
|
||||
processor = new OrderWriter();
|
||||
processor.setDelegate(writer);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcess() throws Exception {
|
||||
|
||||
Order order = new Order();
|
||||
//set-up mock writer
|
||||
writer.write(order);
|
||||
writerControl.replay();
|
||||
|
||||
//call tested method
|
||||
processor.write(order);
|
||||
|
||||
//verify method calls
|
||||
writerControl.verify();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcessWithException() throws Exception {
|
||||
|
||||
writerControl.replay();
|
||||
//call tested method
|
||||
try {
|
||||
processor.write(this);
|
||||
fail("Batch critical exception was expected");
|
||||
} catch (UnexpectedJobExecutionException bce) {
|
||||
assertTrue(true);
|
||||
}
|
||||
writerControl.verify();
|
||||
}
|
||||
}
|
||||
@@ -40,12 +40,4 @@ public class TradeProcessorTests {
|
||||
writerControl.verify();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcessNonTradeObject() {
|
||||
|
||||
writerControl.replay();
|
||||
//call tested method
|
||||
processor.write(this);
|
||||
writerControl.verify();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user