// Path: test/org/sagebionetworks/bridge/TestConstants.java
// public class TestConstants {
//     
//     public static final String ENCRYPTED_HEALTH_CODE = "TFMkaVFKPD48WissX0bgcD3esBMEshxb3MVgKxHnkXLSEPN4FQMKc01tDbBAVcXx94kMX6ckXVYUZ8wx4iICl08uE+oQr9gorE1hlgAyLAM=";
// 
//     public static final String TEST_STUDY_IDENTIFIER = "api";
//     public static final StudyIdentifier TEST_STUDY = new StudyIdentifierImpl(TEST_STUDY_IDENTIFIER);
//     public static final CriteriaContext TEST_CONTEXT = new CriteriaContext.Builder()
//             .withUserId("user-id").withStudyIdentifier(TestConstants.TEST_STUDY).build();
// 
//     public static final String EMAIL = "email@email.com";
//     public static final String PASSWORD = "password";
// 
//     /**
//      * During tests, must sometimes pause because the underlying query uses a DynamoDB global 
//      * secondary index, and this does not currently support consistent reads.
//      */
//     public static final int GSI_WAIT_DURATION = 2000;
// 
//     public static final ConsentStatus REQUIRED_SIGNED_CURRENT = new ConsentStatus.Builder().withName("Name1")
//             .withGuid(SubpopulationGuid.create("foo1")).withRequired(true).withConsented(true)
//             .withSignedMostRecentConsent(true).build();
//     public static final ConsentStatus REQUIRED_UNSIGNED = new ConsentStatus.Builder().withName("Name1")
//             .withGuid(SubpopulationGuid.create("foo5")).withRequired(true).withConsented(false)
//             .withSignedMostRecentConsent(false).build();
// 
//     public static final Map<SubpopulationGuid, ConsentStatus> UNCONSENTED_STATUS_MAP = new ImmutableMap.Builder<SubpopulationGuid, ConsentStatus>()
//             .put(SubpopulationGuid.create(REQUIRED_UNSIGNED.getSubpopulationGuid()), REQUIRED_UNSIGNED).build();
//     
//     public static final Set<String> USER_DATA_GROUPS = ImmutableSet.of("group1","group2");
// 
//     public static final Set<String> USER_SUBSTUDY_IDS = ImmutableSet.of("substudyA","substudyB");
//     
//     public static final List<String> LANGUAGES = ImmutableList.of("en","fr");
//     
//     public static final Phone PHONE = new Phone("9712486796", "US");
//     
//     public static final AndroidAppLink ANDROID_APP_LINK = new AndroidAppLink("namespace", "package_name",
//             Lists.newArrayList("sha256_cert_fingerprints"));
//     public static final AndroidAppLink ANDROID_APP_LINK_2 = new AndroidAppLink("namespace2", "package_name2",
//             Lists.newArrayList("sha256_cert_fingerprints2"));
//     public static final AndroidAppLink ANDROID_APP_LINK_3 = new AndroidAppLink("namespace3", "package_name3",
//             Lists.newArrayList("sha256_cert_fingerprints3"));
//     public static final AndroidAppLink ANDROID_APP_LINK_4 = new AndroidAppLink("namespace4", "package_name4",
//             Lists.newArrayList("sha256_cert_fingerprints4"));
//     public static final AppleAppLink APPLE_APP_LINK = new AppleAppLink("studyId",
//             Lists.newArrayList("/appId/", "/appId/*"));
//     public static final AppleAppLink APPLE_APP_LINK_2 = new AppleAppLink("studyId2",
//             Lists.newArrayList("/appId2/", "/appId2/*"));
//     public static final AppleAppLink APPLE_APP_LINK_3 = new AppleAppLink("studyId3",
//             Lists.newArrayList("/appId3/", "/appId3/*"));
//     public static final AppleAppLink APPLE_APP_LINK_4 = new AppleAppLink("studyId4",
//             Lists.newArrayList("/appId4/", "/appId4/*"));
// 
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import java.util.List;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.ImmutableList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import play.mvc.Result;
import play.test.Helpers;
import org.sagebionetworks.bridge.Roles;
import org.sagebionetworks.bridge.TestConstants;
import org.sagebionetworks.bridge.TestUtils;
import org.sagebionetworks.bridge.json.BridgeObjectMapper;
import org.sagebionetworks.bridge.models.ResourceList;
import org.sagebionetworks.bridge.models.accounts.UserSession;
import org.sagebionetworks.bridge.models.schedules.CompoundActivityDefinition;
import org.sagebionetworks.bridge.services.CompoundActivityDefinitionService;
import org.sagebionetworks.bridge.services.StudyService;
package org.sagebionetworks.bridge.play.controllers;





public class CompoundActivityDefinitionControllerTest {
    private static final String TASK_ID = "test-task";

    private CompoundActivityDefinitionController controller;
    private CompoundActivityDefinitionService defService;
    private StudyService studyService;

