@@ -0,0 +1,1773 @@
+/*%0A * Copyright 2010-2017 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.sambrannen.spring.events.service;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.jupiter.api.extension.ExtendWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.context.SpringBootTest;%0Aimport org.springframework.security.test.context.support.WithMockUser;%0Aimport org.springframework.test.context.junit.jupiter.SpringExtension;%0Aimport org.springframework.transaction.annotation.Transactional;%0A%0Aimport com.sambrannen.spring.events.domain.Event;%0Aimport com.sambrannen.spring.events.repository.EventRepository;%0A%0A/**%0A * Integration tests for the %7B@link EventService%7D.%0A *%0A * @author Sam Brannen%0A * @since 1.0%0A */%0A@ExtendWith(SpringExtension.class)%0A@SpringBootTest%0A@Transactional%0Aclass EventsServiceTests %7B%0A%0A%09@Autowired%0A%09EventService service;%0A%0A%09@Autowired%0A%09EventRepository repo;%0A%0A%0A%09@Test%0A%09@WithMockUser(roles = %22ADMIN%22)%0A%09void save() throws Exception %7B%0A%09%09service.save(new Event(%22new event%22, %22integration test%22));%0A%0A%09%09assertThat(repo.findAll().stream().filter(e -%3E e.getName().equals(%22new event%22)).findFirst()).isPresent();%0A%09%7D%0A%0A%7D%0A

Introduce integration tests for the EventService