1 Reply Latest reply on Jul 28, 2015 9:53 AM by Matous Jobanek

    JavaArchive.class question. The custom Mapper logic through Orika. How to create right Deployment archive with Orika artifact?

    aLEX dAN Newbie


      I am using Arquillian framework for my tests. Now i have the problem when i want to test my Mapper classes. I can not add Orika to my jar file or i don't know how to do that properly. Please, help.


      I have the following createDeployment method in the AbstractMapperTest class:


          public static JavaArchive createDeployment() {
              return ShrinkWrap.create(JavaArchive.class, "test.jar")
                      .addPackages(true, "ma.glasnost")
                      .addPackages(true, "com.thoughtworks")
                      .addPackages(true, "com.googlecode")
                      .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");


      Maven dependency:

          <!-- Orika Mapper -->
           <!--Strange dependency that i need for deployment file creation-->


      And simple test:

      public class ActivityMapperTest extends AbstractMapperTest {
          private ActivityMapper activityMapper;
          public void getActivityMapper_existentActivityMapper_notNullMapperFactory() {
              Assert.assertThat(activityMapper, is(notNullValue()));
              Assert.assertThat(activityMapper.getMapperFactory(), is(notNullValue()));


      And this works fine.


      But for what reason i need to add this lines of the code in the deployment method and additional dependency for maven? Please, suggest how i can add Orika artifacts properly through maven.

      .addPackages(true, "ma.glasnost")
      .addPackages(true, "com.thoughtworks")
      .addPackages(true, "com.googlecode")