Guest User

Untitled

a guest
Jul 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. @RunWith(Cucumber.class)
  2. @CucumberOptions(features = "/features",glue {""})
  3. @ContextConfiguration(classes = Init.class,
  4. initializers = ConfigFileApplicationContextInitializer.class)
  5. public class Test {
  6. }
  7.  
  8. class feature {
  9. Scenario: Save test in db.
  10. When I inject a payload in the aws queue
  11. Then it should be integrated in database
  12. }
  13.  
  14. @CucumberAbstract
  15. public class MyStepdefs {
  16.  
  17. @Autowired
  18. private QueueMessagingTemplate queueMessagingTemplate;
  19.  
  20. @Autowired
  21. MaterialRepository materialRepository;
  22.  
  23. String message = "Hi";
  24.  
  25. public MyStepdefs() {
  26. When("^I inject a payload in the aws queue$", () -> {
  27. this.queueMessagingTemplate.convertAndSend("QUEUE_NAME", message);
  28. });
  29. }
  30.  
  31. @Then("^it should be integrated in database$")
  32. public void itShouldBeIntegratedInDatabase() throws Throwable {
  33. //validations
  34. }
  35. }
  36.  
  37. @Target(ElementType.TYPE)
  38. @Retention(RetentionPolicy.RUNTIME)
  39. @ContextConfiguration(classes = Init.class, loader =
  40. SpringApplicationContextLoader.class)
  41. @SpringBootTest
  42. @RunWith(SpringJUnit4ClassRunner.class)
  43. public @interface CucumberAbstract {
  44. }
  45.  
  46. @SpringBootTest
  47. public class MyStepdefs {
  48. ...
  49. }
Add Comment
Please, Sign In to add comment