package io.ebean.migration;

import jdk.nashorn.internal.ir.annotations.Ignore;
import org.testng.annotations.Test;

import java.sql.Connection;
import java.sql.SQLException;

import static org.assertj.core.api.Assertions.assertThat;

public class DbNameUtilTest {

  /**
   * Run manually against Postgres database.
   */
  @Ignore
  @Test
  public void normalise_when_realPostgres() throws SQLException {

    MigrationConfig config = createConfig();
    // assumes DB unit exists on our local postgres database
    config.setDbUrl("jdbc:postgresql://127.0.0.1:5432/unit");

    try (Connection connection = config.createConnection()) {
      String platformName = DbNameUtil.normalise(connection);

      assertThat(platformName).isEqualTo("postgres");
    } catch (SQLException e) {
      throw e;
    }
  }

  /**
   * Run manually against cockroach database.
   */
  @Ignore
  @Test
  public void normalise_when_cockroach() throws SQLException {

    MigrationConfig config = createConfig();
    // assumes DB unit exists on our local cockroach database
    config.setDbUrl("jdbc:postgresql://127.0.0.1:26257/unit");

    try (Connection connection = config.createConnection()) {
      String platformName = DbNameUtil.normalise(connection);
      assertThat(platformName).isEqualTo("cockroach");
    } catch (SQLException e) {
      throw e;
    }
  }

  /**
   * Assumes a DB user unit exists on the databases.
   */
  private MigrationConfig createConfig() {
    MigrationConfig config = new MigrationConfig();
    config.setDbUsername("unit");
    config.setDbPassword("unit");
    config.setDbDriver("org.postgresql.Driver");
    return config;
  }
}
@@ -26,59 +26,8 @@
 n;%0A%0A
-import jdk.nashorn.internal.ir.annotations.Ignore;%0A
 impo
@@ -264,38 +264,45 @@
 e.%0A   */%0A  @
-Ignore%0A  @Test
+Test(enabled = false)
 %0A  public vo
@@ -827,22 +827,29 @@
 %0A  @
-Ignore%0A  @Test
+Test(enabled = false)
 %0A  p

Modify integration test for CockroachDB to be enabled=false