Skip to content
Snippets Groups Projects
Commit 0392efdc authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4561 rename goofy -> alfa; pluto -> vorgang-manager

parent ed4a0c58
No related branches found
No related tags found
No related merge requests found
Showing
with 37 additions and 30 deletions
......@@ -12,10 +12,10 @@ Die E2E Tests werden in parallen Jenkins Stages in seperaten Namespaces durchgef
Beispiel Namespace: sh-mastere2emain-dev
1. Umleiten der Datenbank: `kubectl port-forward pluto-database-0 27017:27017 -n sh-mastere2emain-dev`
1. Umleiten der Datenbank: `kubectl port-forward vorgang-manager-database-0 27017:27017 -n sh-mastere2emain-dev`
2. Umleiten des Elastic Search: `kubectl port-forward ozg-search-cluster-es-ozg-search-0 9200:9200 -n elastic-system`
3. Host Eintrag ergänzen: In `/etc/hosts` folgenden Eintrag ergänzen: `127.0.0.1 pluto-database-0.pluto-database-svc.sh-mastere2emain-dev.svc.cluster.local`
3. Host Eintrag ergänzen: In `/etc/hosts` folgenden Eintrag ergänzen: `127.0.0.1 vorgang-manager-database-0.vorgang-manager-database-svc.sh-mastere2emain-dev.svc.cluster.local`
4. Cypress mit entsprechender config starten: `npm run cypress:open -- --config-file cypress-master-main.json`
......@@ -35,7 +35,7 @@ import lombok.Getter;
@Builder
@Getter
public class GoofyUserWithFileId {
public class AlfaUserWithFileId {
private UserProfile user;
private FileId fileId;
......
......@@ -39,7 +39,7 @@ public class DownloadAuthenticationHandler {
boolean check(FileId fileId, Authentication auth) {
if (auth instanceof UsernamePasswordAuthenticationToken userPasswordToken) {
var user = (GoofyUserWithFileId) userPasswordToken.getPrincipal();
var user = (AlfaUserWithFileId) userPasswordToken.getPrincipal();
return Objects.nonNull(fileId) && fileId.equals(user.getFileId()) && auth.isAuthenticated();
}
......
......@@ -72,11 +72,11 @@ public class ContextService {
}
private GrpcUser createUser() {
var goofyUser = userService.getUser();
var user = userService.getUser();
return GrpcUser.newBuilder()
.setId(goofyUser.getId().toString())
.setName(goofyUser.getFullName())
.setId(user.getId().toString())
.setName(user.getFullName())
.build();
}
......
......@@ -42,7 +42,7 @@ import com.auth0.jwt.exceptions.JWTVerificationException;
import de.itvsh.kop.common.errorhandling.TechnicalException;
import de.ozgcloud.alfa.JwtTokenUtil;
import de.ozgcloud.alfa.common.binaryfile.FileId;
import de.ozgcloud.alfa.common.binaryfile.GoofyUserWithFileId;
import de.ozgcloud.alfa.common.binaryfile.AlfaUserWithFileId;
import de.ozgcloud.alfa.common.user.CurrentUserService;
import de.ozgcloud.alfa.common.user.UserId;
import de.ozgcloud.alfa.common.user.UserProfile;
......@@ -86,9 +86,9 @@ class DownloadTokenService {
return authenticationToken;
}
GoofyUserWithFileId getUserFromToken(String token) {
AlfaUserWithFileId getUserFromToken(String token) {
Optional<Claims> claimsOptional = jwtTokenUtil.getAllClaimsFromToken(token);
var downloadUserBuilder = GoofyUserWithFileId.builder();
var downloadUserBuilder = AlfaUserWithFileId.builder();
claimsOptional.ifPresent(claims -> downloadUserBuilder.user(
UserProfile.builder()
.id(UserId.from(claims.get(USERID_CLAIM, String.class)))
......
......@@ -36,7 +36,7 @@ import org.springframework.security.oauth2.jwt.Jwt;
import org.springframework.stereotype.Service;
import de.itvsh.kop.common.errorhandling.TechnicalException;
import de.ozgcloud.alfa.common.binaryfile.GoofyUserWithFileId;
import de.ozgcloud.alfa.common.binaryfile.AlfaUserWithFileId;
@Service
public class CurrentUserService {
......@@ -113,9 +113,9 @@ public class CurrentUserService {
private Optional<UserProfile> getDownloadUser() {
return Optional.of(CurrentUserHelper.getAuthentication().getPrincipal())
.filter(GoofyUserWithFileId.class::isInstance)
.map(GoofyUserWithFileId.class::cast)
.map(GoofyUserWithFileId::getUser);
.filter(AlfaUserWithFileId.class::isInstance)
.map(AlfaUserWithFileId.class::cast)
.map(AlfaUserWithFileId::getUser);
}
Optional<String> getSingleClaimValue(String attributeName) {
......
......@@ -30,7 +30,7 @@ import de.ozgcloud.vorgang.grpc.command.GrpcUser;
public class GrpcCallContextTestFactory {
private static final GrpcUser USER = GrpcUserTestFactory.create();
public static final String CLIENT = "testGoofyClient";
public static final String CLIENT = "testClient";
public static GrpcCallContext create() {
return createBuilder().build();
......
......@@ -25,13 +25,13 @@ package de.ozgcloud.alfa.common.binaryfile;
import de.ozgcloud.alfa.common.user.UserProfileTestFactory;
public class DownloadGoofyUserTestFactory {
public class DownloadAlfaUserTestFactory {
static GoofyUserWithFileId create() {
static AlfaUserWithFileId create() {
return createBuilder().build();
}
static GoofyUserWithFileId.GoofyUserWithFileIdBuilder createBuilder() {
return GoofyUserWithFileId.builder().user(UserProfileTestFactory.create()).fileId(BinaryFileTestFactory.FILE_ID);
static AlfaUserWithFileId.AlfaUserWithFileIdBuilder createBuilder() {
return AlfaUserWithFileId.builder().user(UserProfileTestFactory.create()).fileId(BinaryFileTestFactory.FILE_ID);
}
}
......@@ -69,7 +69,7 @@ class DownloadAuthenticationHandlerTest {
@BeforeEach
void init() {
when(authentication.isAuthenticated()).thenReturn(Boolean.TRUE);
when(authentication.getPrincipal()).thenReturn(DownloadGoofyUserTestFactory.createBuilder().fileId(fileId).build());
when(authentication.getPrincipal()).thenReturn(DownloadAlfaUserTestFactory.createBuilder().fileId(fileId).build());
}
@Test
......
......@@ -143,7 +143,7 @@ class HistorieCommandHandlerTest {
void shouldReturnFalseOnOtherClient() {
var nonMatchingCommand = matchingCommand.toBuilder()
.body(Map.of("item", Map.of(HistorieCommandHandler.DIRECTION, HistorieCommandHandler.DIRECTION_OUTGOING),
HistorieCommandHandler.CLIENT, "Goofy"))
HistorieCommandHandler.CLIENT, "Alfa"))
.build();
var result = handler.isOutgoingPostfachNachrichtByOzgCloudNachrichtenManager(nonMatchingCommand);
......
......@@ -23,18 +23,20 @@
*/
package de.ozgcloud.alfa.vorgang;
import static org.assertj.core.api.Assertions.*;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.mapstruct.factory.Mappers;
class EingangHeaderMapperTest {
private EingangHeaderMapper mapper = Mappers.getMapper(EingangHeaderMapper.class);
private final EingangHeaderMapper mapper = Mappers.getMapper(EingangHeaderMapper.class);
@DisplayName("To EingangHeader")
@Nested
class TestGrpcEingangHeaderToGoofyEingangHeader {
class TestToEingangHeader {
@Test
void shouldMapCreatedAt() {
......
......@@ -23,9 +23,13 @@
*/
package de.ozgcloud.alfa.vorgang;
import static de.ozgcloud.alfa.vorgang.VorgangHeaderTestFactory.*;
import static org.assertj.core.api.Assertions.*;
import static de.ozgcloud.alfa.vorgang.VorgangHeaderTestFactory.AKTENZEICHEN;
import static de.ozgcloud.alfa.vorgang.VorgangHeaderTestFactory.ASSIGNED_TO;
import static de.ozgcloud.alfa.vorgang.VorgangHeaderTestFactory.CREATED_AT;
import static de.ozgcloud.alfa.vorgang.VorgangHeaderTestFactory.NUMMER;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.mapstruct.factory.Mappers;
......@@ -42,19 +46,20 @@ class VorgangWithEingangMapperTest {
@Spy
@InjectMocks
private VorgangWithEingangMapper mapper = Mappers.getMapper(VorgangWithEingangMapper.class);
private final VorgangWithEingangMapper mapper = Mappers.getMapper(VorgangWithEingangMapper.class);
@Spy
private UserIdMapper userIdMapper = Mappers.getMapper(UserIdMapper.class);
private final UserIdMapper userIdMapper = Mappers.getMapper(UserIdMapper.class);
@Spy
private BaseTypesMapper baseTypesMapper = Mappers.getMapper(BaseTypesMapper.class);
private final BaseTypesMapper baseTypesMapper = Mappers.getMapper(BaseTypesMapper.class);
@Mock
private EingangMapper eingangMapper;
@DisplayName("To VorgangWithEingang")
@Nested
class TestGrpcVorgangWithEingangToGoofyVorgangWithEingang {
class TestToVorgangWithEingang {
@Test
void shouldMapCreatedAt() {
var vorgang = callMapper();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment