Commit 9b47b5a3 authored by Martin Lowe's avatar Martin Lowe 🇨🇦 Committed by Martin Lowe
Browse files

Add more comments to code, make form working groups optional

parent 9db9f11e
......@@ -84,7 +84,7 @@ public class DefaultMailerService implements MailerService {
List<Contact> contacts) {
if (form == null) {
throw new IllegalStateException("A form is required to submit for mailing");
} else if (org == null || wgs == null || wgs.isEmpty() || contacts == null || contacts.isEmpty()) {
} else if (org == null || wgs == null || contacts == null || contacts.isEmpty()) {
throw new IllegalStateException(
"Could not find a fully complete form for form with ID '" + form.getId() + "'");
}
......
......@@ -102,6 +102,7 @@ class FormStateFilterTest {
Mockito.when(dao.getReference(ArgumentMatchers.eq(contact.getId()), ArgumentMatchers.eq(Contact.class)))
.thenReturn(contact);
// organization data mocks
org = DtoHelper.generateOrg(completed);
org.setId(UUID.randomUUID().toString());
Mockito.when(dao.get(ArgumentMatchers.argThat(new ArgumentMatcher<RDBMSQuery<FormOrganization>>() {
......@@ -113,6 +114,7 @@ class FormStateFilterTest {
Mockito.when(dao.getReference(ArgumentMatchers.eq(org.getId()), ArgumentMatchers.eq(FormOrganization.class)))
.thenReturn(org);
// form working group mock
wg = DtoHelper.generateWorkingGroup(completed);
wg.setId(UUID.randomUUID().toString());
Mockito.when(dao.get(ArgumentMatchers.argThat(new ArgumentMatcher<RDBMSQuery<FormWorkingGroup>>() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment