@Test
public void whenGetByEventIdAndRegistrationIdValid() throws Exception {

    Event event = mock(Event.class);
    Registration registration = mock(Registration.class);
    when(registration.getEvent()).thenReturn(event);
    when(event.getId()).thenReturn(TestConstants.EVENT_ID);
    when(eventEntityService.getById(TestConstants.EVENT_ID)).thenReturn(event);
    when(registrationEntityService.getById(TestConstants.REGISTRATION_ID)).thenReturn(registration);
    Registration actual = eventRegistrationService.getByEventIdAndRegistrationId(
            TestConstants.EVENT_ID,
            TestConstants.REGISTRATION_ID
    );
    verify(eventEntityService).getById(TestConstants.EVENT_ID);
    verify(registrationEntityService).getById(TestConstants.REGISTRATION_ID);
    assertThat(actual).isSameAs(registration);
}