quantranhong1999 commented on code in PR #1270:
URL: https://github.com/apache/james-project/pull/1270#discussion_r1004263009
##########
mailet/icalendar/src/test/java/org/apache/james/transport/mailets/ICALToJsonAttributeTest.java:
##########
@@ -221,9 +221,30 @@ void serviceShouldFilterMailsWithoutSender() throws
Exception {
.isEmpty();
}
+ @Test
+ void serviceShouldFilterICSWithoutEvents() throws Exception {
+ testee.init(FakeMailetConfig.builder().build());
+
+ AttributeValue<byte[]> ics =
AttributeValue.of(ClassLoaderUtils.getSystemResourceAsByteArray("ics/no_event.ics"));
+ AttributeValue<Serializable> calendar =
AttributeValue.ofSerializable(new CalendarBuilder().build(new
ByteArrayInputStream(ics.getValue())));
+ Map<String, AttributeValue<?>> icals = ImmutableMap.of("key",
calendar);
+ Map<String, AttributeValue<?>> rawIcals = ImmutableMap.of("key", ics);
+ Mail mail = FakeMail.builder()
+ .name("mail")
+ .sender(SENDER)
+ .recipient(MailAddressFixture.OTHER_AT_JAMES)
+ .attribute(new Attribute(ICALToJsonAttribute.DEFAULT_SOURCE,
AttributeValue.ofAny(icals)))
+ .attribute(new Attribute(ICALToJsonAttribute.DEFAULT_RAW_SOURCE,
AttributeValue.ofAny(icals)))
Review Comment:
```suggestion
.attribute(new Attribute(ICALToJsonAttribute.DEFAULT_RAW_SOURCE,
AttributeValue.ofAny(rawIcals)))
```
--
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]