@Test
public void shouldCreateADefaultDataSource() throws Exception {

    when(jndiAppNameProvider.getAppName()).thenReturn("my-context-service");
    final EventSourceDefinition eventSourceDefinition = defaultEventSourceDefinitionFactory.createDefaultEventSource();
    assertThat(eventSourceDefinition.getName(), is("my-context-service-event-store"));
    assertThat(eventSourceDefinition.isDefault(), is(true));
    final Location location = eventSourceDefinition.getLocation();
    if (location.getDataSource().isPresent()) {
        assertThat(location.getDataSource().get(), is("java:/app/my-context-service/DS.eventstore"));
    } else {
        fail();
    }
    assertThat(location.getJmsUri(), is("JMS URI not used"));
    assertThat(location.getRestUri(), is(empty()));
}