soi-toolkit / soi-toolkit-mule

SOI Toolkit and Mule ESB
Apache License 2.0
6 stars 1 forks source link

Use jdbc-temaple instead of jdbc-inbound endpoint in integration tests to insert testdata into export tables #320

Open hdahl opened 9 years ago

hdahl commented 9 years ago

Original issue 320 created by soi-toolkit on 2012-12-17T07:22:50.000Z:

Today integration tests use jdbc-inbound endpoints to insert testdata into export tables like:

    String inboundEndpoint = "jdbc://INSERT INTO FROM_JEEVES_EXPORT_TB(ID, VALUE) VALUES ('" + inId + "', '" + inValue + "')?connector=soitoolkit-jdbc-connector";
    MuleMessage reply = dispatchAndWaitForServiceComponent(inboundEndpoint, input, props, receivingService, timeout);

This however only works for very simple testdata, eg not for xml.

A very simple improvement would be to replace it with a jdbc-template solution for example:

    JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
    jdbcTemplate.update("INSERT INTO FROM_JEEVES_EXPORT_TB(ID, VALUE) VALUES(?, ?)", new Object [] {inId, inValue});
    MuleMessage reply = waitForServiceComponent(receivingService, timeout);
hdahl commented 9 years ago

Comment #1 originally posted by soi-toolkit on 2014-02-23T15:25:07.000Z:

<empty>