use of org.springframework.integration.jdbc.metadata.JdbcMetadataStore in project spring-integration by spring-projects.
the class PersistentAcceptOnceFileListFilterExternalStoreTests method testFileSystemWithJdbcMetadataStore.
@Test
public void testFileSystemWithJdbcMetadataStore() throws Exception {
EmbeddedDatabase dataSource = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2).addScript("classpath:/org/springframework/integration/jdbc/schema-drop-h2.sql").addScript("classpath:/org/springframework/integration/jdbc/schema-h2.sql").build();
JdbcMetadataStore metadataStore = new JdbcMetadataStore(dataSource);
metadataStore.afterPropertiesSet();
try {
testFileSystem(metadataStore);
List<Map<String, Object>> metaData = new JdbcTemplate(dataSource).queryForList("SELECT * FROM INT_METADATA_STORE");
assertEquals(1, metaData.size());
assertEquals("43", metaData.get(0).get("METADATA_VALUE"));
} finally {
dataSource.shutdown();
}
}
Aggregations