use of org.sonar.db.dialect.H2 in project sonarqube by SonarSource.
the class DropIndexBuilderTest method throw_NPE_if_table_name_is_missing.
@Test
public void throw_NPE_if_table_name_is_missing() {
expectedException.expect(NullPointerException.class);
expectedException.expectMessage("Table name cannot be null");
new DropIndexBuilder(new H2()).setName("issues_key").build();
}
use of org.sonar.db.dialect.H2 in project sonarqube by SonarSource.
the class DropIndexBuilderTest method throw_NPE_if_index_name_is_missing.
@Test
public void throw_NPE_if_index_name_is_missing() {
expectedException.expect(NullPointerException.class);
expectedException.expectMessage("Index name cannot be null");
new DropIndexBuilder(new H2()).setTable("issues").build();
}
use of org.sonar.db.dialect.H2 in project sonarqube by SonarSource.
the class AddUniqueIndexOnUuidOfSnapshotsTest method create_unique_index.
@Test
public void create_unique_index() throws Exception {
when(db.getDialect()).thenReturn(new H2());
AddUniqueIndexOnUuidOfSnapshots underTest = new AddUniqueIndexOnUuidOfSnapshots(db);
underTest.execute(context);
verify(context).execute(asList("CREATE UNIQUE INDEX analyses_uuid ON snapshots (uuid)"));
verifyNoMoreInteractions(context);
}
Aggregations