Search in sources :

Example 1 with Topics

use of uk.nhs.digital.common.forms.model.Topics in project hippo by NHS-digital-website.

the class SubscriberFactoryTest method should_create_subscriber_with_topics.

@Test
public void should_create_subscriber_with_topics() {
    final String emailAddress = "test@test.com";
    final List<String> topicCodes = Arrays.asList("code1", "code2");
    final Subscriber subscriber = SubscriberFactory.create(emailAddress, topicCodes);
    final Topics topics = subscriber.getTopics();
    assertNotNull(subscriber);
    assertNotNull(topics);
    assertNotNull(topics.getTopics());
    assertEquals(emailAddress, subscriber.getEmail());
    assertEquals(2, topics.getTopics().size());
    assertEquals("code1", topics.getTopics().get(0).getCode());
    assertEquals("code2", topics.getTopics().get(1).getCode());
}
Also used : Topics(uk.nhs.digital.common.forms.model.Topics) Subscriber(uk.nhs.digital.common.forms.model.Subscriber) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Subscriber (uk.nhs.digital.common.forms.model.Subscriber)1 Topics (uk.nhs.digital.common.forms.model.Topics)1