Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 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 TestDBsetup {
  10.   DatabaseSetup db;
  11.   String username, password, dbUrl;
  12.  
  13.   @BeforeEach
  14.   void setUp() throws Exception {
  15.     username = "pukdztdrlwizrd";
  16.     password = "9fcf6d1c0c337ebe8d481aa56f8657b23b0020d403150c76e22ba58763d31fd3";
  17.     dbUrl =
  18.         "jdbc:postgresql://ec2-54-217-214-201.eu-west-1.compute.amazonaws.com:5432/d8cvilvhht35us?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory";
  19.     DatabaseSetup db = new DatabaseSetup(username, password, dbUrl);
  20.   }
  21.  
  22.   @Test
  23.   void testConnection1() throws SQLException, SQLTimeoutException {
  24.     assertNotNull(db.getConnection(username, password, dbUrl));
  25.   }
  26.   @Test
  27.   void testConnection2() {
  28.     assertNotNull(db.conn);
  29.   }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement