use of BasicCommonClasses.ForgotPasswordData in project SmartCity-Market by TechnionYP5777.
the class SQLDatabaseConnectionTest method testCantSetSecurityQAToNotExistedCustomer.
@Test
public void testCantSetSecurityQAToNotExistedCustomer() {
SQLDatabaseConnection sqlConnection = new SQLDatabaseConnection();
ForgotPasswordData p = new ForgotPasswordData("question", "answer");
try {
sqlConnection.setSecurityQACustomer(customerName, p);
fail();
} catch (CriticalError e1) {
fail();
} catch (ClientNotExist e2) {
}
}
use of BasicCommonClasses.ForgotPasswordData in project SmartCity-Market by TechnionYP5777.
the class SQLDatabaseConnectionTest method testCantSetProfileToNotExistedCustomer.
@Test
public void testCantSetProfileToNotExistedCustomer() {
SQLDatabaseConnection sqlConnection = new SQLDatabaseConnection();
CustomerProfile p = new CustomerProfile(customerName, customerName, "name", "last", "number", "email", "city", "street", date112000, new HashSet<>(), new ForgotPasswordData("question", "answer"));
try {
sqlConnection.setCustomerProfile(customerName, p);
fail();
} catch (CriticalError | IngredientNotExist e1) {
fail();
} catch (ClientNotExist e2) {
}
}
use of BasicCommonClasses.ForgotPasswordData in project SmartCity-Market by TechnionYP5777.
the class SQLDatabaseConnectionTest method testCustomerCanSetSecurityQA.
@Test
public void testCustomerCanSetSecurityQA() {
SQLDatabaseConnection sqlConnection = new SQLDatabaseConnection();
ForgotPasswordData p = new ForgotPasswordData("question", "answer");
String result = null;
try {
sqlConnection.registerCustomer(customerName, customerName);
} catch (CriticalError | ClientAlreadyExist e) {
fail();
}
try {
sqlConnection.setSecurityQACustomer(customerName, p);
result = sqlConnection.getSecurityQuestionCustomer(customerName);
assertTrue(sqlConnection.verifySecurityAnswerCustomer(customerName, "answer"));
assertEquals("question", result);
} catch (CriticalError | ClientNotExist e1) {
fail();
} finally {
try {
sqlConnection.removeCustomer(customerName);
} catch (CriticalError | ClientNotExist e) {
e.printStackTrace();
}
}
}
use of BasicCommonClasses.ForgotPasswordData in project SmartCity-Market by TechnionYP5777.
the class SQLDatabaseConnectionTest method testCantSetSecurityQAToNotExistedWorker.
@Test
public void testCantSetSecurityQAToNotExistedWorker() {
SQLDatabaseConnection sqlConnection = new SQLDatabaseConnection();
ForgotPasswordData p = new ForgotPasswordData("question", "answer");
try {
sqlConnection.setSecurityQAWorker(workerName, p);
fail();
} catch (CriticalError e1) {
fail();
} catch (ClientNotExist e2) {
}
}
Aggregations