Search-876 After method to run always

This commit is contained in:
Meenal Bhave
2018-06-05 10:06:53 +01:00
parent 9687ae2ffb
commit 99d8b945c0
@@ -47,7 +47,7 @@ public class SearchSQLViaJDBCTest extends AbstractSearchTest
SearchSQLJDBC searchSql;
SearchSqlJDBCRequest sqlRequest = new SearchSqlJDBCRequest();
@AfterMethod
@AfterMethod(alwaysRun=true)
public void cleanUp() throws SQLException
{
restClient.withSearchSqlViaJDBC().clearSearchQuery(sqlRequest);
@@ -142,10 +142,12 @@ public class SearchSQLViaJDBCTest extends AbstractSearchTest
// Appropriate error is retrieved when SQL is incorrect
ResultSet rs = restClient.withSearchSqlViaJDBC().executeQueryViaJDBC(sqlRequest);
Assert.assertNull(rs);
String error = sqlRequest.getErrorDetails();
Assert.assertNotNull(error);
Assert.assertTrue(error.contains(expectedError), "Error shown: " + error + " Error expected: " + expectedError);
// Record set is null
Assert.assertNull(rs);
}
}