Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. import static org.junit.Assert.assertEquals;
  2. import static org.junit.Assert.assertNotNull;
  3. import static org.junit.jupiter.api.Assertions.assertTrue;
  4. import org.junit.jupiter.api.BeforeEach;
  5. import org.junit.jupiter.api.Test;
  6. import java.sql.*;
  7. import java.io.*;
  8.  
  9. class TestDB {
  10.  
  11.   @BeforeEach
  12.   void setUp() throws Exception {
  13.   }
  14.  
  15.   @Test
  16.   void testConnection() throws SQLException, SQLTimeoutException {
  17.    
  18.     String user = "pukdztdrlwizrd";
  19.     String password = "9fcf6d1c0c337ebe8d481aa56f8657b23b0020d403150c76e22ba58763d31fd3";
  20.     String database =
  21.         "jdbc:postgresql://ec2-54-217-214-201.eu-west-1.compute.amazonaws.com:5432/d8cvilvhht35us?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory";
  22.     Connection connection = null;
  23.     connection = DriverManager.getConnection(user, password, database);
  24.     assertNotNull(connection);
  25.   }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement