Search in sources :

Example 1 with Dao

use of org.sakuli.services.forwarder.database.dao.impl.Dao in project sakuli by ConSol.

the class DaoTest method testCreateSqlSetStringForNamedParameter.

@Test
public void testCreateSqlSetStringForNamedParameter() throws Throwable {
    testling = new Dao(dataSource) {
    };
    MapSqlParameterSource source = new MapSqlParameterSource().addValue("testling2", "value").addValue("testling", "value");
    Assert.assertEquals("SET testling2=:testling2, testling=:testling ", testling.createSqlSetStringForNamedParameter(source.getValues()));
    source.addValue("nullable", null);
    Assert.assertEquals("SET testling2=:testling2, testling=:testling ", testling.createSqlSetStringForNamedParameter(source.getValues()));
}
Also used : Dao(org.sakuli.services.forwarder.database.dao.impl.Dao) MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource) Test(org.testng.annotations.Test)

Aggregations

Dao (org.sakuli.services.forwarder.database.dao.impl.Dao)1 MapSqlParameterSource (org.springframework.jdbc.core.namedparam.MapSqlParameterSource)1 Test (org.testng.annotations.Test)1