package ch.difty.scipamato.public_.config;

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

import javax.sql.DataSource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.zaxxer.hikari.HikariDataSource;

@RunWith(SpringRunner.class)
@SpringBootTest
public class HikariDatasourceProductionSettingsTest {

    @Autowired
    private DataSource datasource;

    @Test
    public void validateSettingsInProduction() {
        assertThat(datasource).isInstanceOf(HikariDataSource.class);
        HikariDataSource ds = (HikariDataSource) datasource;

        assertThat(ds.getJdbcUrl()).isEqualTo("jdbc:postgresql://localhost:5432/scipamato_public");
        assertThat(ds.getUsername()).isEqualTo("scipamatopub");
        assertThat(ds.getPassword()).isEqualTo("scipamatopub");
        assertThat(ds.getConnectionTimeout()).isEqualTo(15000);
        assertThat(ds.getIdleTimeout()).isEqualTo(600000);
        assertThat(ds.getMaxLifetime()).isEqualTo(600000);
        assertThat(ds.getMinimumIdle()).isEqualTo(-1);
        assertThat(ds.getMaximumPoolSize()).isEqualTo(9);
        assertThat(ds.getPoolName()).isEqualTo("SciPaMaTo-Public-HikariCP");
        assertThat(ds.isReadOnly()).isTrue();
    }
}

@@ -1044,32 +1044,35 @@
 (15000);%0A       
+ //
  assertThat(ds.g
@@ -1098,32 +1098,55 @@
 EqualTo(600000);
+ // not deterministic??
 %0A        assertT
@@ -1189,23 +1189,26 @@
 00000);%0A
-
        
+ //
  assertT

Fix non-deterministic asserts in HikariDatasourceProductionSettingsTest