Coverage Report - org.kuali.student.enrollment.lpr.mock.LuiPersonRelationServiceValidationImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
LuiPersonRelationServiceValidationImpl
0%
0/13
0%
0/4
1.8
 
 1  
 /*
 2  
  * Copyright 2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may        obtain a copy of the License at
 7  
  *
 8  
  *         http://www.osedu.org/licenses/ECL-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.student.enrollment.lpr.mock;
 17  
 
 18  
 import org.kuali.student.enrollment.lpr.service.LuiPersonRelationService;
 19  
 import org.kuali.student.common.exceptions.*;
 20  
 import org.kuali.student.enrollment.lpr.dto.LuiPersonRelationInfo;
 21  
 
 22  
 import java.util.*;
 23  
 
 24  
 import org.kuali.student.common.dto.ContextInfo;
 25  
 import org.kuali.student.common.dto.ValidationResultInfo;
 26  
 import org.kuali.student.common.infc.HoldsValidator;
 27  
 import org.kuali.student.datadictionary.DataDictionaryValidatorInfc;
 28  
 
 29  
 /**
 30  
  * @author nwright
 31  
  */
 32  0
 public class LuiPersonRelationServiceValidationImpl extends LuiPersonRelationServiceAdapter
 33  
         implements LuiPersonRelationService, HoldsValidator {
 34  
 
 35  
     private DataDictionaryValidatorInfc validator;
 36  
 
 37  
     @Override
 38  
     public DataDictionaryValidatorInfc getValidator() {
 39  0
         return validator;
 40  
     }
 41  
 
 42  
     @Override
 43  
     public void setValidator(DataDictionaryValidatorInfc validator) {
 44  0
         this.validator = validator;
 45  0
     }
 46  
 
 47  
     @Override
 48  
     public List<ValidationResultInfo> validateLuiPersonRelation(String validationType,
 49  
             LuiPersonRelationInfo luiPersonRelationInfo,
 50  
             ContextInfo context)
 51  
             throws DoesNotExistException,
 52  
             InvalidParameterException,
 53  
             MissingParameterException,
 54  
             OperationFailedException,
 55  
             PermissionDeniedException {
 56  0
         return this.validator.validate(DataDictionaryValidatorInfc.ValidationType.fromString(validationType), luiPersonRelationInfo, context);
 57  
     }
 58  
 
 59  
     @Override
 60  
     public String createLuiPersonRelation(String personId, String luiId,
 61  
             String luiPersonRelationType,
 62  
             LuiPersonRelationInfo luiPersonRelationInfo,
 63  
             ContextInfo context) throws
 64  
             AlreadyExistsException,
 65  
             DoesNotExistException,
 66  
             DisabledIdentifierException,
 67  
             InvalidParameterException,
 68  
             MissingParameterException,
 69  
             OperationFailedException,
 70  
             DataValidationErrorException,
 71  
             ReadOnlyException,
 72  
             PermissionDeniedException {
 73  0
         List<ValidationResultInfo> vris = this.validateLuiPersonRelation(DataDictionaryValidatorInfc.ValidationType.FULL_VALIDATION.name(),
 74  
                 luiPersonRelationInfo, context);
 75  0
         if (!vris.isEmpty()) {
 76  0
             throw new DataValidationErrorException("Failed validation", vris);
 77  
         }
 78  0
         return this.getLprService().createLuiPersonRelation(personId, luiId, luiPersonRelationType, luiPersonRelationInfo, context);
 79  
     }
 80  
 
 81  
     @Override
 82  
     public LuiPersonRelationInfo updateLuiPersonRelation(String luiPersonRelationId,
 83  
             LuiPersonRelationInfo luiPersonRelationInfo,
 84  
             ContextInfo context)
 85  
             throws DataValidationErrorException,
 86  
             DoesNotExistException,
 87  
             InvalidParameterException,
 88  
             MissingParameterException,
 89  
             ReadOnlyException,
 90  
             OperationFailedException,
 91  
             PermissionDeniedException,
 92  
             VersionMismatchException {
 93  0
         List<ValidationResultInfo> vris = this.validateLuiPersonRelation(DataDictionaryValidatorInfc.ValidationType.FULL_VALIDATION.name(),
 94  
                 luiPersonRelationInfo, context);
 95  0
         if (!vris.isEmpty()) {
 96  0
             throw new DataValidationErrorException("Failed validation", vris);
 97  
         }
 98  0
         return this.getLprService().updateLuiPersonRelation(luiPersonRelationId, luiPersonRelationInfo, context);
 99  
     }
 100  
 }
 101