Skip to content

Commit

Permalink
Merge branch 'dev' into #343_suggest_change_and_log
Browse files Browse the repository at this point in the history
# Conflicts:
#	registry-service/src/main/java/org/gbif/registry/service/collections/PrimaryCollectionEntityService.java
#	registry-ws/src/main/java/org/gbif/registry/ws/resources/collections/PersonResource.java
  • Loading branch information
marcos-lg committed Apr 28, 2021
2 parents f8b3b1b + 710daf4 commit 4e10530
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void updateInvalidEntityTest(ServiceType serviceType) {

T newEntity = newInvalidEntity();
newEntity.setKey(key);
assertThrows(ValidationException.class, () -> service.update(newEntity));
assertThrows(Exception.class, () -> service.update(newEntity));
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

import static org.gbif.registry.security.UserRoles.GRSCICOLL_ADMIN_ROLE;
import static org.gbif.registry.security.UserRoles.GRSCICOLL_EDITOR_ROLE;
import static com.google.common.base.Preconditions.checkArgument;

@Validated
@RestController
Expand Down Expand Up @@ -69,7 +70,8 @@ public UUID create(@RequestBody @Trim Person person) {
@PutMapping(value = "{key}", consumes = MediaType.APPLICATION_JSON_VALUE)
@Trim
@Secured({GRSCICOLL_ADMIN_ROLE, GRSCICOLL_EDITOR_ROLE})
public void update(@RequestBody @Trim Person person) {
public void update(@PathVariable("key") UUID key, @RequestBody @Trim Person person) {
checkArgument(key.equals(person.getKey()));
personService.update(person);
}

Expand Down

0 comments on commit 4e10530

Please sign in to comment.