readerDAO.createReader(null);
fail("NullPointerException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
Reader reader = addReader();
reader.setId(1l);
try {
readerDAO.createReader(reader);
fail("Wrong id, IllegalArgumentException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
reader.setId(new Long(-1));
try {
readerDAO.createReader(reader);
fail("Wrong id, IllegalArgumentException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
reader.setFirstName(null);
try {
readerDAO.createReader(reader);
fail("FirstName is null, NullPointerException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
reader.setFirstName("");
try {
readerDAO.createReader(reader);
fail("FirstName is empty, IllegalArgumentException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
reader.setSurname(null);
try {
readerDAO.createReader(reader);
fail("Surname is null, NullPointerException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
reader.setSurname("");
try {
readerDAO.createReader(reader);
fail("Surname is empty, IllegalArgumentException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
reader.setBirthNumber(null);
try {
readerDAO.createReader(reader);
fail("Birth number is null, NullPointerException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
reader.setBirthNumber("");
try {
readerDAO.createReader(reader);
fail("Birth number is empty, IllegalArgumentException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
reader.setAddress(null);
try {
readerDAO.createReader(reader);
fail("Address is null, NullPointerException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
reader.setAddress("");
try {
readerDAO.createReader(reader);
fail("Address is empty, IllegalArgumentException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
reader.setEmail(null);
try {
readerDAO.createReader(reader);
fail("Email is null, NullPointerException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK
}
reader.setEmail("");
try {
readerDAO.createReader(reader);
fail("Email is empty, IllegalArgumentException has not been thrown");
} catch (IllegalArgumentException ex) {
//OK