    @Before
    public void setup() {
        // mock session
        UserSession mockSession = new UserSession();
// Path: test/org/sagebionetworks/bridge/TestConstants.java
// public class TestConstants {
//     
//     public static final String ENCRYPTED_HEALTH_CODE = "TFMkaVFKPD48WissX0bgcD3esBMEshxb3MVgKxHnkXLSEPN4FQMKc01tDbBAVcXx94kMX6ckXVYUZ8wx4iICl08uE+oQr9gorE1hlgAyLAM=";
// 
//     public static final String TEST_STUDY_IDENTIFIER = "api";
//     public static final StudyIdentifier TEST_STUDY = new StudyIdentifierImpl(TEST_STUDY_IDENTIFIER);
//     public static final CriteriaContext TEST_CONTEXT = new CriteriaContext.Builder()
//             .withUserId("user-id").withStudyIdentifier(TestConstants.TEST_STUDY).build();
// 
//     public static final String EMAIL = "email@email.com";
//     public static final String PASSWORD = "password";
// 
//     /**
//      * During tests, must sometimes pause because the underlying query uses a DynamoDB global 
//      * secondary index, and this does not currently support consistent reads.
//      */
//     public static final int GSI_WAIT_DURATION = 2000;
// 
//     public static final ConsentStatus REQUIRED_SIGNED_CURRENT = new ConsentStatus.Builder().withName("Name1")
//             .withGuid(SubpopulationGuid.create("foo1")).withRequired(true).withConsented(true)
//             .withSignedMostRecentConsent(true).build();
//     public static final ConsentStatus REQUIRED_UNSIGNED = new ConsentStatus.Builder().withName("Name1")
//             .withGuid(SubpopulationGuid.create("foo5")).withRequired(true).withConsented(false)
//             .withSignedMostRecentConsent(false).build();
// 
//     public static final Map<SubpopulationGuid, ConsentStatus> UNCONSENTED_STATUS_MAP = new ImmutableMap.Builder<SubpopulationGuid, ConsentStatus>()
//             .put(SubpopulationGuid.create(REQUIRED_UNSIGNED.getSubpopulationGuid()), REQUIRED_UNSIGNED).build();
//     
//     public static final Set<String> USER_DATA_GROUPS = ImmutableSet.of("group1","group2");
// 
//     public static final Set<String> USER_SUBSTUDY_IDS = ImmutableSet.of("substudyA","substudyB");
//     
//     public static final List<String> LANGUAGES = ImmutableList.of("en","fr");
//     
//     public static final Phone PHONE = new Phone("9712486796", "US");
//     
//     public static final AndroidAppLink ANDROID_APP_LINK = new AndroidAppLink("namespace", "package_name",
//             Lists.newArrayList("sha256_cert_fingerprints"));
//     public static final AndroidAppLink ANDROID_APP_LINK_2 = new AndroidAppLink("namespace2", "package_name2",
//             Lists.newArrayList("sha256_cert_fingerprints2"));
//     public static final AndroidAppLink ANDROID_APP_LINK_3 = new AndroidAppLink("namespace3", "package_name3",
//             Lists.newArrayList("sha256_cert_fingerprints3"));
//     public static final AndroidAppLink ANDROID_APP_LINK_4 = new AndroidAppLink("namespace4", "package_name4",
//             Lists.newArrayList("sha256_cert_fingerprints4"));
//     public static final AppleAppLink APPLE_APP_LINK = new AppleAppLink("studyId",
//             Lists.newArrayList("/appId/", "/appId/*"));
//     public static final AppleAppLink APPLE_APP_LINK_2 = new AppleAppLink("studyId2",
//             Lists.newArrayList("/appId2/", "/appId2/*"));
//     public static final AppleAppLink APPLE_APP_LINK_3 = new AppleAppLink("studyId3",
//             Lists.newArrayList("/appId3/", "/appId3/*"));
//     public static final AppleAppLink APPLE_APP_LINK_4 = new AppleAppLink("studyId4",
//             Lists.newArrayList("/appId4/", "/appId4/*"));
// 
// }


// Path: test/org/sagebionetworks/bridge/play/controllers/CompoundActivityDefinitionControllerTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import java.util.List;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.ImmutableList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import play.mvc.Result;
import play.test.Helpers;
import org.sagebionetworks.bridge.Roles;
import org.sagebionetworks.bridge.TestConstants;
import org.sagebionetworks.bridge.TestUtils;
import org.sagebionetworks.bridge.json.BridgeObjectMapper;
import org.sagebionetworks.bridge.models.ResourceList;
import org.sagebionetworks.bridge.models.accounts.UserSession;
import org.sagebionetworks.bridge.models.schedules.CompoundActivityDefinition;
import org.sagebionetworks.bridge.services.CompoundActivityDefinitionService;
import org.sagebionetworks.bridge.services.StudyService;

package org.sagebionetworks.bridge.play.controllers;





public class CompoundActivityDefinitionControllerTest {
    private static final String TASK_ID = "test-task";

    private CompoundActivityDefinitionController controller;
    private CompoundActivityDefinitionService defService;
    private StudyService studyService;

    @Before
    public void setup() {
        // mock session
        UserSession mockSession = new UserSession();
        mockSession.setStudyIdentifier(TestConstants.TEST_STUDY);