@@ -0,0 +1,2036 @@
+package org.jboss.aerogear.unifiedpush.service;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Aimport java.util.Arrays;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Aimport javax.inject.Inject;%0A%0Aimport org.jboss.aerogear.unifiedpush.api.AndroidVariant;%0Aimport org.jboss.aerogear.unifiedpush.api.Category;%0Aimport org.jboss.aerogear.unifiedpush.api.PushApplication;%0Aimport org.jboss.aerogear.unifiedpush.dao.CategoryDao;%0Aimport org.junit.Test;%0A%0A%0Apublic class CategoryDeploymentServiceTest extends AbstractBaseServiceTest %7B%0A%0A%09@Inject%0A    private PushApplicationService applicationService;%0A%09%0A%09@Inject%0A%09private GenericVariantService variantService;%0A%09%0A%09@Inject%0A%09private CategoryDeploymentService deploymentService;%0A%09%0A%09@Inject%0A%09private CategoryDao categoryDao;%0A%09%0A%09private PushApplication application;%0A%09%0A%09@Override%0A%09protected void specificSetup() %7B%0A%09%09application = new PushApplication();%0A%09%09application.setName(%22my application%22);%0A%09%09%0A%09%09AndroidVariant androidVariant = new AndroidVariant();%0A%09%09androidVariant.setGoogleKey(%22Key%22);%0A        androidVariant.setName(%22Android%22);%0A        androidVariant.setDeveloper(%22me%22);%0A        %0A        variantService.addVariant(androidVariant);%0A        applicationService.addPushApplication(application);%0A%09%7D%0A%09%0A%09@Test%0A%09public void testDeployCategories() %7B%0A%09%09Map%3CString, List%3CString%3E%3E categoryData = new HashMap%3C%3E();%0A%09%09categoryData.put(%22cat1%22, Arrays.asList(%22a%22, %22b%22, %22c%22));%0A%09%09categoryData.put(%22cat2%22, Arrays.asList(%22b%22, %22c%22, %22d%22));%0A%09%09%0A%09%09deploymentService.deployCategories(application, categoryData);%0A%09%09%09%09%0A%09%09assertThat(categoryDao.findByPushApplicationID(application.getPushApplicationID())).%0A%09%09%09containsExactly(new Category(%22cat1%22), new Category(%22cat2%22));%0A%09%09%0A%09%09// check they are overwritten%0A%09%09categoryData.clear();%0A%09%09categoryData.put(%22cat3%22, Arrays.asList(%22a%22, %22b%22, %22c%22));%0A%09%09%0A%09%09deploymentService.deployCategories(application, categoryData);%0A%09%09%0A%09%09assertThat(categoryDao.findByPushApplicationID(application.getPushApplicationID())).%0A%09%09%09containsExactly(new Category(%22cat3%22));%0A%09%7D%0A%0A%7D%0A

Add unit test for deploy categories