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 org.zkoss.lang.Strings;
import java.util.List;
@Log4j2
@SpringBootTest
@RunWith(SpringRunner.class)
-@ActiveProfiles("dev")
+@ActiveProfiles("test")
@ComponentScan("hu.user.lis")
-@TestPropertySource("classpath:application-dev.yaml")
+//@TestPropertySource("classpath:application-dev.yaml")
public class RecreateAssignProcessesIT {
@Autowired
private InvoiceImportRepository invoiceImportRepository;
public void recreateAllAssigns() throws InterruptedException {
List<InvoiceImport> invoiceImports = invoiceImportRepository.findAll();
invoiceImports.forEach(invoiceImport -> {
- String processInstanceId = workflowManagerService.startAssignIncomingInvoiceProcess(invoiceImport);
- log.info("Assign process created for invoice: {} -> {}", invoiceImport.getInvoice().getHumanId(), processInstanceId);
+ String processInstanceId = Strings.EMPTY;
+ processInstanceId = workflowManagerService.startAssignIncomingInvoiceProcess(invoiceImport);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
+ log.info("Assign process created for invoice: {} -> {}", invoiceImport.getInvoice().getHumanId(), processInstanceId);
});
}
}
\ No newline at end of file