integrate Apache Camel into Spring Boot
This commit is contained in:
@@ -1,11 +1,30 @@
|
||||
package de.thpeetz.kontor;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@SpringBootTest
|
||||
import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
|
||||
import org.apache.camel.CamelContext;
|
||||
import org.apache.camel.builder.NotifyBuilder;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
|
||||
@CamelSpringBootTest
|
||||
@SpringBootTest(classes = Application.class)
|
||||
class ApplicationTests {
|
||||
@Autowired
|
||||
private CamelContext camelContext;
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void shouldProduceMessages() throws Exception {
|
||||
NotifyBuilder notify = new NotifyBuilder(camelContext).whenDone(1).create();
|
||||
assertTrue(notify.matches(10, TimeUnit.SECONDS));
|
||||
}
|
||||
@Test
|
||||
void contextLoads() {
|
||||
|
||||
|
||||
+4
-1
@@ -1,5 +1,6 @@
|
||||
package de.thpeetz.kontor.media.services;
|
||||
|
||||
import de.thpeetz.kontor.common.views.SearchFilter;
|
||||
import de.thpeetz.kontor.media.TestConstants;
|
||||
import de.thpeetz.kontor.media.data.MediaFile;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
@@ -40,7 +41,9 @@ public class MediaFileServiceTest {
|
||||
@Order(3)
|
||||
void testDeleteMediaFile() {
|
||||
int mediaFileCount = mediaFileService.findAllMediaFiles(null).size();
|
||||
List<MediaFile> mediaFileList = mediaFileService.findAllMediaFiles(TestConstants.URL);
|
||||
SearchFilter searchFilter = new SearchFilter();
|
||||
searchFilter.setSearchTerm(TestConstants.URL);
|
||||
List<MediaFile> mediaFileList = mediaFileService.findAllMediaFiles(searchFilter);
|
||||
assertEquals(1, mediaFileList.size());
|
||||
mediaFileService.deleteMediaFile(mediaFileList.get(0));
|
||||
assertEquals(--mediaFileCount, mediaFileService.findAllMediaFiles(null).size());
|
||||
|
||||
Reference in New Issue
Block a user