use of org.ff4j.property.store.JdbcPropertyStore in project ff4j by ff4j.
the class JdbcPropertyStoreErrorTest method testUpdateKO.
@Test(expected = IllegalArgumentException.class)
public void testUpdateKO() throws SQLException {
DataSource mockDS = Mockito.mock(DataSource.class);
doThrow(new SQLException()).when(mockDS).getConnection();
JdbcPropertyStore jrepo = new JdbcPropertyStore(mockDS);
jrepo.setDataSource(mockDS);
jrepo.updateProperty(null);
}
use of org.ff4j.property.store.JdbcPropertyStore in project ff4j by ff4j.
the class JdbcPropertyStoreErrorTest method testReadKO.
@Test(expected = PropertyAccessException.class)
public void testReadKO() throws SQLException {
DataSource mockDS = Mockito.mock(DataSource.class);
doThrow(new SQLException()).when(mockDS).getConnection();
JdbcPropertyStore jrepo = new JdbcPropertyStore(mockDS);
jrepo.setDataSource(mockDS);
jrepo.readProperty("p1");
}
use of org.ff4j.property.store.JdbcPropertyStore in project ff4j by ff4j.
the class JdbcPropertyStoreErrorTest method testListProperties.
@Test(expected = PropertyAccessException.class)
public void testListProperties() throws SQLException {
DataSource mockDS = Mockito.mock(DataSource.class);
doThrow(new SQLException()).when(mockDS).getConnection();
JdbcPropertyStore jrepo = new JdbcPropertyStore(mockDS);
jrepo.setDataSource(mockDS);
jrepo.listPropertyNames();
}
use of org.ff4j.property.store.JdbcPropertyStore in project ff4j by ff4j.
the class JdbcPropertyStoreErrorTest method tesDeleteKO.
@Test(expected = PropertyAccessException.class)
public void tesDeleteKO() throws SQLException {
DataSource mockDS = Mockito.mock(DataSource.class);
doThrow(new SQLException()).when(mockDS).getConnection();
JdbcPropertyStore jrepo = new JdbcPropertyStore(mockDS);
jrepo.setDataSource(mockDS);
jrepo.deleteProperty("p1");
}
use of org.ff4j.property.store.JdbcPropertyStore in project ff4j by ff4j.
the class JdbcPropertyStoreErrorTest method testClearKO.
@Test(expected = PropertyAccessException.class)
public void testClearKO() throws SQLException {
DataSource mockDS = Mockito.mock(DataSource.class);
doThrow(new SQLException()).when(mockDS).getConnection();
JdbcPropertyStore jrepo = new JdbcPropertyStore(mockDS);
jrepo.setDataSource(mockDS);
jrepo.clear();
}
Aggregations