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 TestDB {
- @BeforeEach
- void setUp() throws Exception {
- }
- @Test
- void testConnection() throws SQLException, SQLTimeoutException {
- String user = "pukdztdrlwizrd";
- String password = "9fcf6d1c0c337ebe8d481aa56f8657b23b0020d403150c76e22ba58763d31fd3";
- String database =
- "jdbc:postgresql://ec2-54-217-214-201.eu-west-1.compute.amazonaws.com:5432/d8cvilvhht35us?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory";
- Connection connection = null;
- connection = DriverManager.getConnection(user, password, database);
- assertNotNull(connection);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement