Skip to content
Snippets Groups Projects
Commit 0f108154 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4191 OZG-4627 further renaming

parent ea7b6975
No related branches found
No related tags found
No related merge requests found
......@@ -122,7 +122,7 @@ describe.skip('Historie', () => {
subject: 'AW: Send Postfach Nachricht',
direction: DirectionE2E.IN
},
client: 'MailService',
client: 'OzgCloud_NachrichtenManager',
vorgangId: vorgang._id.$oid
},
createdBy: null,
......
......@@ -59,7 +59,7 @@ describe('PostfachMail', () => {
const postfachMailPage: PostfachMailPage = new PostfachMailPage();
const clientAttributes: ClientAttributesE2E = {
[VorgangAttachedItemClientE2E.KOP_NACHRICHTEN_MANAGER]: {
[VorgangAttachedItemClientE2E.OZGCLOUD_NACHRICHTEN_MANAGER]: {
[ClientAttributeNameE2E.HAS_NEW_POSTFACH_NACHRICHT]: createHasNewPostfachNachrichtClientAttribute(true),
[ClientAttributeNameE2E.HAS_POSTFACH_NACHRICHT]: createHasPostfachNachrichtClientAttribute(true)
}
......
......@@ -3,7 +3,7 @@
"$oid": "602566a807bb665df9a86111"
},
"version": 0,
"client": "MailService",
"client": "OzgCloud_NachrichtenManager",
"vorgangId": "602566a807bb665df9a86111",
"itemName": "PostfachMail",
"item": {
......
......@@ -27,8 +27,7 @@ import { WiedervorlageE2E } from './wiedervorlage';
export enum VorgangAttachedItemClientE2E {
ALFA = 'Alfa',
MAIL_SERVICE = 'MailService',
KOP_NACHRICHTEN_MANAGER = 'KopNachrichtenManager'
OZGCLOUD_NACHRICHTEN_MANAGER = 'OzgCloud_NachrichtenManager'
}
export enum VorgangAttachedItemNameE2E {
......
......@@ -68,7 +68,7 @@ export function createPostfachNachrichtAttachedItem(_id: string, vorgangId: stri
_id: { $oid: _id },
version: 0,
vorgangId,
client: VorgangAttachedItemClientE2E.MAIL_SERVICE,
client: VorgangAttachedItemClientE2E.OZGCLOUD_NACHRICHTEN_MANAGER,
itemName: VorgangAttachedItemNameE2E.POSTFACH_NACHRICHT,
item: {
...createPostfachNachrichtReplyItem(),
......
......@@ -34,7 +34,7 @@ import de.ozgcloud.vorgang.grpc.clientAttribute.GrpcUpdateClientAttributeRequest
public class ClientAttributeService {
public static final String HAS_NEW_POSTFACH_NACHRICHT_ATTRIBUTE_NAME = "hasNewPostfachNachricht";
static final String ORIGINAL_CLIENT_NAME = "KopNachrichtenManager";
static final String ORIGINAL_CLIENT_NAME = "OzgCloud_NachrichtenManager";
@Autowired
private ClientAttributeRemoteService remoteService;
......
......@@ -49,7 +49,7 @@ class HistorieCommandHandler {
static final String DIRECTION_INCOMMING = "IN";
static final String DIRECTION_OUTGOING = "OUT";
static final String DIRECTION = "direction";
static final String MAIL_SERVICE = "OzgCloud_NachrichtenManager";
static final String OZGCLOUD_NACHRICHTEN_MANAGER = "OzgCloud_NachrichtenManager";
static final String CLIENT = "client";
private static final Predicate<Command> IS_CREATE_ATTACHED_ITEM = command -> command.getOrder() == CommandOrder.CREATE_ATTACHED_ITEM;
......@@ -61,7 +61,7 @@ class HistorieCommandHandler {
private CommandService commandService;
public boolean isHistorieCommand(Command command) {
return !isOutgoingPostfachNachrichtByMailService(command)
return !isOutgoingPostfachNachrichtByOzgCloudNachrichtenManager(command)
&& !isCreateLoeschAnforderungVorgangAttachedItem(command)
&& !isLoeschAnforderungZuruecknehmenRevoked(command)
&& !isDeleteVorgangAttachedItem(command);
......@@ -71,12 +71,12 @@ class HistorieCommandHandler {
return command.getOrder() == CommandOrder.DELETE_ATTACHED_ITEM;
}
boolean isOutgoingPostfachNachrichtByMailService(Command command) {
return command.getOrder().equals(CommandOrder.CREATE_ATTACHED_ITEM) && isMailService(command) && isOutgoing(command);
boolean isOutgoingPostfachNachrichtByOzgCloudNachrichtenManager(Command command) {
return command.getOrder().equals(CommandOrder.CREATE_ATTACHED_ITEM) && isOzgCloudNachrichtenManager(command) && isOutgoing(command);
}
private boolean isMailService(Command command) {
return StringUtils.equals(MapUtils.getString(command.getBody(), CLIENT), MAIL_SERVICE);
private boolean isOzgCloudNachrichtenManager(Command command) {
return StringUtils.equals(MapUtils.getString(command.getBody(), CLIENT), OZGCLOUD_NACHRICHTEN_MANAGER);
}
private boolean isOutgoing(Command command) {
......@@ -129,7 +129,7 @@ class HistorieCommandHandler {
resultBuilder.order(CommandOrder.CREATE_KOMMENTAR).build();
} else if (name.equals(Wiedervorlage.class.getSimpleName())) {
resultBuilder.order(CommandOrder.CREATE_WIEDERVORLAGE).build();
} else if (isMailService(command) && isIncomming(command)) {
} else if (isOzgCloudNachrichtenManager(command) && isIncomming(command)) {
resultBuilder.order(CommandOrder.RECEIVE_POSTFACH_NACHRICHT).build();
}
});
......
......@@ -111,18 +111,18 @@ class HistorieCommandHandlerTest {
@DisplayName("postfach nachricht verification")
@Nested
class TestIsOutgoingPostfachNachrichtenByMailService {
class TestIsOutgoingPostfachNachrichtenByOzgCloudNachrichtenManager {
private final Command matchingCommand = CommandTestFactory.createBuilder()
.order(CommandOrder.CREATE_ATTACHED_ITEM)
.body(Map.of("item", Map.of(HistorieCommandHandler.DIRECTION, HistorieCommandHandler.DIRECTION_OUTGOING),
HistorieCommandHandler.CLIENT, HistorieCommandHandler.MAIL_SERVICE))
HistorieCommandHandler.CLIENT, HistorieCommandHandler.OZGCLOUD_NACHRICHTEN_MANAGER))
.build();
@DisplayName("should return true if the command is CREATED_ATTACHED_ITEM order outgoing by mailserice")
@Test
void shouldReturnTrue() {
var result = handler.isOutgoingPostfachNachrichtByMailService(matchingCommand);
var result = handler.isOutgoingPostfachNachrichtByOzgCloudNachrichtenManager(matchingCommand);
assertThat(result).isTrue();
}
......@@ -131,10 +131,10 @@ class HistorieCommandHandlerTest {
void shouldReturnFalseOnIncoming() {
var nonMatchingCommand = matchingCommand.toBuilder()
.body(Map.of("item", Map.of(HistorieCommandHandler.DIRECTION, HistorieCommandHandler.DIRECTION_INCOMMING),
HistorieCommandHandler.CLIENT, HistorieCommandHandler.MAIL_SERVICE))
HistorieCommandHandler.CLIENT, HistorieCommandHandler.OZGCLOUD_NACHRICHTEN_MANAGER))
.build();
var result = handler.isOutgoingPostfachNachrichtByMailService(nonMatchingCommand);
var result = handler.isOutgoingPostfachNachrichtByOzgCloudNachrichtenManager(nonMatchingCommand);
assertThat(result).isFalse();
}
......@@ -146,7 +146,7 @@ class HistorieCommandHandlerTest {
HistorieCommandHandler.CLIENT, "Goofy"))
.build();
var result = handler.isOutgoingPostfachNachrichtByMailService(nonMatchingCommand);
var result = handler.isOutgoingPostfachNachrichtByOzgCloudNachrichtenManager(nonMatchingCommand);
assertThat(result).isFalse();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment