Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import static org.junit.Assert.assertEquals;
- import static org.junit.Assert.assertNotNull;
- import static org.junit.jupiter.api.Assertions.assertTrue;
- import org.junit.jupiter.api.BeforeEach;
- import org.junit.jupiter.api.Test;
- import java.sql.*;
- import java.io.*;
- class TestDBsetup {
- DatabaseSetup db;
- String username, password, dbUrl;
- @BeforeEach
- void setUp() throws Exception {
- username = "pukdztdrlwizrd";
- password = "9fcf6d1c0c337ebe8d481aa56f8657b23b0020d403150c76e22ba58763d31fd3";
- dbUrl =
- "jdbc:postgresql://ec2-54-217-214-201.eu-west-1.compute.amazonaws.com:5432/d8cvilvhht35us?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory";
- DatabaseSetup db = new DatabaseSetup(username, password, dbUrl);
- }
- @Test
- void testConnection1() throws SQLException, SQLTimeoutException {
- assertNotNull(db.getConnection(username, password, dbUrl));
- }
- @Test
- void testConnection2() {
- assertNotNull(db.conn);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement