You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/simple-java-mail/src/test/java/org/simplejavamail/converter/internal/mimemessage/ImmutableDelegatingSMTPMessageTest.java
+42-41Lines changed: 42 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -171,6 +171,7 @@ public void testIrrelevantGettersAndAllowedMutatorsAreDelegatedProperly() throws
@@ -184,47 +185,47 @@ public void testImmutability() throws IOException {
184
185
assertThatThrownBy(subject::updateHeaders).hasMessageContaining("protected in the delegate");
185
186
assertThatThrownBy(() -> subject.createInternetHeaders(newByteArrayInputStream(newbyte[]{}))).hasMessageContaining("protected in the delegate");
186
187
assertThatThrownBy(() -> subject.createMimeMessage(Session.getDefaultInstance(newProperties()))).hasMessageContaining("protected in the delegate");
187
-
assertThatThrownBy(() -> subject.setEnvelopeFrom("from")).hasMessage("Further mutation is not allowed");
188
-
assertThatThrownBy(() -> subject.setNotifyOptions(3)).hasMessage("Further mutation is not allowed");
189
-
assertThatThrownBy(() -> subject.setReturnOption(2)).hasMessage("Further mutation is not allowed");
190
-
assertThatThrownBy(() -> subject.setAllow8bitMIME(false)).hasMessage("Further mutation is not allowed");
191
-
assertThatThrownBy(() -> subject.setSendPartial(true)).hasMessage("Further mutation is not allowed");
192
-
assertThatThrownBy(() -> subject.setSubmitter("submitter")).hasMessage("Further mutation is not allowed");
193
-
assertThatThrownBy(() -> subject.setMailExtension("ext")).hasMessage("Further mutation is not allowed");
194
-
assertThatThrownBy(() -> subject.setFrom(newInternetAddress())).hasMessage("Further mutation is not allowed");
195
-
assertThatThrownBy(() -> subject.setFrom("value")).hasMessage("Further mutation is not allowed");
196
-
assertThatThrownBy(subject::setFrom).hasMessage("Further mutation is not allowed");
197
-
assertThatThrownBy(() -> subject.addFrom(newAddress[]{})).hasMessage("Further mutation is not allowed");
198
-
assertThatThrownBy(() -> subject.setSender(newInternetAddress())).hasMessage("Further mutation is not allowed");
199
-
assertThatThrownBy(() -> subject.setRecipients(TO, newAddress[]{})).hasMessage("Further mutation is not allowed");
200
-
assertThatThrownBy(() -> subject.setRecipients(TO, "addresses")).hasMessage("Further mutation is not allowed");
201
-
assertThatThrownBy(() -> subject.addRecipients(TO, newAddress[]{})).hasMessage("Further mutation is not allowed");
202
-
assertThatThrownBy(() -> subject.addRecipients(TO, "addresses")).hasMessage("Further mutation is not allowed");
203
-
assertThatThrownBy(() -> subject.setReplyTo(newAddress[]{})).hasMessage("Further mutation is not allowed");
204
-
assertThatThrownBy(() -> subject.setSubject("subject")).hasMessage("Further mutation is not allowed");
205
-
assertThatThrownBy(() -> subject.setSubject("subject", "UTF-8")).hasMessage("Further mutation is not allowed");
206
-
assertThatThrownBy(() -> subject.setSentDate(newDate())).hasMessage("Further mutation is not allowed");
207
-
assertThatThrownBy(() -> subject.setDisposition("disposition")).hasMessage("Further mutation is not allowed");
208
-
assertThatThrownBy(() -> subject.setContentID("<id>")).hasMessage("Further mutation is not allowed");
209
-
assertThatThrownBy(() -> subject.setContentMD5("md5")).hasMessage("Further mutation is not allowed");
210
-
assertThatThrownBy(() -> subject.setDescription("description")).hasMessage("Further mutation is not allowed");
211
-
assertThatThrownBy(() -> subject.setDescription("description", "UTF-8")).hasMessage("Further mutation is not allowed");
212
-
assertThatThrownBy(() -> subject.setContentLanguage(newString[] {})).hasMessage("Further mutation is not allowed");
213
-
assertThatThrownBy(() -> subject.setFileName("filename")).hasMessage("Further mutation is not allowed");
214
-
assertThatThrownBy(() -> subject.setDataHandler(mock(DataHandler.class))).hasMessage("Further mutation is not allowed");
215
-
assertThatThrownBy(() -> subject.setContent("content", "type")).hasMessage("Further mutation is not allowed");
216
-
assertThatThrownBy(() -> subject.setText("text")).hasMessage("Further mutation is not allowed");
217
-
assertThatThrownBy(() -> subject.setText("text", "UTF-8")).hasMessage("Further mutation is not allowed");
218
-
assertThatThrownBy(() -> subject.setText("text", "UTF-8", "subtype")).hasMessage("Further mutation is not allowed");
219
-
assertThatThrownBy(() -> subject.setContent(mock(Multipart.class))).hasMessage("Further mutation is not allowed");
220
-
assertThatThrownBy(() -> subject.setHeader("name", "value")).hasMessage("Further mutation is not allowed");
221
-
assertThatThrownBy(() -> subject.addHeader("name", "value")).hasMessage("Further mutation is not allowed");
222
-
assertThatThrownBy(() -> subject.removeHeader("name")).hasMessage("Further mutation is not allowed");
223
-
assertThatThrownBy(() -> subject.addHeaderLine("line")).hasMessage("Further mutation is not allowed");
224
-
assertThatThrownBy(() -> subject.setFlags(mock(Flags.class), false)).hasMessage("Further mutation is not allowed");
225
-
assertThatThrownBy(() -> subject.setRecipient(TO, newInternetAddress())).hasMessage("Further mutation is not allowed");
226
-
assertThatThrownBy(() -> subject.addRecipient(TO, newInternetAddress())).hasMessage("Further mutation is not allowed");
227
-
assertThatThrownBy(() -> subject.setFlag(ANSWERED, true)).hasMessage("Further mutation is not allowed");
188
+
assertThatThrownBy(() -> subject.setEnvelopeFrom("from")).hasMessage("Further mutation is not allowed: setEnvelopeFrom(String)");
189
+
assertThatThrownBy(() -> subject.setNotifyOptions(3)).hasMessage("Further mutation is not allowed: setNotifyOptions(int)");
190
+
assertThatThrownBy(() -> subject.setReturnOption(2)).hasMessage("Further mutation is not allowed: setReturnOption(int)");
191
+
assertThatThrownBy(() -> subject.setAllow8bitMIME(false)).hasMessage("Further mutation is not allowed: setAllow8bitMIME(boolean)");
192
+
assertThatThrownBy(() -> subject.setSendPartial(true)).hasMessage("Further mutation is not allowed: setSendPartial(boolean)");
193
+
assertThatThrownBy(() -> subject.setSubmitter("submitter")).hasMessage("Further mutation is not allowed: setSubmitter(String)");
194
+
assertThatThrownBy(() -> subject.setMailExtension("ext")).hasMessage("Further mutation is not allowed: setMailExtension(String)");
195
+
assertThatThrownBy(() -> subject.setFrom(newInternetAddress())).hasMessage("Further mutation is not allowed: setFrom(Address)");
196
+
assertThatThrownBy(() -> subject.setFrom("value")).hasMessage("Further mutation is not allowed: setFrom(String)");
197
+
assertThatThrownBy(() -> subject.setFrom()).hasMessage("Further mutation is not allowed: setFrom()");
198
+
assertThatThrownBy(() -> subject.addFrom(newAddress[]{})).hasMessage("Further mutation is not allowed: addFrom(Address[])");
199
+
assertThatThrownBy(() -> subject.setSender(newInternetAddress())).hasMessage("Further mutation is not allowed: setSender(Address)");
200
+
assertThatThrownBy(() -> subject.setRecipients(TO, newAddress[]{})).hasMessage("Further mutation is not allowed: setRecipients(RecipientType, Address[])");
201
+
assertThatThrownBy(() -> subject.setRecipients(TO, "addresses")).hasMessage("Further mutation is not allowed: setRecipients(RecipientType, String)");
202
+
assertThatThrownBy(() -> subject.addRecipients(TO, newAddress[]{})).hasMessage("Further mutation is not allowed: addRecipients(RecipientType, Address[])");
203
+
assertThatThrownBy(() -> subject.addRecipients(TO, "addresses")).hasMessage("Further mutation is not allowed: addRecipients(RecipientType, String)");
204
+
assertThatThrownBy(() -> subject.setReplyTo(newAddress[]{})).hasMessage("Further mutation is not allowed: setReplyTo(Address[])");
205
+
assertThatThrownBy(() -> subject.setSubject("subject")).hasMessage("Further mutation is not allowed: setSubject(String)");
206
+
assertThatThrownBy(() -> subject.setSubject("subject", "UTF-8")).hasMessage("Further mutation is not allowed: setSubject(String, String)");
207
+
assertThatThrownBy(() -> subject.setSentDate(newDate())).hasMessage("Further mutation is not allowed: setSentDate(Date)");
208
+
assertThatThrownBy(() -> subject.setDisposition("disposition")).hasMessage("Further mutation is not allowed: setDisposition(String)");
209
+
assertThatThrownBy(() -> subject.setContentID("<id>")).hasMessage("Further mutation is not allowed: setContentID(String)");
210
+
assertThatThrownBy(() -> subject.setContentMD5("md5")).hasMessage("Further mutation is not allowed: setContentMD5(String)");
211
+
assertThatThrownBy(() -> subject.setDescription("description")).hasMessage("Further mutation is not allowed: setDescription(String)");
212
+
assertThatThrownBy(() -> subject.setDescription("description", "UTF-8")).hasMessage("Further mutation is not allowed: setDescription(String, String)");
213
+
assertThatThrownBy(() -> subject.setContentLanguage(newString[] {})).hasMessage("Further mutation is not allowed: setContentLanguage(String[])");
214
+
assertThatThrownBy(() -> subject.setFileName("filename")).hasMessage("Further mutation is not allowed: setFileName(String)");
215
+
assertThatThrownBy(() -> subject.setDataHandler(mock(DataHandler.class))).hasMessage("Further mutation is not allowed: setDataHandler(DataHandler)");
216
+
assertThatThrownBy(() -> subject.setContent("content", "type")).hasMessage("Further mutation is not allowed: setContent(Object, String)");
217
+
assertThatThrownBy(() -> subject.setText("text")).hasMessage("Further mutation is not allowed: setText(String)");
218
+
assertThatThrownBy(() -> subject.setText("text", "UTF-8")).hasMessage("Further mutation is not allowed: setText(String, String)");
219
+
assertThatThrownBy(() -> subject.setText("text", "UTF-8", "subtype")).hasMessage("Further mutation is not allowed: setText(String, String, String)");
220
+
assertThatThrownBy(() -> subject.setContent(mock(Multipart.class))).hasMessage("Further mutation is not allowed: setContent(Multipart)");
221
+
assertThatThrownBy(() -> subject.setHeader("name", "value")).hasMessage("Further mutation is not allowed: setHeader(String, String)");
222
+
assertThatThrownBy(() -> subject.addHeader("name", "value")).hasMessage("Further mutation is not allowed: addHeader(String, String)");
223
+
assertThatThrownBy(() -> subject.removeHeader("name")).hasMessage("Further mutation is not allowed: removeHeader(String)");
224
+
assertThatThrownBy(() -> subject.addHeaderLine("line")).hasMessage("Further mutation is not allowed: addHeaderLine(String)");
225
+
assertThatThrownBy(() -> subject.setFlags(mock(Flags.class), false)).hasMessage("Further mutation is not allowed: setFlags(Flags, boolean)");
226
+
assertThatThrownBy(() -> subject.setRecipient(TO, newInternetAddress())).hasMessage("Further mutation is not allowed: setRecipient(RecipientType, Address)");
227
+
assertThatThrownBy(() -> subject.addRecipient(TO, newInternetAddress())).hasMessage("Further mutation is not allowed: addRecipient(RecipientType, Address)");
228
+
assertThatThrownBy(() -> subject.setFlag(ANSWERED, true)).hasMessage("Further mutation is not allowed: setFlag(Flag, boolean)");
0 commit comments