Hi all,
I have these integration tests functioning correctly but I need an auto-deploy solution that doesn’t require the @Deployment tag.
I have these lines in my application-dev.properties file:
flowable.process-definition-location-prefix=classpath*:/processes/ # The folder in which processes need to be searched for auto deployment.
flowable.process-definition-location-suffixes=**.bpmn20.xml,**.bpmn # The suffixes (extensions) of the files that needs to be deployed from the 'processDefinitionLocationPrefix' location.
This file is used in my integration test file:
@WebAppConfiguration
@AutoConfigureMockMvc
@ContextConfiguration(classes = IntegrationConfiguration.class)
@ActiveProfiles(resolver = ProfileResolver.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@ExtendWith(FlowableSpringExtension.class)
@ExtendWith(SpringExtension.class)
@TestMethodOrder(OrderAnnotation.class)
public class FlowableIntegrationSmokeTest extends FlowableIntegrationTestBase {
The ContextConfiguration class uses the application-dev.properties like so:
@Profile("dev")
@Configuration
@PropertySources({ @PropertySource("classpath:application-dev.properties")})
static class DevConfiguration implements TestConfiguration {
}
@Profile("qab")
@Configuration
@PropertySources({ @PropertySource("classpath:application-dev.properties")})
static class QabConfiguration implements TestConfiguration {
}
@SpringBootApplication(scanBasePackages = "com.pgi.flowzilla", exclude = {FlowzillaAutoConfiguration.class })
static class TestApplication {
public static void main(String[] args) {
SpringApplication.run(FlowzillaApplication.class, args);
}
}
My working example if you comment back in the @Deployment:
@Test
@Order(1)
//@Deployment(resources = { "processes/NewUser.bpmn20.xml",
// "processes/New_Company_setup.bpmn20.xml",
//"processes/UpdateUser.bpmn20.xml" })
void CompanySmokeProcessStart() throws Exception {
this.mockMvc = webAppContextSetup(this.wac).build();
List<ProcessDefinition> processDefinitions =
processEngine.getRepositoryService()
.createProcessDefinitionQuery()
.listPage(0, 5);
assertEquals(3, processDefinitions.size(),
"There should be three processes deployed");
LOG.info("Process Definition List size: " + processDefinitions.size());
for (ProcessDefinition processDefinition : processDefinitions) {
String deploymentId = processDefinition.getDeploymentId();
LOG.info("Deployment ID for definition: " + deploymentId);
}
String requestBody = loadCompanyData("smoke_test_data.json")
.replace("**COMPANY_NAME**", COMPANYNAMETOSEARCH.get())
.replace("**REQUESTED_URL_GM**", REQUESTED_URL_GM.get());
MvcResult result =
mockMvc.perform(post("/customers/ucaas").contentType("application/json")
.accept("application/json")
.content(requestBody)).andExpect(status().isOk()).andReturn();
System.out.println(result.getResponse().getContentAsString());
}
This test fails at the assertion that 3 processes should have been deployed but there are 0 present.
Any help on this would be appreciated