List of usage examples for org.springframework.integration.jdbc StoredProcExecutor setSqlParameters
public void setSqlParameters(List<SqlParameter> sqlParameters)
From source file:org.springframework.integration.jdbc.StoredProcExecutorTests.java
@Test public void testSetSqlParametersWithNullValueInList() { DataSource datasource = mock(DataSource.class); StoredProcExecutor storedProcExecutor = new StoredProcExecutor(datasource); List<SqlParameter> sqlParameters = new ArrayList<SqlParameter>(); sqlParameters.add(null);//from w ww . ja v a2 s .co m try { storedProcExecutor.setSqlParameters(sqlParameters); } catch (IllegalArgumentException e) { assertEquals("The provided list (sqlParameters) cannot contain null values.", e.getMessage()); return; } fail("Exception expected."); }
From source file:org.springframework.integration.jdbc.StoredProcExecutorTests.java
@Test public void testSetSqlParametersWithEmptyList() { DataSource datasource = mock(DataSource.class); StoredProcExecutor storedProcExecutor = new StoredProcExecutor(datasource); List<SqlParameter> sqlParameters = new ArrayList<SqlParameter>(); try {//from w ww. j a v a 2 s. co m storedProcExecutor.setSqlParameters(sqlParameters); } catch (IllegalArgumentException e) { assertEquals("sqlParameters must not be null or empty.", e.getMessage()); return; } fail("Exception expected."); }
From source file:org.springframework.integration.jdbc.StoredProcExecutorTests.java
@Test public void testSetSqlParametersWithNullList() { DataSource datasource = mock(DataSource.class); StoredProcExecutor storedProcExecutor = new StoredProcExecutor(datasource); try {// ww w.jav a2 s . c om storedProcExecutor.setSqlParameters(null); } catch (IllegalArgumentException e) { assertEquals("sqlParameters must not be null or empty.", e.getMessage()); return; } fail("Exception expected."); }