Start entity types with a capital char

This commit is contained in:
René Pfeuffer
2019-03-12 15:10:43 +01:00
parent 77fb869ce4
commit 6ebbfa97a3
12 changed files with 14 additions and 14 deletions

View File

@@ -85,7 +85,7 @@ public class FileHistoryRootResource {
} else {
String message = String.format("for the revision %s and the file %s there are no changesets", revision, path);
log.error(message);
throw notFound(entity("path", path).in("revision", revision).in(namespaceAndName));
throw notFound(entity("Path", path).in("revision", revision).in(namespaceAndName));
}
}
}

View File

@@ -258,7 +258,7 @@ public class RepositoryPermissionRootResource {
*/
private void checkPermissionAlreadyExists(RepositoryPermissionDto permission, Repository repository) {
if (isPermissionExist(permission, repository)) {
throw alreadyExists(entity("permission", permission.getName()).in(repository));
throw alreadyExists(entity("Permission", permission.getName()).in(repository));
}
}

View File

@@ -65,7 +65,7 @@ public class SourceRootResource {
if (browserResult != null) {
return Response.ok(browserResultToFileObjectDtoMapper.map(browserResult, namespaceAndName)).build();
} else {
throw notFound(entity("sources", path).in(namespaceAndName));
throw notFound(entity("Source", path).in(namespaceAndName));
}
}
}

View File

@@ -77,7 +77,7 @@ public class PermissionAssigner {
private Predicate<PermissionDescriptor> permissionExists(Collection<PermissionDescriptor> availablePermissions, Collection<AssignedPermission> existingPermissions) {
return p -> {
if (!availablePermissions.contains(p) && existingPermissions.stream().map(AssignedPermission::getPermission).noneMatch(e -> e.equals(p))) {
throw NotFoundException.notFound(ContextEntry.ContextBuilder.entity("permission", p.getValue()));
throw NotFoundException.notFound(ContextEntry.ContextBuilder.entity("Permission", p.getValue()));
}
return true;
};

View File

@@ -403,7 +403,7 @@ public class DefaultUserManager extends AbstractUserManager
User user = get((String) SecurityUtils.getSubject().getPrincipals().getPrimaryPrincipal());
if (!user.getPassword().equals(oldPassword)) {
throw new InvalidPasswordException(ContextEntry.ContextBuilder.entity("passwordChange", "-").in(User.class, user.getName()));
throw new InvalidPasswordException(ContextEntry.ContextBuilder.entity("PasswordChange", "-").in(User.class, user.getName()));
}
user.setPassword(newPassword);
@@ -422,7 +422,7 @@ public class DefaultUserManager extends AbstractUserManager
throw new NotFoundException(User.class, userId);
}
if (!isTypeDefault(user)) {
throw new ChangePasswordNotAllowedException(ContextEntry.ContextBuilder.entity("passwordChange", "-").in(User.class, user.getName()), user.getType());
throw new ChangePasswordNotAllowedException(ContextEntry.ContextBuilder.entity("PasswordChange", "-").in(User.class, user.getName()), user.getType());
}
user.setPassword(newPassword);
this.modify(user);