Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RunWith(Cucumber.class)
- @CucumberOptions(features = "/features",glue {""})
- @ContextConfiguration(classes = Init.class,
- initializers = ConfigFileApplicationContextInitializer.class)
- public class Test {
- }
- class feature {
- Scenario: Save test in db.
- When I inject a payload in the aws queue
- Then it should be integrated in database
- }
- @CucumberAbstract
- public class MyStepdefs {
- @Autowired
- private QueueMessagingTemplate queueMessagingTemplate;
- @Autowired
- MaterialRepository materialRepository;
- String message = "Hi";
- public MyStepdefs() {
- When("^I inject a payload in the aws queue$", () -> {
- this.queueMessagingTemplate.convertAndSend("QUEUE_NAME", message);
- });
- }
- @Then("^it should be integrated in database$")
- public void itShouldBeIntegratedInDatabase() throws Throwable {
- //validations
- }
- }
- @Target(ElementType.TYPE)
- @Retention(RetentionPolicy.RUNTIME)
- @ContextConfiguration(classes = Init.class, loader =
- SpringApplicationContextLoader.class)
- @SpringBootTest
- @RunWith(SpringJUnit4ClassRunner.class)
- public @interface CucumberAbstract {
- }
- @SpringBootTest
- public class MyStepdefs {
- ...
- }
Add Comment
Please, Sign In to add comment