--- /dev/null
+package hu.user.lis.workflow;
+
+import hu.user.lis.workflow.invoice.service.IncomingInvoiceFetcherService;
+import lombok.extern.log4j.Log4j2;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.List;
+
+@Log4j2
+@SpringBootTest
+@RunWith(SpringRunner.class)
+@ActiveProfiles("dev")
+@ComponentScan("hu.user.lis")
+@TestPropertySource("classpath:application-dev.yaml")
+public class IncomingInvoiceFetcherServiceIT {
+
+ @Autowired
+ private IncomingInvoiceFetcherService incomingInvoiceFetcherService;
+
+ @Test
+ public void testProjectIdSearch() {
+ String invoiceXML = "bla bla 0123 2023-0002 xxx 34/12";
+ List<String> projectIdList = incomingInvoiceFetcherService.searchProjectId(invoiceXML);
+ Assert.assertEquals("2023-0002", projectIdList.get(0));
+ }
+
+ @Test
+
+ public void testMultipleProjectIdSearch() {
+ String invoiceXML = "bla bla 0123 2023-0002 xxx 34/12 2021-0003";
+ List<String> projectIdList = incomingInvoiceFetcherService.searchProjectId(invoiceXML);
+ Assert.assertEquals("2023-0002", projectIdList.get(0));
+ Assert.assertEquals("2021-0003", projectIdList.get(1));
+ }
+}