| 1 | 
    
            
    
     | 
    
           | 
  
            
  
    | 2 | 
    
            
    
     | 
    
           | 
  
            
  
    | 3 | 
    
            
    
     | 
    
           | 
  
            
  
    | 4 | 
    
            
    
     | 
    
           | 
  
            
  
    | 5 | 
    
            
    
     | 
    
           | 
  
            
  
    | 6 | 
    
            
    
     | 
    
           | 
  
            
  
    | 7 | 
    
            
    
     | 
    
           | 
  
            
  
    | 8 | 
    
            
    
     | 
    
           | 
  
            
  
    | 9 | 
    
            
    
     | 
    
           | 
  
            
  
    | 10 | 
    
            
    
     | 
    
           | 
  
            
  
    | 11 | 
    
            
    
     | 
    
           | 
  
            
  
    | 12 | 
    
            
    
     | 
    
           | 
  
            
  
    | 13 | 
    
            
    
     | 
    
           | 
  
            
  
    | 14 | 
    
            
    
     | 
    
           | 
  
            
  
    | 15 | 
    
            
    
     | 
    
           | 
  
            
  
    | 16 | 
    
            
    
     | 
    
      package org.kuali.student.lum.lo.service.impl;     | 
  
            
  
    | 17 | 
    
            
    
     | 
    
           | 
  
            
  
    | 18 | 
    
            
    
     | 
    
      import static org.junit.Assert.assertEquals;     | 
  
            
  
    | 19 | 
    
            
    
     | 
    
      import static org.junit.Assert.assertFalse;     | 
  
            
  
    | 20 | 
    
            
    
     | 
    
      import static org.junit.Assert.assertNotNull;     | 
  
            
  
    | 21 | 
    
            
    
     | 
    
      import static org.junit.Assert.assertTrue;     | 
  
            
  
    | 22 | 
    
            
    
     | 
    
      import static org.junit.Assert.fail;     | 
  
            
  
    | 23 | 
    
            
    
     | 
    
           | 
  
            
  
    | 24 | 
    
            
    
     | 
    
      import java.util.ArrayList;     | 
  
            
  
    | 25 | 
    
            
    
     | 
    
      import java.util.Arrays;     | 
  
            
  
    | 26 | 
    
            
    
     | 
    
      import java.util.Date;     | 
  
            
  
    | 27 | 
    
            
    
     | 
    
      import java.util.HashMap;     | 
  
            
  
    | 28 | 
    
            
    
     | 
    
      import java.util.List;     | 
  
            
  
    | 29 | 
    
            
    
     | 
    
      import java.util.Map;     | 
  
            
  
    | 30 | 
    
            
    
     | 
    
           | 
  
            
  
    | 31 | 
    
            
    
     | 
    
      import org.junit.Test;     | 
  
            
  
    | 32 | 
    
            
    
     | 
    
      import org.kuali.student.common.dto.DtoConstants;     | 
  
            
  
    | 33 | 
    
            
    
     | 
    
      import org.kuali.student.common.dto.RichTextInfo;     | 
  
            
  
    | 34 | 
    
            
    
     | 
    
      import org.kuali.student.common.dto.StatusInfo;     | 
  
            
  
    | 35 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.AlreadyExistsException;     | 
  
            
  
    | 36 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.CircularReferenceException;     | 
  
            
  
    | 37 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.CircularRelationshipException;     | 
  
            
  
    | 38 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.DataValidationErrorException;     | 
  
            
  
    | 39 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.DependentObjectsExistException;     | 
  
            
  
    | 40 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.DoesNotExistException;     | 
  
            
  
    | 41 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.InvalidParameterException;     | 
  
            
  
    | 42 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.MissingParameterException;     | 
  
            
  
    | 43 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.OperationFailedException;     | 
  
            
  
    | 44 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.PermissionDeniedException;     | 
  
            
  
    | 45 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.UnsupportedActionException;     | 
  
            
  
    | 46 | 
    
            
    
     | 
    
      import org.kuali.student.common.exceptions.VersionMismatchException;     | 
  
            
  
    | 47 | 
    
            
    
     | 
    
      import org.kuali.student.common.search.dto.SearchParam;     | 
  
            
  
    | 48 | 
    
            
    
     | 
    
      import org.kuali.student.common.search.dto.SearchRequest;     | 
  
            
  
    | 49 | 
    
            
    
     | 
    
      import org.kuali.student.common.search.dto.SearchResult;     | 
  
            
  
    | 50 | 
    
            
    
     | 
    
      import org.kuali.student.common.search.dto.SearchResultCell;     | 
  
            
  
    | 51 | 
    
            
    
     | 
    
      import org.kuali.student.common.test.spring.AbstractServiceTest;     | 
  
            
  
    | 52 | 
    
            
    
     | 
    
      import org.kuali.student.common.test.spring.Client;     | 
  
            
  
    | 53 | 
    
            
    
     | 
    
      import org.kuali.student.common.test.spring.Dao;     | 
  
            
  
    | 54 | 
    
            
    
     | 
    
      import org.kuali.student.common.test.spring.Daos;     | 
  
            
  
    | 55 | 
    
            
    
     | 
    
      import org.kuali.student.common.test.spring.PersistenceFileLocation;     | 
  
            
  
    | 56 | 
    
            
    
     | 
    
      import org.kuali.student.lum.lo.dto.LoCategoryInfo;     | 
  
            
  
    | 57 | 
    
            
    
     | 
    
      import org.kuali.student.lum.lo.dto.LoCategoryTypeInfo;     | 
  
            
  
    | 58 | 
    
            
    
     | 
    
      import org.kuali.student.lum.lo.dto.LoInfo;     | 
  
            
  
    | 59 | 
    
            
    
     | 
    
      import org.kuali.student.lum.lo.dto.LoLoRelationInfo;     | 
  
            
  
    | 60 | 
    
            
    
     | 
    
      import org.kuali.student.lum.lo.dto.LoLoRelationTypeInfo;     | 
  
            
  
    | 61 | 
    
            
    
     | 
    
      import org.kuali.student.lum.lo.dto.LoRepositoryInfo;     | 
  
            
  
    | 62 | 
    
            
    
     | 
    
      import org.kuali.student.lum.lo.dto.LoTypeInfo;     | 
  
            
  
    | 63 | 
    
            
    
     | 
    
      import org.kuali.student.lum.lo.service.LearningObjectiveService;     | 
  
            
  
    | 64 | 
    
            
    
     | 
    
           | 
  
            
  
    | 65 | 
    
            
    
     | 
    
      @Daos({@Dao(value = "org.kuali.student.lum.lo.dao.impl.LoDaoImpl", testSqlFile = "classpath:ks-lo.sql")})     | 
  
            
  
    | 66 | 
    
            
    
     | 
    
      @PersistenceFileLocation("classpath:META-INF/lo-persistence.xml")     | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 88.5% | 
           Uncovered Elements: 50 (435) | 
           Complexity: 63 | 
           Complexity Density: 0.15 | 
                        
            
        | 
    
  
  
    | 67 | 
    
            
    
     | 
    
      public class TestLearningObjectiveServiceImpl extends AbstractServiceTest {     | 
  
            
  
    | 68 | 
    
            
    
     | 
    
          @Client(value = "org.kuali.student.lum.lo.service.impl.LearningObjectiveServiceImpl", additionalContextFile = "classpath:lo-additional-context.xml")     | 
  
            
  
    | 69 | 
    
            
    
     | 
    
          public LearningObjectiveService client;     | 
  
            
  
    | 70 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 90.1% | 
           Uncovered Elements: 8 (81) | 
           Complexity: 9 | 
           Complexity Density: 0.11 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 71 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 72 | 
    
            
    
     | 
    
          public void testLo() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, DataValidationErrorException, PermissionDeniedException, VersionMismatchException, DependentObjectsExistException, AlreadyExistsException, CircularRelationshipException {     | 
  
            
  
    | 73 | 
    
           1
    
     | 
    
              LoInfo loInfo = new LoInfo();     | 
  
            
  
    | 74 | 
    
           1
    
     | 
    
              loInfo.setName("How Lo Can You Go");     | 
  
            
  
    | 75 | 
    
           1
    
     | 
    
              RichTextInfo richText = new RichTextInfo();     | 
  
            
  
    | 76 | 
    
           1
    
     | 
    
              richText.setFormatted("<p>New ResultComponent</p>");     | 
  
            
  
    | 77 | 
    
           1
    
     | 
    
              richText.setPlain("New ResultComponent");     | 
  
            
  
    | 78 | 
    
           1
    
     | 
    
              loInfo.setDesc(richText);     | 
  
            
  
    | 79 | 
    
           1
    
     | 
    
              Date date = new Date();     | 
  
            
  
    | 80 | 
    
           1
    
     | 
    
              loInfo.setEffectiveDate(date);     | 
  
            
  
    | 81 | 
    
           1
    
     | 
    
              loInfo.setExpirationDate(date);     | 
  
            
  
    | 82 | 
    
           1
    
     | 
    
              loInfo.setLoRepositoryKey("kuali.loRepository.key.singleUse");     | 
  
            
  
    | 83 | 
    
           1
    
     | 
    
              Map<String, String> attributes = new HashMap<String, String>();     | 
  
            
  
    | 84 | 
    
           1
    
     | 
    
              attributes.put("attrKey", "attrValue");     | 
  
            
  
    | 85 | 
    
           1
    
     | 
    
              loInfo.setAttributes(attributes);     | 
  
            
  
    | 86 | 
    
           1
    
     | 
    
              loInfo.setType("kuali.lo.type.singleUse");     | 
  
            
  
    | 87 | 
    
           1
    
     | 
    
              loInfo.setState(DtoConstants.STATE_DRAFT);     | 
  
            
  
    | 88 | 
    
            
    
     | 
    
           | 
  
            
  
    | 89 | 
    
           1
    
     | 
    
              LoInfo created = client.createLo("kuali.loRepository.key.singleUse", "kuali.lo.type.singleUse", loInfo);      | 
  
            
  
    | 90 | 
    
           1
    
     | 
    
              assertNotNull(created);     | 
  
            
  
    | 91 | 
    
           1
    
     | 
    
              String loId = created.getId();     | 
  
            
  
    | 92 | 
    
           1
    
     | 
    
              assertNotNull(loId);     | 
  
            
  
    | 93 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 94 | 
    
           1
    
     | 
    
              created = client.getLo(loId);     | 
  
            
  
    | 95 | 
    
            
    
     | 
    
           | 
  
            
  
    | 96 | 
    
           1
    
     | 
    
              RichTextInfo desc = created.getDesc();     | 
  
            
  
    | 97 | 
    
           1
    
     | 
    
              assertNotNull(desc);     | 
  
            
  
    | 98 | 
    
           1
    
     | 
    
              assertEquals("<p>New ResultComponent</p>", desc.getFormatted());     | 
  
            
  
    | 99 | 
    
           1
    
     | 
    
              assertEquals("New ResultComponent", desc.getPlain());     | 
  
            
  
    | 100 | 
    
           1
    
     | 
    
              assertEquals(date.toString(), created.getEffectiveDate().toString());     | 
  
            
  
    | 101 | 
    
           1
    
     | 
    
              assertEquals(date.toString(), created.getExpirationDate().toString());     | 
  
            
  
    | 102 | 
    
           1
    
     | 
    
              Map<String, String> newAttributes = created.getAttributes();     | 
  
            
  
    | 103 | 
    
           1
    
     | 
    
              assertNotNull(newAttributes);     | 
  
            
  
    | 104 | 
    
           1
    
     | 
    
              assertEquals("attrValue", newAttributes.get("attrKey"));     | 
  
            
  
    | 105 | 
    
           1
    
     | 
    
              assertEquals("kuali.lo.type.singleUse", created.getType());      | 
  
            
  
    | 106 | 
    
           1
    
     | 
    
              assertEquals(DtoConstants.STATE_DRAFT, created.getState());     | 
  
            
  
    | 107 | 
    
            
    
     | 
    
           | 
  
            
  
    | 108 | 
    
           1
    
     | 
    
              loInfo = client.getLo(loId);     | 
  
            
  
    | 109 | 
    
           1
    
     | 
    
              loInfo.setName("Lo in the mid 30s");     | 
  
            
  
    | 110 | 
    
            
    
     | 
    
           | 
  
            
  
    | 111 | 
    
           1
    
     | 
    
              LoInfo updated = client.updateLo(loId, loInfo);     | 
  
            
  
    | 112 | 
    
           1
    
     | 
    
              assertNotNull(updated);     | 
  
            
  
    | 113 | 
    
           1
    
     | 
    
              assertEquals(loId, updated.getId());     | 
  
            
  
    | 114 | 
    
           1
    
     | 
    
              desc = updated.getDesc();     | 
  
            
  
    | 115 | 
    
           1
    
     | 
    
              assertNotNull(desc);     | 
  
            
  
    | 116 | 
    
           1
    
     | 
    
              assertEquals("<p>New ResultComponent</p>", desc.getFormatted());     | 
  
            
  
    | 117 | 
    
           1
    
     | 
    
              assertEquals("New ResultComponent", desc.getPlain());     | 
  
            
  
    | 118 | 
    
           1
    
     | 
    
              assertEquals(date.toString(), updated.getEffectiveDate().toString());     | 
  
            
  
    | 119 | 
    
           1
    
     | 
    
              assertEquals(date.toString(), updated.getExpirationDate().toString());     | 
  
            
  
    | 120 | 
    
           1
    
     | 
    
              newAttributes = updated.getAttributes();     | 
  
            
  
    | 121 | 
    
           1
    
     | 
    
              assertNotNull(newAttributes);     | 
  
            
  
    | 122 | 
    
           1
    
     | 
    
              assertEquals("attrValue", newAttributes.get("attrKey"));     | 
  
            
  
    | 123 | 
    
           1
    
     | 
    
              assertEquals("kuali.lo.type.singleUse", updated.getType());      | 
  
            
  
    | 124 | 
    
           1
    
     | 
    
              assertEquals(DtoConstants.STATE_DRAFT, updated.getState());     | 
  
            
  
    | 125 | 
    
            
    
     | 
    
           | 
  
            
  
    | 126 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 127 | 
    
           1
    
     | 
    
                  client.updateLo(loId, loInfo);     | 
  
            
  
    | 128 | 
    
           0
    
     | 
    
                  fail("VersionMismatchException expected");     | 
  
            
  
    | 129 | 
    
            
    
     | 
    
              } catch (VersionMismatchException e) {}     | 
  
            
  
    | 130 | 
    
            
    
     | 
    
           | 
  
            
  
    | 131 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 132 | 
    
           1
    
     | 
    
              loInfo = new LoInfo();     | 
  
            
  
    | 133 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 134 | 
    
           1
    
     | 
    
                  client.createLo(null, "kuali.lo.type.singleUse", loInfo);     | 
  
            
  
    | 135 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loRepositoryId");     | 
  
            
  
    | 136 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 137 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 138 | 
    
           1
    
     | 
    
                  client.createLo("kuali.loRepository.key.singleUse", null, loInfo);     | 
  
            
  
    | 139 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loTypeId");     | 
  
            
  
    | 140 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 141 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 142 | 
    
           1
    
     | 
    
                  client.createLo("kuali.loRepository.key.singleUse", "kuali.lo.type.singleUse", null);     | 
  
            
  
    | 143 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loInfo");     | 
  
            
  
    | 144 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 145 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 146 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 147 | 
    
           1
    
     | 
    
                  client.getLo(null);     | 
  
            
  
    | 148 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loId");     | 
  
            
  
    | 149 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 150 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 151 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 152 | 
    
           1
    
     | 
    
                  client.updateLo(null, loInfo);     | 
  
            
  
    | 153 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loId");     | 
  
            
  
    | 154 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 155 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 156 | 
    
           1
    
     | 
    
                  client.updateLo(loId, null);     | 
  
            
  
    | 157 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loInfo");     | 
  
            
  
    | 158 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 159 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 160 | 
    
           1
    
     | 
    
              StatusInfo statusInfo = client.deleteLo(loId);     | 
  
            
  
    | 161 | 
    
           1
    
     | 
    
              assertTrue(statusInfo.getSuccess());     | 
  
            
  
    | 162 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 163 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 164 | 
    
           1
    
     | 
    
              LoLoRelationInfo llrInfo = new LoLoRelationInfo();     | 
  
            
  
    | 165 | 
    
           1
    
     | 
    
              llrInfo.setLoId ("7bcd7c0e-3e6b-4527-ac55-254c58cecc22");     | 
  
            
  
    | 166 | 
    
           1
    
     | 
    
           llrInfo.setRelatedLoId ("91a91860-d796-4a17-976b-a6165b1a0b05");     | 
  
            
  
    | 167 | 
    
           1
    
     | 
    
           llrInfo.setType ("kuali.lo.relation.type.includes");     | 
  
            
  
    | 168 | 
    
           1
    
     | 
    
              llrInfo = client.createLoLoRelation(llrInfo.getLoId (), llrInfo.getRelatedLoId (), llrInfo.getType (), llrInfo);     | 
  
            
  
    | 169 | 
    
           1
    
     | 
    
              assertNotNull(llrInfo);     | 
  
            
  
    | 170 | 
    
           1
    
     | 
    
              llrInfo = client.getLoLoRelation(llrInfo.getId());     | 
  
            
  
    | 171 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 172 | 
    
           1
    
     | 
    
                  client.deleteLo("7bcd7c0e-3e6b-4527-ac55-254c58cecc22");     | 
  
            
  
    | 173 | 
    
           0
    
     | 
    
                  fail("Deleted an LO which orphaned included LO(s)");     | 
  
            
  
    | 174 | 
    
            
    
     | 
    
              } catch (DependentObjectsExistException doee) {}     | 
  
            
  
    | 175 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 176 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (2) | 
           Complexity: 1 | 
           Complexity Density: 0.5 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 177 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 178 | 
    
            
    
     | 
    
          public void testGetLoByIdList() throws DoesNotExistException, InvalidParameterException, OperationFailedException, MissingParameterException {     | 
  
            
  
    | 179 | 
    
           1
    
     | 
    
              List<LoInfo> loInfos = client.getLoByIdList(Arrays.asList("81abea67-3bcc-4088-8348-e265f3670145",     | 
  
            
  
    | 180 | 
    
            
    
     | 
    
                                                                          "dd0658d2-fdc9-48fa-9578-67a2ce53bf8a",     | 
  
            
  
    | 181 | 
    
            
    
     | 
    
                                                                          "91a91860-d796-4a17-976b-a6165b1a0b05"));     | 
  
            
  
    | 182 | 
    
           1
    
     | 
    
              assertEquals(3, loInfos.size());     | 
  
            
  
    | 183 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 184 | 
    
            
    
     | 
    
               | 
  
            
  
    | 185 | 
    
            
    
     | 
    
               | 
  
            
  
    | 186 | 
    
            
    
     | 
    
           | 
  
            
  
    | 187 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 85.7% | 
           Uncovered Elements: 3 (21) | 
           Complexity: 2 | 
           Complexity Density: 0.1 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 188 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 189 | 
    
            
    
     | 
    
          public void testDisallowLoCategoryDuplication() throws DoesNotExistException, DataValidationErrorException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DependentObjectsExistException {     | 
  
            
  
    | 190 | 
    
           1
    
     | 
    
              String catName = "DontDupThisCategory";     | 
  
            
  
    | 191 | 
    
           1
    
     | 
    
              String catState = "active";     | 
  
            
  
    | 192 | 
    
           1
    
     | 
    
              String catType = "loCategoryType.accreditation";     | 
  
            
  
    | 193 | 
    
           1
    
     | 
    
              String catRepo = "kuali.loRepository.key.singleUse";     | 
  
            
  
    | 194 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 195 | 
    
           1
    
     | 
    
              LoCategoryInfo newCatInfo = new LoCategoryInfo();     | 
  
            
  
    | 196 | 
    
           1
    
     | 
    
              newCatInfo.setName(catName);     | 
  
            
  
    | 197 | 
    
           1
    
     | 
    
              newCatInfo.setType(catType);     | 
  
            
  
    | 198 | 
    
           1
    
     | 
    
              newCatInfo.setState(catState);     | 
  
            
  
    | 199 | 
    
           1
    
     | 
    
              newCatInfo.setLoRepository(catRepo);     | 
  
            
  
    | 200 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 201 | 
    
           1
    
     | 
    
              newCatInfo = client.createLoCategory(catRepo, catType, newCatInfo);     | 
  
            
  
    | 202 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 203 | 
    
           1
    
     | 
    
              LoCategoryInfo dupCatInfo = new LoCategoryInfo();     | 
  
            
  
    | 204 | 
    
           1
    
     | 
    
              dupCatInfo.setName(catName);     | 
  
            
  
    | 205 | 
    
           1
    
     | 
    
              dupCatInfo.setType(catType);     | 
  
            
  
    | 206 | 
    
           1
    
     | 
    
              dupCatInfo.setState(catState);     | 
  
            
  
    | 207 | 
    
           1
    
     | 
    
              dupCatInfo.setLoRepository(catRepo);     | 
  
            
  
    | 208 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 209 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 210 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 211 | 
    
           1
    
     | 
    
                  dupCatInfo = client.createLoCategory(catRepo, catType, dupCatInfo);     | 
  
            
  
    | 212 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 213 | 
    
           0
    
     | 
    
                  client.deleteLoCategory(newCatInfo.getId());     | 
  
            
  
    | 214 | 
    
           0
    
     | 
    
                  client.deleteLoCategory(dupCatInfo.getId());     | 
  
            
  
    | 215 | 
    
           0
    
     | 
    
                  fail("DataValidationErrorException expected when creating LoCategory with the same name, type and state");     | 
  
            
  
    | 216 | 
    
            
    
     | 
    
              } catch (DataValidationErrorException e) {     | 
  
            
  
    | 217 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 218 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 219 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 220 | 
    
           1
    
     | 
    
              client.deleteLoCategory(newCatInfo.getId());     | 
  
            
  
    | 221 | 
    
            
    
     | 
    
          }         | 
  
            
  
    | 222 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 81% | 
           Uncovered Elements: 4 (21) | 
           Complexity: 2 | 
           Complexity Density: 0.1 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 223 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 224 | 
    
            
    
     | 
    
          public void testDisallowLoWEmptyDesc() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, DataValidationErrorException, PermissionDeniedException, VersionMismatchException, DependentObjectsExistException, AlreadyExistsException, CircularRelationshipException {     | 
  
            
  
    | 225 | 
    
           1
    
     | 
    
              LoInfo loInfo = new LoInfo();     | 
  
            
  
    | 226 | 
    
           1
    
     | 
    
              loInfo.setName("Lo with Empty Desc");     | 
  
            
  
    | 227 | 
    
           1
    
     | 
    
              RichTextInfo richText = new RichTextInfo();     | 
  
            
  
    | 228 | 
    
           1
    
     | 
    
              richText.setFormatted("<p> </p>");     | 
  
            
  
    | 229 | 
    
           1
    
     | 
    
              richText.setPlain(" ");     | 
  
            
  
    | 230 | 
    
           1
    
     | 
    
              loInfo.setDesc(richText);     | 
  
            
  
    | 231 | 
    
           1
    
     | 
    
              Date date = new Date();     | 
  
            
  
    | 232 | 
    
           1
    
     | 
    
              loInfo.setEffectiveDate(date);     | 
  
            
  
    | 233 | 
    
           1
    
     | 
    
              loInfo.setExpirationDate(date);     | 
  
            
  
    | 234 | 
    
           1
    
     | 
    
              loInfo.setLoRepositoryKey("kuali.loRepository.key.singleUse");     | 
  
            
  
    | 235 | 
    
           1
    
     | 
    
              Map<String, String> attributes = new HashMap<String, String>();     | 
  
            
  
    | 236 | 
    
           1
    
     | 
    
              attributes.put("attrKey", "attrValue");     | 
  
            
  
    | 237 | 
    
           1
    
     | 
    
              loInfo.setAttributes(attributes);     | 
  
            
  
    | 238 | 
    
           1
    
     | 
    
              loInfo.setType("kuali.lo.type.singleUse");     | 
  
            
  
    | 239 | 
    
           1
    
     | 
    
              loInfo.setState(DtoConstants.STATE_DRAFT);     | 
  
            
  
    | 240 | 
    
            
    
     | 
    
           | 
  
            
  
    | 241 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 242 | 
    
           1
    
     | 
    
                   LoInfo created = client.createLo(loInfo.getLoRepositoryKey (), loInfo.getType (), loInfo);     | 
  
            
  
    | 243 | 
    
           0
    
     | 
    
                   assertNotNull(created);     | 
  
            
  
    | 244 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 245 | 
    
            
    
     | 
    
                     | 
  
            
  
    | 246 | 
    
           0
    
     | 
    
                   StatusInfo statusInfo = client.deleteLo(created.getId());     | 
  
            
  
    | 247 | 
    
           0
    
     | 
    
                   assertTrue(statusInfo.getSuccess());                 | 
  
            
  
    | 248 | 
    
           0
    
     | 
    
                   fail("OperationFailedException expected when creating Lo with empty description");     | 
  
            
  
    | 249 | 
    
            
    
     | 
    
              } catch (DataValidationErrorException mpe) {     | 
  
            
  
    | 250 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 251 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 252 | 
    
            
    
     | 
    
            }     | 
  
            
  
    | 253 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 76.5% | 
           Uncovered Elements: 4 (17) | 
           Complexity: 2 | 
           Complexity Density: 0.12 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 254 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 255 | 
    
            
    
     | 
    
          public void testDisallowLoCategoryWEmptyName() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, DataValidationErrorException, PermissionDeniedException, VersionMismatchException, DependentObjectsExistException, AlreadyExistsException, CircularRelationshipException {     | 
  
            
  
    | 256 | 
    
            
    
     | 
    
           | 
  
            
  
    | 257 | 
    
           1
    
     | 
    
              String catState = "active";     | 
  
            
  
    | 258 | 
    
           1
    
     | 
    
              String catType = "loCategoryType.accreditation";     | 
  
            
  
    | 259 | 
    
           1
    
     | 
    
              String catRepo = "kuali.loRepository.key.singleUse";     | 
  
            
  
    | 260 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 261 | 
    
           1
    
     | 
    
              LoCategoryInfo newCatInfo = new LoCategoryInfo();     | 
  
            
  
    | 262 | 
    
            
    
     | 
    
           | 
  
            
  
    | 263 | 
    
           1
    
     | 
    
              newCatInfo.setType(catType);     | 
  
            
  
    | 264 | 
    
           1
    
     | 
    
              newCatInfo.setState(catState);     | 
  
            
  
    | 265 | 
    
           1
    
     | 
    
              newCatInfo.setLoRepository(catRepo);     | 
  
            
  
    | 266 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 267 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 268 | 
    
            
    
     | 
    
             | 
  
            
  
    | 269 | 
    
           1
    
     | 
    
                RichTextInfo richText = new RichTextInfo();     | 
  
            
  
    | 270 | 
    
           1
    
     | 
    
                richText.setFormatted("<p> </p>");     | 
  
            
  
    | 271 | 
    
           1
    
     | 
    
                richText.setPlain("  ");     | 
  
            
  
    | 272 | 
    
           1
    
     | 
    
                newCatInfo.setDesc(richText);     | 
  
            
  
    | 273 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 274 | 
    
           1
    
     | 
    
              try{     | 
  
            
  
    | 275 | 
    
           1
    
     | 
    
                      newCatInfo = client.createLoCategory(catRepo, catType, newCatInfo);     | 
  
            
  
    | 276 | 
    
           0
    
     | 
    
                      assertNotNull(newCatInfo);     | 
  
            
  
    | 277 | 
    
            
    
     | 
    
                           | 
  
            
  
    | 278 | 
    
            
    
     | 
    
                         | 
  
            
  
    | 279 | 
    
           0
    
     | 
    
                       StatusInfo statusInfo = client.deleteLoCategory(newCatInfo.getId());     | 
  
            
  
    | 280 | 
    
           0
    
     | 
    
                       assertTrue(statusInfo.getSuccess());                 | 
  
            
  
    | 281 | 
    
           0
    
     | 
    
                       fail("OperationFailedException expected when creating LoCategory with empty description");     | 
  
            
  
    | 282 | 
    
            
    
     | 
    
              } catch (DataValidationErrorException mpe) {     | 
  
            
  
    | 283 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 284 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 285 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 286 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 287 | 
    
            
    
     | 
    
                  | 
  
            
  
    | 288 | 
    
            
    
     | 
    
               | 
  
            
  
    | 289 | 
    
            
    
     | 
    
           | 
  
            
  
    | 290 | 
    
            
    
     | 
    
           | 
  
            
  
    | 291 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 76.7% | 
           Uncovered Elements: 7 (30) | 
           Complexity: 4 | 
           Complexity Density: 0.13 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 292 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 293 | 
    
            
    
     | 
    
          public void testDisallowLoCategoryDuplicationCaseInsensitive() throws DoesNotExistException, DataValidationErrorException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DependentObjectsExistException {     | 
  
            
  
    | 294 | 
    
           1
    
     | 
    
              String catName = "DontDupThisCategory";     | 
  
            
  
    | 295 | 
    
           1
    
     | 
    
              String catState = "active";     | 
  
            
  
    | 296 | 
    
           1
    
     | 
    
              String catType = "loCategoryType.accreditation";     | 
  
            
  
    | 297 | 
    
           1
    
     | 
    
              String catRepo = "kuali.loRepository.key.singleUse";     | 
  
            
  
    | 298 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 299 | 
    
           1
    
     | 
    
              LoCategoryInfo newCatInfo = new LoCategoryInfo();     | 
  
            
  
    | 300 | 
    
           1
    
     | 
    
              newCatInfo.setName(catName);     | 
  
            
  
    | 301 | 
    
           1
    
     | 
    
              newCatInfo.setType(catType);     | 
  
            
  
    | 302 | 
    
           1
    
     | 
    
              newCatInfo.setState(catState);     | 
  
            
  
    | 303 | 
    
           1
    
     | 
    
              newCatInfo.setLoRepository(catRepo);     | 
  
            
  
    | 304 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 305 | 
    
           1
    
     | 
    
              try{                     | 
  
            
  
    | 306 | 
    
           1
    
     | 
    
                  newCatInfo = client.createLoCategory(catRepo, catType, newCatInfo);     | 
  
            
  
    | 307 | 
    
           1
    
     | 
    
                  newCatInfo = client.getLoCategory(newCatInfo.getId());     | 
  
            
  
    | 308 | 
    
           1
    
     | 
    
                  newCatInfo.getName();     | 
  
            
  
    | 309 | 
    
           1
    
     | 
    
                  catRepo = newCatInfo.getLoRepository();     | 
  
            
  
    | 310 | 
    
            
    
     | 
    
              } catch (OperationFailedException ofe) {     | 
  
            
  
    | 311 | 
    
           0
    
     | 
    
                  System.err.println(ofe.getMessage());     | 
  
            
  
    | 312 | 
    
            
    
     | 
    
              } catch (Exception e){     | 
  
            
  
    | 313 | 
    
           0
    
     | 
    
                  System.err.println(e.getMessage());     | 
  
            
  
    | 314 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 315 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 316 | 
    
           1
    
     | 
    
              String dupCatName = "dontDupThisCategory";     | 
  
            
  
    | 317 | 
    
           1
    
     | 
    
              LoCategoryInfo dupCatInfo = new LoCategoryInfo();     | 
  
            
  
    | 318 | 
    
           1
    
     | 
    
              dupCatInfo.setName(dupCatName);     | 
  
            
  
    | 319 | 
    
           1
    
     | 
    
              dupCatInfo.setType(catType);     | 
  
            
  
    | 320 | 
    
           1
    
     | 
    
              dupCatInfo.setState(catState);     | 
  
            
  
    | 321 | 
    
           1
    
     | 
    
              dupCatInfo.setLoRepository(catRepo);     | 
  
            
  
    | 322 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 323 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 324 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 325 | 
    
           1
    
     | 
    
                  dupCatInfo = client.createLoCategory(catRepo, catType, dupCatInfo);     | 
  
            
  
    | 326 | 
    
           0
    
     | 
    
                  dupCatInfo = client.getLoCategory(dupCatInfo.getId());     | 
  
            
  
    | 327 | 
    
           0
    
     | 
    
                  dupCatName = dupCatInfo.getName();     | 
  
            
  
    | 328 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 329 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 330 | 
    
           0
    
     | 
    
                  client.deleteLoCategory(newCatInfo.getId());     | 
  
            
  
    | 331 | 
    
           0
    
     | 
    
                  client.deleteLoCategory(dupCatInfo.getId());     | 
  
            
  
    | 332 | 
    
           0
    
     | 
    
                  fail("DataValidationErrorException expected when creating LoCategory with the same name, type and state");     | 
  
            
  
    | 333 | 
    
            
    
     | 
    
              } catch (DataValidationErrorException e) {     | 
  
            
  
    | 334 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 335 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 336 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 337 | 
    
           1
    
     | 
    
              client.deleteLoCategory(newCatInfo.getId());     | 
  
            
  
    | 338 | 
    
            
    
     | 
    
          }         | 
  
            
  
    | 339 | 
    
            
    
     | 
    
           | 
  
            
  
    | 340 | 
    
            
    
     | 
    
               | 
  
            
  
    | 341 | 
    
            
    
     | 
    
           | 
  
            
  
    | 342 | 
    
            
    
     | 
    
           | 
  
            
  
    | 343 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 89.3% | 
           Uncovered Elements: 3 (28) | 
           Complexity: 5 | 
           Complexity Density: 0.18 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 344 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 345 | 
    
            
    
     | 
    
          public void testUpdateLoCategoryDuplicationCaseInsensitive() throws DoesNotExistException, DataValidationErrorException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DependentObjectsExistException {     | 
  
            
  
    | 346 | 
    
           1
    
     | 
    
              String catState = "active";     | 
  
            
  
    | 347 | 
    
           1
    
     | 
    
              String catType = "loCategoryType.accreditation";     | 
  
            
  
    | 348 | 
    
           1
    
     | 
    
              String catRepo = "kuali.loRepository.key.singleUse";     | 
  
            
  
    | 349 | 
    
           1
    
     | 
    
              String catId1 = null;     | 
  
            
  
    | 350 | 
    
           1
    
     | 
    
              String catId2 = null;     | 
  
            
  
    | 351 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 352 | 
    
           1
    
     | 
    
              LoCategoryInfo catInfo1 = new LoCategoryInfo();     | 
  
            
  
    | 353 | 
    
           1
    
     | 
    
              catInfo1.setName( "DontDupThisCategory");     | 
  
            
  
    | 354 | 
    
           1
    
     | 
    
              catInfo1.setType(catType);     | 
  
            
  
    | 355 | 
    
           1
    
     | 
    
              catInfo1.setState(catState);     | 
  
            
  
    | 356 | 
    
           1
    
     | 
    
              catInfo1.setLoRepository(catRepo);     | 
  
            
  
    | 357 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 358 | 
    
           1
    
     | 
    
              LoCategoryInfo catInfo2 = new LoCategoryInfo();     | 
  
            
  
    | 359 | 
    
           1
    
     | 
    
              catInfo2.setName("DontDupThisCategory2");     | 
  
            
  
    | 360 | 
    
           1
    
     | 
    
              catInfo2.setType(catType);     | 
  
            
  
    | 361 | 
    
           1
    
     | 
    
              catInfo2.setState(catState);     | 
  
            
  
    | 362 | 
    
           1
    
     | 
    
              catInfo2.setLoRepository(catRepo);     | 
  
            
  
    | 363 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 364 | 
    
           1
    
     | 
    
              try{                     | 
  
            
  
    | 365 | 
    
           1
    
     | 
    
                  catInfo1 = client.createLoCategory(catRepo, catType, catInfo1);     | 
  
            
  
    | 366 | 
    
           1
    
     | 
    
                  catId1 = catInfo1.getId();     | 
  
            
  
    | 367 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 368 | 
    
           1
    
     | 
    
                  catInfo2 = client.createLoCategory(catRepo, catType, catInfo2);     | 
  
            
  
    | 369 | 
    
           1
    
     | 
    
                  catId2 = catInfo2.getId();     | 
  
            
  
    | 370 | 
    
            
    
     | 
    
              } catch (OperationFailedException ofe) {     | 
  
            
  
    | 371 | 
    
           0
    
     | 
    
                  System.err.println(ofe.getMessage());     | 
  
            
  
    | 372 | 
    
            
    
     | 
    
              } catch (Exception e){     | 
  
            
  
    | 373 | 
    
           0
    
     | 
    
                  System.err.println(e.getMessage());     | 
  
            
  
    | 374 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 375 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 376 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 377 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 378 | 
    
           1
    
     | 
    
                  catInfo2.setName( "dontDupThisCategory");     | 
  
            
  
    | 379 | 
    
           1
    
     | 
    
                  client.updateLoCategory(catId2, catInfo2);     | 
  
            
  
    | 380 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 381 | 
    
            
    
     | 
    
               | 
  
            
  
    | 382 | 
    
           0
    
     | 
    
                  fail("DataValidationErrorException expected when updating LoCategory with the same name, type and state");     | 
  
            
  
    | 383 | 
    
            
    
     | 
    
              } catch (DataValidationErrorException e) {     | 
  
            
  
    | 384 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 385 | 
    
            
    
     | 
    
              }catch (VersionMismatchException e){     | 
  
            
  
    | 386 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 387 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 388 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 389 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 390 | 
    
           1
    
     | 
    
              client.deleteLoCategory(catId1);     | 
  
            
  
    | 391 | 
    
           1
    
     | 
    
              client.deleteLoCategory(catId2);     | 
  
            
  
    | 392 | 
    
            
    
     | 
    
          }         | 
  
            
  
    | 393 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 76.9% | 
           Uncovered Elements: 3 (13) | 
           Complexity: 4 | 
           Complexity Density: 0.31 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 394 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 395 | 
    
            
    
     | 
    
          public void testGetRelatedLosByLoId() throws DoesNotExistException, InvalidParameterException, OperationFailedException {     | 
  
            
  
    | 396 | 
    
           1
    
     | 
    
              List<LoInfo> relatedLos = null;     | 
  
            
  
    | 397 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 398 | 
    
           1
    
     | 
    
                  relatedLos = client.getRelatedLosByLoId("81abea67-3bcc-4088-8348-e265f3670145", "kuali.lo.relation.type.includes");     | 
  
            
  
    | 399 | 
    
            
    
     | 
    
              } catch (Exception e) {     | 
  
            
  
    | 400 | 
    
           0
    
     | 
    
                  fail("Exception caught when calling LearningObjectiveService.getRelatedLosByLoId(): " + e.getMessage());     | 
  
            
  
    | 401 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 402 | 
    
           1
    
     | 
    
              assertNotNull(relatedLos);     | 
  
            
  
    | 403 | 
    
           1
    
     | 
    
              assertEquals(2, relatedLos.size());     | 
  
            
  
    | 404 | 
    
           1
    
     | 
    
              assertTrue(relatedLos.get(0).getId().equals("e0b456b2-62cb-4bd3-8867-a0d59fd8f2cf") || relatedLos.get(1).getId().equals("e0b456b2-62cb-4bd3-8867-a0d59fd8f2cf"));     | 
  
            
  
    | 405 | 
    
            
    
     | 
    
           | 
  
            
  
    | 406 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 407 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 408 | 
    
           1
    
     | 
    
                  relatedLos = client.getRelatedLosByLoId(null, "kuali.lo.relation.type.includes");     | 
  
            
  
    | 409 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loId");     | 
  
            
  
    | 410 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 411 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 412 | 
    
           1
    
     | 
    
                  relatedLos = client.getRelatedLosByLoId("81abea67-3bcc-4088-8348-e265f3670145", null);     | 
  
            
  
    | 413 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loLoRelationTypeKey");     | 
  
            
  
    | 414 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 415 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 416 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 82.4% | 
           Uncovered Elements: 3 (17) | 
           Complexity: 4 | 
           Complexity Density: 0.31 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 417 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 418 | 
    
            
    
     | 
    
          public void testGetLoRepositories() throws DoesNotExistException, InvalidParameterException, OperationFailedException {     | 
  
            
  
    | 419 | 
    
           1
    
     | 
    
              List<LoRepositoryInfo> repos = null;     | 
  
            
  
    | 420 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 421 | 
    
           1
    
     | 
    
                  repos = client.getLoRepositories();     | 
  
            
  
    | 422 | 
    
            
    
     | 
    
              } catch (Exception e) {     | 
  
            
  
    | 423 | 
    
           0
    
     | 
    
                  fail("Exception caught when calling LearningObjectiveService.getLoRepositories(): " + e.getMessage());     | 
  
            
  
    | 424 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 425 | 
    
           1
    
     | 
    
              assertNotNull(repos);     | 
  
            
  
    | 426 | 
    
           1
    
     | 
    
              assertEquals(3, repos.size());     | 
  
            
  
    | 427 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 428 | 
    
           1
    
     | 
    
              boolean found = false;     | 
  
            
  
    | 429 | 
    
           1
    
     | 
    
              String  repoId = "kuali.loRepository.key.state";     | 
  
            
  
    | 430 | 
    
           1
    
     | 
    
              for (LoRepositoryInfo loRInfo : repos) {     | 
  
            
  
    | 431 | 
    
           3
    
     | 
    
                  if (loRInfo.getId().equals(repoId)) {     | 
  
            
  
    | 432 | 
    
           1
    
     | 
    
                      found = true;     | 
  
            
  
    | 433 | 
    
            
    
     | 
    
                  }     | 
  
            
  
    | 434 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 435 | 
    
           1
    
     | 
    
              if (!found) {     | 
  
            
  
    | 436 | 
    
           0
    
     | 
    
                  fail("Unable to find expected LoRepository with ID == " + repoId);     | 
  
            
  
    | 437 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 438 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 439 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 77.8% | 
           Uncovered Elements: 2 (9) | 
           Complexity: 3 | 
           Complexity Density: 0.33 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 440 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 441 | 
    
            
    
     | 
    
          public void testGetLoRepository() throws DoesNotExistException, InvalidParameterException, OperationFailedException {     | 
  
            
  
    | 442 | 
    
           1
    
     | 
    
              LoRepositoryInfo repo = null;     | 
  
            
  
    | 443 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 444 | 
    
           1
    
     | 
    
                  repo = client.getLoRepository("kuali.loRepository.key.state");     | 
  
            
  
    | 445 | 
    
            
    
     | 
    
              } catch (Exception e) {     | 
  
            
  
    | 446 | 
    
           0
    
     | 
    
                  fail("Exception caught when calling LearningObjectiveService.getLoRepository(): " + e.getMessage());     | 
  
            
  
    | 447 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 448 | 
    
           1
    
     | 
    
              assertNotNull(repo);     | 
  
            
  
    | 449 | 
    
           1
    
     | 
    
              assertEquals("Learning objectives mandated by the state", repo.getDesc().getPlain());     | 
  
            
  
    | 450 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 451 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 452 | 
    
           1
    
     | 
    
                  client.getLoRepository(null);     | 
  
            
  
    | 453 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loRepositoryKey");     | 
  
            
  
    | 454 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 455 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 456 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (2) | 
           Complexity: 1 | 
           Complexity Density: 0.5 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 457 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 458 | 
    
            
    
     | 
    
          public void testGetLoCategoryTypes() throws DoesNotExistException, InvalidParameterException, OperationFailedException {     | 
  
            
  
    | 459 | 
    
           1
    
     | 
    
              List<LoCategoryTypeInfo> loCatTypeInfos = client.getLoCategoryTypes();     | 
  
            
  
    | 460 | 
    
           1
    
     | 
    
              assertEquals(3, loCatTypeInfos.size());     | 
  
            
  
    | 461 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 462 | 
    
            
    
     | 
    
                   | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 90% | 
           Uncovered Elements: 1 (10) | 
           Complexity: 2 | 
           Complexity Density: 0.2 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 463 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 464 | 
    
            
    
     | 
    
          public void testGetLoTypesAndGetLoType() throws OperationFailedException, DoesNotExistException, InvalidParameterException, MissingParameterException {     | 
  
            
  
    | 465 | 
    
           1
    
     | 
    
              List<LoTypeInfo> loTypes = client.getLoTypes();     | 
  
            
  
    | 466 | 
    
           1
    
     | 
    
              assertNotNull(loTypes);     | 
  
            
  
    | 467 | 
    
           1
    
     | 
    
              assertTrue(!loTypes.isEmpty());     | 
  
            
  
    | 468 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 469 | 
    
           1
    
     | 
    
              LoTypeInfo loType = client.getLoType(loTypes.get(0).getId());     | 
  
            
  
    | 470 | 
    
           1
    
     | 
    
              assertEquals(loTypes.get(0).getName(), loType.getName());     | 
  
            
  
    | 471 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 472 | 
    
           1
    
     | 
    
              loType = client.getLoType("kuali.lo.type.governed");     | 
  
            
  
    | 473 | 
    
           1
    
     | 
    
              assertEquals("Governed", loType.getName());     | 
  
            
  
    | 474 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 475 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 476 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 477 | 
    
           1
    
     | 
    
                  client.getLoType(null);     | 
  
            
  
    | 478 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loTypeKey");     | 
  
            
  
    | 479 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 480 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 481 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 85.7% | 
           Uncovered Elements: 1 (7) | 
           Complexity: 2 | 
           Complexity Density: 0.29 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 482 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 483 | 
    
            
    
     | 
    
          public void testGetLoLoRelationTypes()  {     | 
  
            
  
    | 484 | 
    
           1
    
     | 
    
              List<LoLoRelationTypeInfo> llrtInfos = null;     | 
  
            
  
    | 485 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 486 | 
    
           1
    
     | 
    
                  llrtInfos = client.getLoLoRelationTypes();     | 
  
            
  
    | 487 | 
    
            
    
     | 
    
              } catch (Exception e) {     | 
  
            
  
    | 488 | 
    
           0
    
     | 
    
                  fail("Exception caught when calling LearningObjectiveService.getLoLoRelationTypes(): " + e.getMessage());     | 
  
            
  
    | 489 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 490 | 
    
           1
    
     | 
    
              assertNotNull(llrtInfos);     | 
  
            
  
    | 491 | 
    
           1
    
     | 
    
              assertEquals(2, llrtInfos.size());     | 
  
            
  
    | 492 | 
    
           1
    
     | 
    
              assertTrue(llrtInfos.get(0).getName().equals("inSupportOf") || llrtInfos.get(1).getName().equals("inSupportOf"));     | 
  
            
  
    | 493 | 
    
            
    
     | 
    
                           | 
  
            
  
    | 494 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 495 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 77.8% | 
           Uncovered Elements: 2 (9) | 
           Complexity: 3 | 
           Complexity Density: 0.33 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 496 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 497 | 
    
            
    
     | 
    
          public void testGetLoLoRelationType() throws OperationFailedException, DoesNotExistException  {     | 
  
            
  
    | 498 | 
    
           1
    
     | 
    
              LoLoRelationTypeInfo llrtInfo = null;     | 
  
            
  
    | 499 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 500 | 
    
           1
    
     | 
    
                  llrtInfo = client.getLoLoRelationType("kuali.lo.relation.type.includes");     | 
  
            
  
    | 501 | 
    
            
    
     | 
    
              } catch (Exception e) {     | 
  
            
  
    | 502 | 
    
           0
    
     | 
    
                  fail("Exception caught when calling LearningObjectiveService.getLoLoRelationType(): " + e.getMessage());     | 
  
            
  
    | 503 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 504 | 
    
           1
    
     | 
    
              assertNotNull(llrtInfo);     | 
  
            
  
    | 505 | 
    
           1
    
     | 
    
              assertEquals("includes", llrtInfo.getName());     | 
  
            
  
    | 506 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 507 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 508 | 
    
           1
    
     | 
    
                  client.getLoLoRelationType(null);     | 
  
            
  
    | 509 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loLoRelationTypeKey");     | 
  
            
  
    | 510 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 511 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 512 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (4) | 
           Complexity: 1 | 
           Complexity Density: 0.25 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 513 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 514 | 
    
            
    
     | 
    
          public void testGetAllowedLoLoRelationTypesForLoType() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {     | 
  
            
  
    | 515 | 
    
           1
    
     | 
    
              List<String> allowedTypes = client.getAllowedLoLoRelationTypesForLoType("kuali.lo.type.singleUse", "kuali.lo.type.singleUse");     | 
  
            
  
    | 516 | 
    
           1
    
     | 
    
              assertEquals(1, allowedTypes.size());     | 
  
            
  
    | 517 | 
    
           1
    
     | 
    
              allowedTypes = client.getAllowedLoLoRelationTypesForLoType("kuali.lo.type.governed", "kuali.lo.type.governed");     | 
  
            
  
    | 518 | 
    
           1
    
     | 
    
              assertTrue(null == allowedTypes || allowedTypes.size() == 0);     | 
  
            
  
    | 519 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 520 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 83.3% | 
           Uncovered Elements: 2 (12) | 
           Complexity: 3 | 
           Complexity Density: 0.25 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 521 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 522 | 
    
            
    
     | 
    
          public void testGetLoLoRelation() throws OperationFailedException, DoesNotExistException, InvalidParameterException  {     | 
  
            
  
    | 523 | 
    
           1
    
     | 
    
              LoLoRelationInfo llrInfo = null;     | 
  
            
  
    | 524 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 525 | 
    
           1
    
     | 
    
                  llrInfo = client.getLoLoRelation("61ff5b2c-5d2f-464b-b6d8-082fbf671fcb");     | 
  
            
  
    | 526 | 
    
            
    
     | 
    
              } catch (Exception e) {     | 
  
            
  
    | 527 | 
    
           0
    
     | 
    
                  fail("Exception caught when calling LearningObjectiveService.getLoLoRelation(): " + e.getMessage());     | 
  
            
  
    | 528 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 529 | 
    
           1
    
     | 
    
              assertNotNull(llrInfo);     | 
  
            
  
    | 530 | 
    
           1
    
     | 
    
              assertEquals("81abea67-3bcc-4088-8348-e265f3670145", llrInfo.getLoId());     | 
  
            
  
    | 531 | 
    
           1
    
     | 
    
              assertEquals("dd0658d2-fdc9-48fa-9578-67a2ce53bf8a", llrInfo.getRelatedLoId());     | 
  
            
  
    | 532 | 
    
           1
    
     | 
    
              assertEquals("kuali.lo.relation.type.includes", llrInfo.getType());     | 
  
            
  
    | 533 | 
    
           1
    
     | 
    
              assertEquals(DtoConstants.STATE_DRAFT, llrInfo.getState());     | 
  
            
  
    | 534 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 535 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 536 | 
    
           1
    
     | 
    
                  client.getLoLoRelation(null);     | 
  
            
  
    | 537 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loLoRelationId");     | 
  
            
  
    | 538 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 539 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 540 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (4) | 
           Complexity: 1 | 
           Complexity Density: 0.25 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 541 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 542 | 
    
            
    
     | 
    
          public void testGetLoCategories() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {     | 
  
            
  
    | 543 | 
    
           1
    
     | 
    
              List<LoCategoryInfo> categories = client.getLoCategories("kuali.loRepository.key.singleUse");     | 
  
            
  
    | 544 | 
    
           1
    
     | 
    
              assertEquals(5, categories.size());     | 
  
            
  
    | 545 | 
    
           1
    
     | 
    
              categories = client.getLoCategories("kuali.loRepository.key.state");     | 
  
            
  
    | 546 | 
    
           1
    
     | 
    
              assertTrue(null == categories || categories.size() == 0);     | 
  
            
  
    | 547 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 548 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (8) | 
           Complexity: 1 | 
           Complexity Density: 0.12 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 549 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 550 | 
    
            
    
     | 
    
          public void testGetLoCategoriesForLo() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {     | 
  
            
  
    | 551 | 
    
           1
    
     | 
    
              List<LoCategoryInfo> categories = client.getLoCategoriesForLo("dd0658d2-fdc9-48fa-9578-67a2ce53bf8a");     | 
  
            
  
    | 552 | 
    
           1
    
     | 
    
              assertNotNull(categories);     | 
  
            
  
    | 553 | 
    
           1
    
     | 
    
              assertEquals(2, categories.size());     | 
  
            
  
    | 554 | 
    
           1
    
     | 
    
              categories = client.getLoCategoriesForLo("e0619a90-66d6-4af4-b357-e73ae44f7e88");     | 
  
            
  
    | 555 | 
    
           1
    
     | 
    
              assertEquals(1, categories.size());     | 
  
            
  
    | 556 | 
    
           1
    
     | 
    
              assertEquals("Test Category 3", categories.get(0).getName());     | 
  
            
  
    | 557 | 
    
           1
    
     | 
    
              categories = client.getLoCategoriesForLo("e0b456b2-62cb-4bd3-8867-a0d59fd8f2cf");     | 
  
            
  
    | 558 | 
    
           1
    
     | 
    
              assertTrue(null == categories || categories.size() == 0);     | 
  
            
  
    | 559 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 560 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (10) | 
           Complexity: 1 | 
           Complexity Density: 0.1 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 561 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 562 | 
    
            
    
     | 
    
          public void testAddRemoveLoCategoryToFromLo() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, AlreadyExistsException, PermissionDeniedException, UnsupportedActionException {     | 
  
            
  
    | 563 | 
    
           1
    
     | 
    
              List<LoCategoryInfo> categories = client.getLoCategoriesForLo("dd0658d2-fdc9-48fa-9578-67a2ce53bf8a");     | 
  
            
  
    | 564 | 
    
           1
    
     | 
    
              assertEquals(2, categories.size());     | 
  
            
  
    | 565 | 
    
           1
    
     | 
    
              assertTrue(containsLoCatInfo(categories, Arrays.asList("550e8400-e29b-41d4-a716-446655440000", "7114d2a4-f66d-4d3a-9d41-a7aa4299c797")));     | 
  
            
  
    | 566 | 
    
           1
    
     | 
    
              client.addLoCategoryToLo("f2f02922-4e77-4144-aa07-8c2c956370dc", "dd0658d2-fdc9-48fa-9578-67a2ce53bf8a");     | 
  
            
  
    | 567 | 
    
           1
    
     | 
    
              categories = client.getLoCategoriesForLo("dd0658d2-fdc9-48fa-9578-67a2ce53bf8a");     | 
  
            
  
    | 568 | 
    
           1
    
     | 
    
              assertEquals(3, categories.size());     | 
  
            
  
    | 569 | 
    
           1
    
     | 
    
              assertTrue(containsLoCatInfo(categories, Arrays.asList("550e8400-e29b-41d4-a716-446655440000", "7114d2a4-f66d-4d3a-9d41-a7aa4299c797", "f2f02922-4e77-4144-aa07-8c2c956370dc")));     | 
  
            
  
    | 570 | 
    
           1
    
     | 
    
              client.removeLoCategoryFromLo("f2f02922-4e77-4144-aa07-8c2c956370dc", "dd0658d2-fdc9-48fa-9578-67a2ce53bf8a");     | 
  
            
  
    | 571 | 
    
           1
    
     | 
    
              categories = client.getLoCategoriesForLo("dd0658d2-fdc9-48fa-9578-67a2ce53bf8a");     | 
  
            
  
    | 572 | 
    
           1
    
     | 
    
              assertEquals(2, categories.size());     | 
  
            
  
    | 573 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 574 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (4) | 
           Complexity: 1 | 
           Complexity Density: 0.25 | 
                        
            
        | 
    
  
  
    | 575 | 
    
           2
    
     | 
    
           private boolean containsLoCatInfo(List<LoCategoryInfo> categories, List<String> idList) {...     | 
  
            
  
    | 576 | 
    
           2
    
     | 
    
              List<String> ids = new ArrayList<String>();     | 
  
            
  
    | 577 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 578 | 
    
           2
    
     | 
    
              for (LoCategoryInfo info : categories) {     | 
  
            
  
    | 579 | 
    
           5
    
     | 
    
                  ids.add(info.getId());     | 
  
            
  
    | 580 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 581 | 
    
           2
    
     | 
    
              return ids.containsAll(idList);     | 
  
            
  
    | 582 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 583 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 80% | 
           Uncovered Elements: 5 (25) | 
           Complexity: 6 | 
           Complexity Density: 0.24 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 584 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 585 | 
    
            
    
     | 
    
          public void testCreateLoLoRelation() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, AlreadyExistsException, CircularReferenceException, DataValidationErrorException, PermissionDeniedException, CircularRelationshipException {     | 
  
            
  
    | 586 | 
    
           1
    
     | 
    
              LoLoRelationInfo llrInfo = new LoLoRelationInfo();     | 
  
            
  
    | 587 | 
    
           1
    
     | 
    
              llrInfo.setLoId ("7bcd7c0e-3e6b-4527-ac55-254c58cecc22");     | 
  
            
  
    | 588 | 
    
           1
    
     | 
    
           llrInfo.setRelatedLoId ("91a91860-d796-4a17-976b-a6165b1a0b05");     | 
  
            
  
    | 589 | 
    
           1
    
     | 
    
           llrInfo.setType ("kuali.lo.relation.type.includes");     | 
  
            
  
    | 590 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 591 | 
    
           1
    
     | 
    
                  llrInfo = client.createLoLoRelation(llrInfo.getLoId (), llrInfo.getRelatedLoId (), llrInfo.getType (), llrInfo);     | 
  
            
  
    | 592 | 
    
            
    
     | 
    
              } catch (Exception e) {     | 
  
            
  
    | 593 | 
    
           0
    
     | 
    
                 fail("Exception caught when calling LearningObjectiveService.createLoLoRelation(): " + e.getMessage());     | 
  
            
  
    | 594 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 595 | 
    
           1
    
     | 
    
              assertNotNull(llrInfo);     | 
  
            
  
    | 596 | 
    
           1
    
     | 
    
              llrInfo = client.getLoLoRelation(llrInfo.getId());     | 
  
            
  
    | 597 | 
    
           1
    
     | 
    
              assertEquals("7bcd7c0e-3e6b-4527-ac55-254c58cecc22", llrInfo.getLoId());     | 
  
            
  
    | 598 | 
    
           1
    
     | 
    
              assertEquals("91a91860-d796-4a17-976b-a6165b1a0b05", llrInfo.getRelatedLoId());     | 
  
            
  
    | 599 | 
    
           1
    
     | 
    
              assertEquals("kuali.lo.relation.type.includes", llrInfo.getType());     | 
  
            
  
    | 600 | 
    
           1
    
     | 
    
              assertEquals(DtoConstants.STATE_DRAFT, llrInfo.getState());     | 
  
            
  
    | 601 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 602 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 603 | 
    
           1
    
     | 
    
                  client.createLoLoRelation(null, "foo", "bar", llrInfo);     | 
  
            
  
    | 604 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loId");     | 
  
            
  
    | 605 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 606 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 607 | 
    
           1
    
     | 
    
                  client.createLoLoRelation("foo", null, "bar", llrInfo);     | 
  
            
  
    | 608 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for relatedLoId");     | 
  
            
  
    | 609 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 610 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 611 | 
    
           1
    
     | 
    
                  client.createLoLoRelation("foo", "bar", null, llrInfo);     | 
  
            
  
    | 612 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loLoRelationType");     | 
  
            
  
    | 613 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 614 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 615 | 
    
           1
    
     | 
    
                  client.createLoLoRelation("foo", "bar", "baz", null);     | 
  
            
  
    | 616 | 
    
           0
    
     | 
    
                  fail("MissingParameterException expected for loLoRelationInfo");     | 
  
            
  
    | 617 | 
    
            
    
     | 
    
              } catch (MissingParameterException e) {}     | 
  
            
  
    | 618 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 619 | 
    
            
    
     | 
    
               | 
  
            
  
    | 620 | 
    
            
    
     | 
    
               | 
  
            
  
    | 621 | 
    
            
    
     | 
    
           | 
  
            
  
    | 622 | 
    
            
    
     | 
    
           | 
  
            
  
    | 623 | 
    
            
    
     | 
    
           | 
  
            
  
    | 624 | 
    
            
    
     | 
    
           | 
  
            
  
    | 625 | 
    
            
    
     | 
    
           | 
  
            
  
    | 626 | 
    
            
    
     | 
    
           | 
  
            
  
    | 627 | 
    
            
    
     | 
    
           | 
  
            
  
    | 628 | 
    
            
    
     | 
    
           | 
  
            
  
    | 629 | 
    
            
    
     | 
    
           | 
  
            
  
    | 630 | 
    
            
    
     | 
    
           | 
  
            
  
    | 631 | 
    
            
    
     | 
    
           | 
  
            
  
    | 632 | 
    
            
    
     | 
    
           | 
  
            
  
    | 633 | 
    
            
    
     | 
    
           | 
  
            
  
    | 634 | 
    
            
    
     | 
    
           | 
  
            
  
    | 635 | 
    
            
    
     | 
    
           | 
  
            
  
    | 636 | 
    
            
    
     | 
    
           | 
  
            
  
    | 637 | 
    
            
    
     | 
    
           | 
  
            
  
    | 638 | 
    
            
    
     | 
    
           | 
  
            
  
    | 639 | 
    
            
    
     | 
    
           | 
  
            
  
    | 640 | 
    
            
    
     | 
    
           | 
  
            
  
    | 641 | 
    
            
    
     | 
    
           | 
  
            
  
    | 642 | 
    
            
    
     | 
    
           | 
  
            
  
    | 643 | 
    
            
    
     | 
    
           | 
  
            
  
    | 644 | 
    
            
    
     | 
    
           | 
  
            
  
    | 645 | 
    
            
    
     | 
    
           | 
  
            
  
    | 646 | 
    
            
    
     | 
    
           | 
  
            
  
    | 647 | 
    
            
    
     | 
    
           | 
  
            
  
    | 648 | 
    
            
    
     | 
    
           | 
  
            
  
    | 649 | 
    
            
    
     | 
    
           | 
  
            
  
    | 650 | 
    
            
    
     | 
    
           | 
  
            
  
    | 651 | 
    
            
    
     | 
    
           | 
  
            
  
    | 652 | 
    
            
    
     | 
    
           | 
  
            
  
    | 653 | 
    
            
    
     | 
    
           | 
  
            
  
    | 654 | 
    
            
    
     | 
    
           | 
  
            
  
    | 655 | 
    
            
    
     | 
    
           | 
  
            
  
    | 656 | 
    
            
    
     | 
    
           | 
  
            
  
    | 657 | 
    
            
    
     | 
    
           | 
  
            
  
    | 658 | 
    
            
    
     | 
    
           | 
  
            
  
    | 659 | 
    
            
    
     | 
    
           | 
  
            
  
    | 660 | 
    
            
    
     | 
    
           | 
  
            
  
    | 661 | 
    
            
    
     | 
    
           | 
  
            
  
    | 662 | 
    
            
    
     | 
    
           | 
  
            
  
    | 663 | 
    
            
    
     | 
    
           | 
  
            
  
    | 664 | 
    
            
    
     | 
    
           | 
  
            
  
    | 665 | 
    
            
    
     | 
    
           | 
  
            
  
    | 666 | 
    
            
    
     | 
    
           | 
  
            
  
    | 667 | 
    
            
    
     | 
    
           | 
  
            
  
    | 668 | 
    
            
    
     | 
    
           | 
  
            
  
    | 669 | 
    
            
    
     | 
    
           | 
  
            
  
    | 670 | 
    
            
    
     | 
    
           | 
  
            
  
    | 671 | 
    
            
    
     | 
    
           | 
  
            
  
    | 672 | 
    
            
    
     | 
    
           | 
  
            
  
    | 673 | 
    
            
    
     | 
    
           | 
  
            
  
    | 674 | 
    
            
    
     | 
    
           | 
  
            
  
    | 675 | 
    
            
    
     | 
    
           | 
  
            
  
    | 676 | 
    
            
    
     | 
    
           | 
  
            
  
    | 677 | 
    
            
    
     | 
    
           | 
  
            
  
    | 678 | 
    
            
    
     | 
    
           | 
  
            
  
    | 679 | 
    
            
    
     | 
    
           | 
  
            
  
    | 680 | 
    
            
    
     | 
    
           | 
  
            
  
    | 681 | 
    
            
    
     | 
    
           | 
  
            
  
    | 682 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 96.6% | 
           Uncovered Elements: 2 (59) | 
           Complexity: 4 | 
           Complexity Density: 0.07 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 683 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 684 | 
    
            
    
     | 
    
          public void testLoCategory() throws OperationFailedException, DoesNotExistException, InvalidParameterException, MissingParameterException, DataValidationErrorException, PermissionDeniedException, VersionMismatchException, DependentObjectsExistException, AlreadyExistsException, UnsupportedActionException {     | 
  
            
  
    | 685 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 686 | 
    
           1
    
     | 
    
              List<LoCategoryInfo> categories = client.getLoCategories("foo.bar.baz");     | 
  
            
  
    | 687 | 
    
           1
    
     | 
    
              assertTrue(null == categories || categories.isEmpty());     | 
  
            
  
    | 688 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 689 | 
    
           1
    
     | 
    
              LoCategoryInfo category = new LoCategoryInfo();     | 
  
            
  
    | 690 | 
    
           1
    
     | 
    
              RichTextInfo richText = new RichTextInfo();     | 
  
            
  
    | 691 | 
    
           1
    
     | 
    
              richText.setFormatted("<p>New Category</p>");     | 
  
            
  
    | 692 | 
    
           1
    
     | 
    
              richText.setPlain("New Category");     | 
  
            
  
    | 693 | 
    
           1
    
     | 
    
              category.setDesc(richText);     | 
  
            
  
    | 694 | 
    
           1
    
     | 
    
              Date date = new Date();     | 
  
            
  
    | 695 | 
    
           1
    
     | 
    
              category.setEffectiveDate(date);     | 
  
            
  
    | 696 | 
    
           1
    
     | 
    
              category.setExpirationDate(date);     | 
  
            
  
    | 697 | 
    
           1
    
     | 
    
              category.setName("BOB, THE AMAAAAAAZING WONDER LLAMA!!");     | 
  
            
  
    | 698 | 
    
           1
    
     | 
    
              Map<String, String> attributes = new HashMap<String, String>();     | 
  
            
  
    | 699 | 
    
           1
    
     | 
    
              attributes.put("attrKey", "attrValue");     | 
  
            
  
    | 700 | 
    
           1
    
     | 
    
              category.setAttributes(attributes);     | 
  
            
  
    | 701 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 702 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 703 | 
    
           1
    
     | 
    
              String categoryId = "550e8400-e29b-41d4-a716-446655440000";     | 
  
            
  
    | 704 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 705 | 
    
           1
    
     | 
    
              category = client.getLoCategory(categoryId);     | 
  
            
  
    | 706 | 
    
           1
    
     | 
    
              assertEquals("Perception", category.getName());     | 
  
            
  
    | 707 | 
    
           1
    
     | 
    
              assertEquals("loCategoryType.skillarea", category.getType());     | 
  
            
  
    | 708 | 
    
           1
    
     | 
    
              category.setName("LENNY, THE LECHEROUS MILK THIEF");     | 
  
            
  
    | 709 | 
    
           1
    
     | 
    
              category.setType("loCategoryType.accreditation");     | 
  
            
  
    | 710 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 711 | 
    
           1
    
     | 
    
              List<LoInfo> twoLos = client.getLosByLoCategory(categoryId);     | 
  
            
  
    | 712 | 
    
           1
    
     | 
    
              assertTrue(null != twoLos);     | 
  
            
  
    | 713 | 
    
           1
    
     | 
    
              assertEquals(2, twoLos.size());     | 
  
            
  
    | 714 | 
    
           1
    
     | 
    
              assertTrue(twoLos.get(0).getId().equals("81abea67-3bcc-4088-8348-e265f3670145") ||     | 
  
            
  
    | 715 | 
    
            
    
     | 
    
                          twoLos.get(0).getId().equals("dd0658d2-fdc9-48fa-9578-67a2ce53bf8a"));     | 
  
            
  
    | 716 | 
    
           1
    
     | 
    
              assertTrue(twoLos.get(1).getId().equals("81abea67-3bcc-4088-8348-e265f3670145") ||     | 
  
            
  
    | 717 | 
    
            
    
     | 
    
                          twoLos.get(1).getId().equals("dd0658d2-fdc9-48fa-9578-67a2ce53bf8a"));     | 
  
            
  
    | 718 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 719 | 
    
           1
    
     | 
    
              LoCategoryInfo updated = client.updateLoCategory(categoryId, category);     | 
  
            
  
    | 720 | 
    
           1
    
     | 
    
              assertNotNull(updated);     | 
  
            
  
    | 721 | 
    
           1
    
     | 
    
              assertNotNull(updated.getId());     | 
  
            
  
    | 722 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 723 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 724 | 
    
           1
    
     | 
    
              updated = client.getLoCategory(updated.getId());     | 
  
            
  
    | 725 | 
    
           1
    
     | 
    
              assertEquals("LENNY, THE LECHEROUS MILK THIEF", updated.getName());     | 
  
            
  
    | 726 | 
    
           1
    
     | 
    
              assertEquals("loCategoryType.accreditation", updated.getType());     | 
  
            
  
    | 727 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 728 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 729 | 
    
           1
    
     | 
    
                  client.updateLoCategory(categoryId, category);     | 
  
            
  
    | 730 | 
    
           0
    
     | 
    
                  fail("DataValidationErrorException expected: LO Category already exists");     | 
  
            
  
    | 731 | 
    
            
    
     | 
    
              } catch (VersionMismatchException e) {}     | 
  
            
  
    | 732 | 
    
            
    
     | 
    
                 catch (DataValidationErrorException e) {}     | 
  
            
  
    | 733 | 
    
            
    
     | 
    
                      | 
  
            
  
    | 734 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 735 | 
    
           1
    
     | 
    
              String newCategoryId = updated.getId();     | 
  
            
  
    | 736 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 737 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 738 | 
    
           1
    
     | 
    
              assertFalse(categoryId.equals(newCategoryId));     | 
  
            
  
    | 739 | 
    
            
    
     | 
    
                  | 
  
            
  
    | 740 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 741 | 
    
           1
    
     | 
    
              List<LoInfo> los = client.getLosByLoCategory(newCategoryId);     | 
  
            
  
    | 742 | 
    
           1
    
     | 
    
              assertEquals(2, los.size());     | 
  
            
  
    | 743 | 
    
           1
    
     | 
    
              assertTrue(los.get(0).getId().equals("81abea67-3bcc-4088-8348-e265f3670145") ||     | 
  
            
  
    | 744 | 
    
            
    
     | 
    
                          los.get(0).getId().equals("dd0658d2-fdc9-48fa-9578-67a2ce53bf8a"));     | 
  
            
  
    | 745 | 
    
           1
    
     | 
    
              assertTrue(los.get(1).getId().equals("81abea67-3bcc-4088-8348-e265f3670145") ||     | 
  
            
  
    | 746 | 
    
            
    
     | 
    
                          los.get(1).getId().equals("dd0658d2-fdc9-48fa-9578-67a2ce53bf8a"));     | 
  
            
  
    | 747 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 748 | 
    
           1
    
     | 
    
              los = client.getLosByLoCategory(categoryId);     | 
  
            
  
    | 749 | 
    
           1
    
     | 
    
              assertTrue(null == los || los.isEmpty());     | 
  
            
  
    | 750 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 751 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 752 | 
    
           1
    
     | 
    
              categoryId = "054caa88-c21d-4496-8287-36a311a11d68";     | 
  
            
  
    | 753 | 
    
           1
    
     | 
    
              StatusInfo statusInfo = client.addLoCategoryToLo(categoryId, "91a91860-d796-4a17-976b-a6165b1a0b05");     | 
  
            
  
    | 754 | 
    
           1
    
     | 
    
              assertTrue(statusInfo.getSuccess());     | 
  
            
  
    | 755 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 756 | 
    
           1
    
     | 
    
              los = client.getLosByLoCategory(categoryId);     | 
  
            
  
    | 757 | 
    
           1
    
     | 
    
              assertEquals(1, los.size());     | 
  
            
  
    | 758 | 
    
           1
    
     | 
    
              assertEquals("91a91860-d796-4a17-976b-a6165b1a0b05", los.get(0).getId());     | 
  
            
  
    | 759 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 760 | 
    
           1
    
     | 
    
              categories = client.getLoCategoriesForLo("91a91860-d796-4a17-976b-a6165b1a0b05");     | 
  
            
  
    | 761 | 
    
           1
    
     | 
    
              assertEquals(1, categories.size());     | 
  
            
  
    | 762 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 763 | 
    
           1
    
     | 
    
              try {     | 
  
            
  
    | 764 | 
    
           1
    
     | 
    
                  statusInfo = client.deleteLoCategory(categoryId);     | 
  
            
  
    | 765 | 
    
           0
    
     | 
    
                  fail("DependentObjectsExistException expected");      | 
  
            
  
    | 766 | 
    
            
    
     | 
    
              } catch(DependentObjectsExistException e) {}     | 
  
            
  
    | 767 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 768 | 
    
           1
    
     | 
    
              statusInfo = client.removeLoCategoryFromLo(categoryId, "91a91860-d796-4a17-976b-a6165b1a0b05");     | 
  
            
  
    | 769 | 
    
           1
    
     | 
    
              assertTrue(statusInfo.getSuccess());     | 
  
            
  
    | 770 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 771 | 
    
           1
    
     | 
    
              los = client.getLosByLoCategory(categoryId);     | 
  
            
  
    | 772 | 
    
           1
    
     | 
    
              assertTrue(null == los || los.size() == 0);     | 
  
            
  
    | 773 | 
    
           1
    
     | 
    
              statusInfo = client.deleteLoCategory(categoryId);     | 
  
            
  
    | 774 | 
    
           1
    
     | 
    
              assertTrue(statusInfo.getSuccess());     | 
  
            
  
    | 775 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 776 | 
    
            
    
     | 
    
               | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (19) | 
           Complexity: 1 | 
           Complexity Density: 0.05 | 
                              1
    PASS
   | 
                        
            
        | 
    
  
  
    | 777 | 
    
           1
    
     | 
    
           @Test...     | 
  
            
  
    | 778 | 
    
            
    
     | 
    
          public void testSearchForResults() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException{     | 
  
            
  
    | 779 | 
    
           1
    
     | 
    
              String testLoName = "Navigate Wiki";     | 
  
            
  
    | 780 | 
    
           1
    
     | 
    
              List<SearchParam> queryParamValues = new ArrayList<SearchParam>();     | 
  
            
  
    | 781 | 
    
           1
    
     | 
    
              SearchParam qpv1 = new SearchParam();     | 
  
            
  
    | 782 | 
    
           1
    
     | 
    
              qpv1.setKey("lo.queryParam.loName");     | 
  
            
  
    | 783 | 
    
           1
    
     | 
    
              qpv1.setValue(testLoName);     | 
  
            
  
    | 784 | 
    
           1
    
     | 
    
              queryParamValues.add(qpv1);     | 
  
            
  
    | 785 | 
    
           1
    
     | 
    
              SearchRequest searchRequest = new SearchRequest();     | 
  
            
  
    | 786 | 
    
           1
    
     | 
    
              searchRequest.setParams(queryParamValues);     | 
  
            
  
    | 787 | 
    
           1
    
     | 
    
              searchRequest.setSearchKey("lo.search.loByName");     | 
  
            
  
    | 788 | 
    
           1
    
     | 
    
              SearchResult result = client.search(searchRequest);     | 
  
            
  
    | 789 | 
    
           1
    
     | 
    
              assertEquals(1,result.getRows().size());     | 
  
            
  
    | 790 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 791 | 
    
           1
    
     | 
    
              List<SearchResultCell> resultCells = result.getRows().get(0).getCells();     | 
  
            
  
    | 792 | 
    
           1
    
     | 
    
              assertEquals(2, resultCells.size());     | 
  
            
  
    | 793 | 
    
           1
    
     | 
    
              SearchResultCell cell = resultCells.get(0);     | 
  
            
  
    | 794 | 
    
           1
    
     | 
    
              assertEquals("lo.resultColumn.loId", cell.getKey());     | 
  
            
  
    | 795 | 
    
           1
    
     | 
    
              assertEquals("e0b456b2-62cb-4bd3-8867-a0d59fd8f2cf", cell.getValue());     | 
  
            
  
    | 796 | 
    
           1
    
     | 
    
              cell = resultCells.get(1);     | 
  
            
  
    | 797 | 
    
           1
    
     | 
    
              assertEquals("lo.resultColumn.loName", cell.getKey());     | 
  
            
  
    | 798 | 
    
           1
    
     | 
    
              assertEquals(testLoName, cell.getValue());     | 
  
            
  
    | 799 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 800 | 
    
            
    
     | 
    
      }     |