Skip to content

Tests

To create you own tests you just need to extend the class AbstractTestContextAware.

Do not forget to put your classes in the package src/test/java/**.

Example:

import org.testng.Assert;
import org.testng.annotations.Test;

public class ProductServiceTest extends AbstractTestContextAware {
// -------------------------- OTHER METHODS --------------------------

    @Inject
    private ProductService productService;

    @Test
    public void testLoad() {
        Product product = productService.loadByIdentification("P0001");
        Assert.assertNotNull(product);
    }
}

Make sure that the custom root is allowed to run tests.

To run you just need to execute mvn package ceap:test-run.

Result:

Total tests run: 1, Failures: 0, Skips: 0

Test JS

Do not forget to put your classes in the package src/test/js/**.

If you don't have NodeJs installed please install

  • Open terminal
  • Run C:\ME\SandBoxes\meceap\node\npm run test

Result:

83 passing (138ms)