Git Product home page Git Product logo

camunda-bpm-junit5's Introduction

camunda-bpm-junit5's People

Contributors

actions-user avatar chaima-mnsr avatar dependabot[bot] avatar ingorichtsmeier avatar jangalinski avatar lwille avatar martinschimak avatar thorbenlindhauer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

camunda-bpm-junit5's Issues

JUnit5 testing for Spring Boot application and custom database schema

Hi,

I would like to know how to use JUnit5 testing library in combination with Spring Boot application (camunda-bpm-spring-boot-starter) and custom database schema. Do I need to create a 'camunda.cfg.xml' in '/test/resources'? And if so, how do I set the 'table-prefix' in this configuration?

Cheers,
Tobi

previously working integration test failing with Camunda exception

so…
trying to run a previously working integration test (a test that spins up spring boot and microservice) XYZServiceIntegrationTest…
has no bpm stuff.
but getting this:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.camunda.bpm.spring.boot.starter.property.CamundaBpmProperties' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1654) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1213) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1167) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593) ... 98 common frames omitted

Looking for a little insight into @BeforeAll

I'm attempting to follow best practices of only one assert per test method. So to save time, I want the class instantiated only once instead of what jUnit does (instantiate a new class for every method). I'm trying this, but getting an error that the process definition is not deployed.
Thoughts?

@TestInstance(Lifecycle.PER_CLASS)
@ExtendWith(ProcessEngineExtension.class)
class FirstTryTestCase {

	private ProcessInstance processInstance;
	
	@BeforeAll
	@Deployment(resources = {"Process1.bpmn"})
	void startUp() {
		processInstance = runtimeService().startProcessInstanceByKey("Process1", Variables.putValue("variable1", false));
	}
	
	@Test
	void deploymentActiveTest() {
		
		assertThat(processInstance).isActive();
	}

}

use correct builder pattern

the extension configuration should not be altered after the extension was created ... so I would vote against setters for config, resources, ...

You already provided a builder() method. Shouldn't this return a ProcessEngineExtensionBuilder then, that is used to configure and create the extension instance?

activate dependabot

This lib hasn't been updated for quite a while ... to keep it up to date, let's use dependabot to check for new dependency versions.

ProcessEngineExtension should inject ProcessEngine in Superclasses

ProcessEngineExtension::109 does not consider the class hierarchy for injection. That would be very nice in examples like the following:

@ExtendWith(ProcessEngineExtension.class)
public class ProcessEngineTestBase {
    protected ProcessEngine processEngine;

    @BeforeEach
    void setupBpmnAssert() {
        BpmnAwareTests.init(processEngine);
    }

    // some more convenience
}

public class MyTest extends ProcessEngineTestBase {
    @Test
    void test() {
           assertNotNull(processEngine); // NPE
}

Release 1.0.2

Hi @celanthe,

could you please push the button to bring this release to maven central?

Thank you, Ingo

ProcessEngineExtension should implement ProcessEngineServices

With the junit4 rule, I am used to get the service instances directly from the rule, because it implements the ProcessEngineServices interface.

I would like the extension to behave the same, so this

RuntimeService runtimeService = extension.getProcessEngine().getRuntimeService(); 

becomes:

RuntimeService runtimeService = extension.getRuntimeService(); 

Please provide an example on how to provide a custom configuration

Hey,
within our springboot process application we are defining the camunda configuration not in camunda.cfg.xml but in application.properties.

So when I run a test I end up with a file-not-found-exception because we do not provide a camunda.cfg.xml file.
I tried to set a custom processEngineExtension who uses new StandaloneInMemoryTestConfiguration(new ProcessEnginePlugin[0]) as configuration, but I still get the file not found exception.

So, could you provide an example on how to use this lib, if no camunda.cfg.xml is provided?

Thnx :)

Update assets, documentation and repository name

Hi Ingo,

This issue is being opened to let you know that your extension will need to be renamed here on GitHub via the 'Settings' option to reference Camunda Platform 7 rather than Camunda BPM. (For example: camunda-platform-7-junit5) This change will also likely impact any screenshots you have in the README that reference Camunda BPM, and this verbiage will likely need to also be updated throughout the repo's documentation as a whole. You can also make use of Shields.io badges to indicate which version of Camunda Platform your extension is compatible with.

While it is not a requirement that you rename your extension to align with Camunda Platform 7, we would greatly appreciate it if you could make these changes, and merge them anytime after April 12th, 2022.

if you have any questions or require any assistance, please do not hesitate to reach out to @camunda-community-hub/devrel! :)

How to contribute ?

Hi !

It would be wonderful to be able to run unit test with Camunda on JUnit 5 ! Would it be possible to contribute to this plugin ? Is there a roadmap or a plan to migrate from JUnit4 to Junit5 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.