Skip to content

Commit

Permalink
SHIBUI-2393/2474
Browse files Browse the repository at this point in the history
Added checking for required fields
  • Loading branch information
chasegawa committed Nov 28, 2022
1 parent 2d5cbfa commit 138482b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import edu.internet2.tier.shibboleth.admin.ui.domain.frontend.DynamicRegistrationRepresentation;
import edu.internet2.tier.shibboleth.admin.ui.exception.ForbiddenException;
import edu.internet2.tier.shibboleth.admin.ui.exception.MissingRequiredFieldsException;
import edu.internet2.tier.shibboleth.admin.ui.exception.ObjectIdExistsException;
import edu.internet2.tier.shibboleth.admin.ui.exception.PersistentEntityNotFound;
import edu.internet2.tier.shibboleth.admin.ui.service.DynamicRegistrationService;
Expand Down Expand Up @@ -40,7 +41,7 @@ private static URI getResourceUriFor(String resourceId) {

@PostMapping("/DynamicRegistration")
@Transactional
public ResponseEntity<?> create(@RequestBody DynamicRegistrationRepresentation dynRegRepresentation) throws ObjectIdExistsException {
public ResponseEntity<?> create(@RequestBody DynamicRegistrationRepresentation dynRegRepresentation) throws ObjectIdExistsException, MissingRequiredFieldsException {
DynamicRegistrationRepresentation persisted = dynamicRegistrationService.createNew(dynRegRepresentation);
return ResponseEntity.created(getResourceUriFor(persisted.getResourceId())).body(persisted);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import edu.internet2.tier.shibboleth.admin.ui.domain.frontend.DynamicRegistrationRepresentation;
import edu.internet2.tier.shibboleth.admin.ui.exception.ForbiddenException;
import edu.internet2.tier.shibboleth.admin.ui.exception.MissingRequiredFieldsException;
import edu.internet2.tier.shibboleth.admin.ui.exception.ObjectIdExistsException;
import edu.internet2.tier.shibboleth.admin.ui.exception.PersistentEntityNotFound;
import edu.internet2.tier.shibboleth.admin.ui.exception.UnsupportedShibUiOperationException;
Expand All @@ -13,7 +14,8 @@ public interface DynamicRegistrationService {
DynamicRegistrationRepresentation approveDynamicRegistration(String resourceId, boolean status)
throws PersistentEntityNotFound, ForbiddenException;

DynamicRegistrationRepresentation createNew(DynamicRegistrationRepresentation dynRegRepresentation) throws ObjectIdExistsException;
DynamicRegistrationRepresentation createNew(DynamicRegistrationRepresentation dynRegRepresentation) throws ObjectIdExistsException,
MissingRequiredFieldsException;

void delete(String resourceId) throws ForbiddenException, PersistentEntityNotFound;

Expand Down

0 comments on commit 138482b

Please sign in to comment.