viadee / vPAV

viadee Process Application Validator

Home Page:https://www.viadee.de/java/process-application-validator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Integration instructions for getting-started spring-boot project

Charles-Irvine opened this issue · comments

Can you provide up-to-date instructions for integrating vPAV with a spring boot Camunda project created with the instructions provided at:

https://docs.camunda.org/get-started/spring-boot/

Very much appreciated.

-Charles

Hi @Charles-Irvine
I quickly set up a project based on your provided link and checked our documentation regarding completeness.
Nevertheless, I'll attach a quick rundown of what I've done:

  1. Download the zip and import proejct via e.g. IntelliJ
  2. Add Folders for src/test/java and src/test/resources
  3. Add vPAV & Spring Test Maven Dependency
  4. Create a test class in src/test/java e.g. ModelTest
  5. Create a configuration class in src/test/java e.g. SpringTestConfig
  6. Optional -> Provide custom configuration via ruleSet.xml and vpav.properties inside src/test/resources

Test Class

import de.viadee.bpm.vPAV.ProcessApplicationValidator;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import static org.junit.Assert.assertTrue;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SpringTestConfig.class })
public class ModelConsistencyTest {

    @Autowired
    private ApplicationContext ctx;

    @Test
    public void testModel() {
        assertTrue("Model inconsistency found. Please check target folder for validation output",
                ProcessApplicationValidator.findModelErrors(ctx).isEmpty());
    }

}

Configuration Class

import org.springframework.context.annotation.Configuration;

@Configuration
public class SpringTestConfig {

}

If you have any questions or feedback, feel free to reply or create a new issue.
Cheers, Sascha 👍

I have things working now. I was missing the configuration class. After adding that, things seem to be working. There is more that I need to understand, but hopefully I will be able to figure things out from here. Beautiful tool. Thanks!