chibenwa commented on code in PR #2405:
URL: https://github.com/apache/james-project/pull/2405#discussion_r1764064929


##########
server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/SubAddressingTest.java:
##########
@@ -96,40 +97,79 @@ void shouldNotAddStorageDirectiveWhenNoRight() throws 
Exception {
     @Test
     void shouldAddStorageDirectiveMatchingDetailsWhenRight() throws Exception {
 
-        MailboxSession session = 
mailboxManager.createSystemSession(Username.of("recipient"));
+        Username username = Username.of("recipient");
+        MailboxSession session = mailboxManager.createSystemSession(username);
 
         // create Mailbox
         MailboxId mailboxId = mailboxManager.createMailbox(
-            MailboxPath.forUser(Username.of("recipient"), "any"), session)
-            .get();
+            MailboxPath.forUser(username, "any"), session).get();
 
-        // give right to post
-        MailboxACL.ACLCommand command = MailboxACL.command()
-            .key(MailboxACL.ANYBODY_KEY)
-            .rights(MailboxACL.Right.Post)
-            .asAddition();
+        giveRightToPost(mailboxId, session);
 
-        mailboxManager.applyRightsCommand(mailboxId, command, session);
+        Mail mail = sendSubAddressedMail(true);
+
+        AttributeName recipient = 
AttributeName.of("DeliveryPaths_recipient@localhost");
+        assertThat(mail.attributes().map(this::unbox))
+            .doesNotContain(Pair.of(recipient, "any"));
+    }
+
+    @Test
+    void shouldAddStorageDirectiveWhenEveryoneHasRightAndSenderIsUnknown() 
throws Exception {
+
+        Username username = Username.of("recipient");
+        MailboxSession session = mailboxManager.createSystemSession(username);
+
+        // create Mailbox
+        MailboxId mailboxId = mailboxManager.createMailbox(
+                MailboxPath.forUser(username, "any"), session).get();

Review Comment:
   I'd just move it in @BeforeEach and handle the case mailbox do not exist 
with a mailbox called "notfound"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to