spring-boot-3-2-upgrade #32

Merged
hsh-michaelhoennig merged 18 commits from spring-boot-3-2-upgrade into master 2024-04-02 13:24:25 +02:00
6 changed files with 22 additions and 23 deletions
Showing only changes of commit 243c6c488f - Show all commits

View File

@ -31,7 +31,7 @@ public class RbacRoleController implements RbacRolesApi {
context.define(currentUser, assumedRoles); context.define(currentUser, assumedRoles);
final List<RbacRoleRvEntity> result = rbacRoleRepository.findAll(); final List<RbacRoleEntity> result = rbacRoleRepository.findAll();
return ResponseEntity.ok(mapper.mapList(result, RbacRoleResource.class)); return ResponseEntity.ok(mapper.mapList(result, RbacRoleResource.class));
} }

View File

@ -15,7 +15,7 @@ import java.util.UUID;
@Immutable @Immutable
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class RbacRoleRvEntity { public class RbacRoleEntity {
@Id @Id
@GeneratedValue @GeneratedValue

View File

@ -5,7 +5,7 @@ import org.springframework.data.repository.Repository;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
public interface RbacRoleRepository extends Repository<RbacRoleRvEntity, UUID> { public interface RbacRoleRepository extends Repository<RbacRoleEntity, UUID> {
/** /**
* @return the number of persistent RbacRoleEntity instances, mostly for testing purposes. * @return the number of persistent RbacRoleEntity instances, mostly for testing purposes.
@ -15,7 +15,7 @@ public interface RbacRoleRepository extends Repository<RbacRoleRvEntity, UUID> {
/** /**
* @return all persistent RbacRoleEntity instances, assigned to the current subject (user or assumed roles) * @return all persistent RbacRoleEntity instances, assigned to the current subject (user or assumed roles)
*/ */
List<RbacRoleRvEntity> findAll(); List<RbacRoleEntity> findAll();
RbacRoleRvEntity findByRoleName(String roleName); RbacRoleEntity findByRoleName(String roleName);
} }

View File

@ -5,8 +5,7 @@ import net.hostsharing.hsadminng.rbac.rbacobject.RbacObject;
import net.hostsharing.hsadminng.rbac.rbacgrant.RbacGrantEntity; import net.hostsharing.hsadminng.rbac.rbacgrant.RbacGrantEntity;
import net.hostsharing.hsadminng.rbac.rbacgrant.RbacGrantRepository; import net.hostsharing.hsadminng.rbac.rbacgrant.RbacGrantRepository;
import net.hostsharing.hsadminng.rbac.rbacgrant.RbacGrantsDiagramService; import net.hostsharing.hsadminng.rbac.rbacgrant.RbacGrantsDiagramService;
import net.hostsharing.hsadminng.rbac.rbacobject.RbacObject; import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleEntity;
import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleRvEntity;
import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleRepository; import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleRepository;
import net.hostsharing.test.JpaAttempt; import net.hostsharing.test.JpaAttempt;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -255,7 +254,7 @@ public abstract class ContextBasedTestWithCleanup extends ContextBasedTest {
return jpaAttempt.transacted(() -> { return jpaAttempt.transacted(() -> {
context.define("superuser-alex@hostsharing.net", null); context.define("superuser-alex@hostsharing.net", null);
return rbacRoleRepo.findAll().stream() return rbacRoleRepo.findAll().stream()
.map(RbacRoleRvEntity::getRoleName) .map(RbacRoleEntity::getRoleName)
.collect(toSet()); .collect(toSet());
}).assertSuccessful().returnedValue(); }).assertSuccessful().returnedValue();
} }

View File

@ -5,7 +5,7 @@ import io.restassured.http.ContentType;
import io.restassured.response.ValidatableResponse; import io.restassured.response.ValidatableResponse;
import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.HsadminNgApplication;
import net.hostsharing.hsadminng.context.ContextBasedTest; import net.hostsharing.hsadminng.context.ContextBasedTest;
import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleRvEntity; import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleEntity;
import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleRepository; import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleRepository;
import net.hostsharing.hsadminng.rbac.rbacuser.RbacUserEntity; import net.hostsharing.hsadminng.rbac.rbacuser.RbacUserEntity;
import net.hostsharing.hsadminng.rbac.rbacuser.RbacUserRepository; import net.hostsharing.hsadminng.rbac.rbacuser.RbacUserRepository;
@ -361,11 +361,11 @@ class RbacGrantControllerAcceptanceTest extends ContextBasedTest {
this(currentUser, ""); this(currentUser, "");
} }
GrantFixture grantsRole(final RbacRoleRvEntity givenOwnPackageAdminRole) { GrantFixture grantsRole(final RbacRoleEntity givenOwnPackageAdminRole) {
return new GrantFixture(givenOwnPackageAdminRole); return new GrantFixture(givenOwnPackageAdminRole);
} }
RevokeFixture revokesRole(final RbacRoleRvEntity givenOwnPackageAdminRole) { RevokeFixture revokesRole(final RbacRoleEntity givenOwnPackageAdminRole) {
return new RevokeFixture(givenOwnPackageAdminRole); return new RevokeFixture(givenOwnPackageAdminRole);
} }
@ -376,11 +376,11 @@ class RbacGrantControllerAcceptanceTest extends ContextBasedTest {
class GrantFixture { class GrantFixture {
private Subject grantingSubject = Subject.this; private Subject grantingSubject = Subject.this;
private final RbacRoleRvEntity grantedRole; private final RbacRoleEntity grantedRole;
private boolean assumed; private boolean assumed;
private RbacUserEntity granteeUser; private RbacUserEntity granteeUser;
public GrantFixture(final RbacRoleRvEntity roleToGrant) { public GrantFixture(final RbacRoleEntity roleToGrant) {
this.grantedRole = roleToGrant; this.grantedRole = roleToGrant;
} }
@ -417,11 +417,11 @@ class RbacGrantControllerAcceptanceTest extends ContextBasedTest {
class RevokeFixture { class RevokeFixture {
private Subject currentSubject = Subject.this; private Subject currentSubject = Subject.this;
private final RbacRoleRvEntity grantedRole; private final RbacRoleEntity grantedRole;
private boolean assumed; private boolean assumed;
private RbacUserEntity granteeUser; private RbacUserEntity granteeUser;
public RevokeFixture(final RbacRoleRvEntity roleToGrant) { public RevokeFixture(final RbacRoleEntity roleToGrant) {
this.grantedRole = roleToGrant; this.grantedRole = roleToGrant;
} }
@ -455,9 +455,9 @@ class RbacGrantControllerAcceptanceTest extends ContextBasedTest {
private class GetGrantByIdFixture { private class GetGrantByIdFixture {
private Subject currentSubject = Subject.this; private Subject currentSubject = Subject.this;
private RbacRoleRvEntity grantedRole; private RbacRoleEntity grantedRole;
GetGrantByIdFixture forGrantedRole(final RbacRoleRvEntity grantedRole) { GetGrantByIdFixture forGrantedRole(final RbacRoleEntity grantedRole) {
this.grantedRole = grantedRole; this.grantedRole = grantedRole;
return this; return this;
} }

View File

@ -175,21 +175,21 @@ class RbacRoleRepositoryIntegrationTest {
} }
} }
void exactlyTheseRbacRolesAreReturned(final List<RbacRoleRvEntity> actualResult, final String... expectedRoleNames) { void exactlyTheseRbacRolesAreReturned(final List<RbacRoleEntity> actualResult, final String... expectedRoleNames) {
assertThat(actualResult) assertThat(actualResult)
.extracting(RbacRoleRvEntity::getRoleName) .extracting(RbacRoleEntity::getRoleName)
.containsExactlyInAnyOrder(expectedRoleNames); .containsExactlyInAnyOrder(expectedRoleNames);
} }
void allTheseRbacRolesAreReturned(final List<RbacRoleRvEntity> actualResult, final String... expectedRoleNames) { void allTheseRbacRolesAreReturned(final List<RbacRoleEntity> actualResult, final String... expectedRoleNames) {
assertThat(actualResult) assertThat(actualResult)
.extracting(RbacRoleRvEntity::getRoleName) .extracting(RbacRoleEntity::getRoleName)
.contains(expectedRoleNames); .contains(expectedRoleNames);
} }
void noneOfTheseRbacRolesIsReturned(final List<RbacRoleRvEntity> actualResult, final String... unexpectedRoleNames) { void noneOfTheseRbacRolesIsReturned(final List<RbacRoleEntity> actualResult, final String... unexpectedRoleNames) {
assertThat(actualResult) assertThat(actualResult)
.extracting(RbacRoleRvEntity::getRoleName) .extracting(RbacRoleEntity::getRoleName)
.doesNotContain(unexpectedRoleNames); .doesNotContain(unexpectedRoleNames);
} }