package com.apperian.api.applications;

import static org.junit.Assume.assumeTrue;

import java.util.List;

import com.apperian.api.ApiTesting;
import com.apperian.api.ApperianApi;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class ApplicationsTest {

    @Before
    public void beforeMethod() {
        // Skip tests if the properties file has not been configured.
        assumeTrue(ApiTesting.PROPERTIES_FILE_EXISTS);
    }

    @Test
    public void testListApps() throws Exception {
        ApperianApi apperianApi = ApiTesting.getApperianApi();

        List<Application> apps = apperianApi.listApplications();

        Assert.assertNotNull(apps);
    }

    @Test
    public void testEnableApp() throws Exception {
        ApperianApi apperianApi = ApiTesting.getApperianApi();
        Application app = apperianApi.updateApplication(ApiTesting.ANDROID_APP_ID, true);

        Assert.assertEquals(app.getId(), ApiTesting.ANDROID_APP_ID);
    }
}
@@ -981,10 +981,1151 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testApplyPolicies() throws Exception %7B%0A        ApperianApi apperianApi = ApiTesting.getApperianApi();%0A        Application application = apperianApi.getApplicationInfo(ApiTesting.ANDROID_APP_ID);%0A%0A        // Verify that the app you're testing has policies applied.%0A        Assert.assertTrue(application.hasPoliciesApplied());%0A%0A        // Verify that the app is a type that can apply policies%0A        Assert.assertTrue(application.canBeWrapped());%0A%0A        if (application.hasPoliciesApplied() && application.canBeWrapped()) %7B%0A            List%3CPolicyConfiguration%3E appliedPolicies =%0A                    apperianApi.getAppliedPolicies(application.getId()).getPolicyConfigurations();%0A%0A            // Verify that there are policies applied%0A            Assert.assertFalse(appliedPolicies.isEmpty());%0A%0A            // Verify that the apply policies response correctly contains configurations for the policies being applied.%0A            ApplyPoliciesResponse response = apperianApi.applyPolicies(application.getId(), appliedPolicies);%0A            Assert.assertFalse(response.getConfigurations().isEmpty());%0A        %7D%0A    %7D
 %0A%7D

Add a test for the get/apply policies endpoint