1212import java .util .List ;
1313import java .util .Map ;
1414
15+ import androidx .annotation .NonNull ;
16+ import kotlinx .coroutines .flow .Flow ;
1517import net .thunderbird .core .android .testing .RobolectricTest ;
1618import net .thunderbird .core .android .account .QuoteStyle ;
1719import com .fsck .k9 .CoreResourceProvider ;
3133import com .fsck .k9 .message .quote .InsertableHtmlContent ;
3234import net .thunderbird .core .logging .legacy .Log ;
3335import net .thunderbird .core .logging .testing .TestLogger ;
36+ import net .thunderbird .core .preference .AppTheme ;
37+ import net .thunderbird .core .preference .BackgroundSync ;
38+ import net .thunderbird .core .preference .GeneralSettings ;
39+ import net .thunderbird .core .preference .GeneralSettingsManager ;
40+ import net .thunderbird .core .preference .SubTheme ;
41+ import net .thunderbird .core .preference .privacy .PrivacySettings ;
3442import org .junit .Before ;
3543import org .junit .Test ;
3644import org .mockito .ArgumentCaptor ;
@@ -197,6 +205,183 @@ public class MessageBuilderTest extends RobolectricTest {
197205 private BoundaryGenerator boundaryGenerator ;
198206 private CoreResourceProvider resourceProvider = new TestCoreResourceProvider ();
199207 private Callback callback ;
208+ private final GeneralSettingsManager fakeSettingsManager = new GeneralSettingsManager () {
209+ @ Override
210+ public void setIsHideTimeZone (boolean isHideTimeZone ) {
211+ throw new UnsupportedOperationException ("not implemented" );
212+ }
213+
214+ @ NonNull
215+ @ Override
216+ public PrivacySettings getPrivacySettings () {
217+ throw new UnsupportedOperationException ("not implemented" );
218+ }
219+
220+ @ Override
221+ public void setIsQuietTimeEnabled (boolean isQuietTimeEnabled ) {
222+ throw new UnsupportedOperationException ("not implemented" );
223+ }
224+
225+ @ Override
226+ public void setQuietTimeStarts (@ NonNull String quietTimeStarts ) {
227+ throw new UnsupportedOperationException ("not implemented" );
228+ }
229+
230+ @ Override
231+ public void setQuietTimeEnds (@ NonNull String quietTimeEnds ) {
232+ throw new UnsupportedOperationException ("not implemented" );
233+ }
234+
235+ @ NonNull
236+ @ Override
237+ public GeneralSettings getSettings () {
238+ return new GeneralSettings (
239+ BackgroundSync .NEVER ,
240+ false ,
241+ AppTheme .FOLLOW_SYSTEM ,
242+ SubTheme .USE_GLOBAL ,
243+ SubTheme .USE_GLOBAL ,
244+ false ,
245+ false ,
246+ false ,
247+ false ,
248+ false ,
249+ false ,
250+ false ,
251+ false ,
252+ false ,
253+ false ,
254+ false ,
255+ false ,
256+ false ,
257+ false ,
258+ false ,
259+ false ,
260+ false ,
261+ "07:00" ,
262+ "07:00" ,
263+ false ,
264+ false ,
265+ new PrivacySettings (false , false )
266+ );
267+ }
268+
269+ @ NonNull
270+ @ Override
271+ public Flow <GeneralSettings > getSettingsFlow () {
272+ throw new UnsupportedOperationException ("not implemented" );
273+ }
274+
275+ @ Override
276+ public void setShowRecentChanges (boolean showRecentChanges ) {
277+ throw new UnsupportedOperationException ("not implemented" );
278+ }
279+
280+ @ Override
281+ public void setAppTheme (@ NonNull AppTheme appTheme ) {
282+ throw new UnsupportedOperationException ("not implemented" );
283+ }
284+
285+ @ Override
286+ public void setMessageViewTheme (@ NonNull SubTheme subTheme ) {
287+ throw new UnsupportedOperationException ("not implemented" );
288+ }
289+
290+ @ Override
291+ public void setMessageComposeTheme (@ NonNull SubTheme subTheme ) {
292+ throw new UnsupportedOperationException ("not implemented" );
293+ }
294+
295+ @ Override
296+ public void setFixedMessageViewTheme (boolean fixedMessageViewTheme ) {
297+ throw new UnsupportedOperationException ("not implemented" );
298+ }
299+
300+ @ Override
301+ public void setIsShowUnifiedInbox (boolean isShowUnifiedInbox ) {
302+ throw new UnsupportedOperationException ("not implemented" );
303+ }
304+
305+ @ Override
306+ public void setIsShowStarredCount (boolean isShowStarredCount ) {
307+ throw new UnsupportedOperationException ("not implemented" );
308+ }
309+
310+ @ Override
311+ public void setIsShowMessageListStars (boolean isShowMessageListStars ) {
312+ throw new UnsupportedOperationException ("not implemented" );
313+ }
314+
315+ @ Override
316+ public void setIsShowAnimations (boolean isShowAnimations ) {
317+ throw new UnsupportedOperationException ("not implemented" );
318+ }
319+
320+ @ Override
321+ public void setIsShowCorrespondentNames (boolean isShowCorrespondentNames ) {
322+ throw new UnsupportedOperationException ("not implemented" );
323+ }
324+
325+ @ Override
326+ public void setSetupArchiveShouldNotShowAgain (boolean shouldShowSetupArchiveFolderDialog ) {
327+ throw new UnsupportedOperationException ("not implemented" );
328+ }
329+
330+ @ Override
331+ public void setIsMessageListSenderAboveSubject (boolean isMessageListSenderAboveSubject ) {
332+ throw new UnsupportedOperationException ("not implemented" );
333+ }
334+
335+ @ Override
336+ public void setIsShowContactName (boolean isShowContactName ) {
337+ throw new UnsupportedOperationException ("not implemented" );
338+ }
339+
340+ @ Override
341+ public void setIsShowContactPicture (boolean isShowContactPicture ) {
342+ throw new UnsupportedOperationException ("not implemented" );
343+ }
344+
345+ @ Override
346+ public void setIsChangeContactNameColor (boolean isChangeContactNameColor ) {
347+ throw new UnsupportedOperationException ("not implemented" );
348+ }
349+
350+ @ Override
351+ public void setIsColorizeMissingContactPictures (boolean isColorizeMissingContactPictures ) {
352+ throw new UnsupportedOperationException ("not implemented" );
353+ }
354+
355+ @ Override
356+ public void setIsUseBackgroundAsUnreadIndicator (boolean isUseBackgroundAsUnreadIndicator ) {
357+ throw new UnsupportedOperationException ("not implemented" );
358+ }
359+
360+ @ Override
361+ public void setIsShowComposeButtonOnMessageList (boolean isShowComposeButtonOnMessageList ) {
362+ throw new UnsupportedOperationException ("not implemented" );
363+ }
364+
365+ @ Override
366+ public void setIsThreadedViewEnabled (boolean isThreadedViewEnabled ) {
367+ throw new UnsupportedOperationException ("not implemented" );
368+ }
369+
370+ @ Override
371+ public void setIsUseMessageViewFixedWidthFont (boolean isUseMessageViewFixedWidthFont ) {
372+ throw new UnsupportedOperationException ("not implemented" );
373+ }
374+
375+ @ Override
376+ public void setIsAutoFitWidth (boolean isAutoFitWidth ) {
377+ throw new UnsupportedOperationException ("not implemented" );
378+ }
379+
380+ @ Override
381+ public void setIsHideUserAgent (boolean isHideUserAgent ) {
382+ throw new UnsupportedOperationException ("not implemented" );
383+ }
384+ };
200385
201386
202387 @ Before
@@ -345,7 +530,7 @@ public void build_detachAndReattach_shouldSucceed() throws MessagingException {
345530
346531 @ Test
347532 public void buildWithException_shouldThrow () throws MessagingException {
348- MessageBuilder messageBuilder = new SimpleMessageBuilder (messageIdGenerator , boundaryGenerator , resourceProvider ) {
533+ MessageBuilder messageBuilder = new SimpleMessageBuilder (messageIdGenerator , boundaryGenerator , resourceProvider , fakeSettingsManager ) {
349534 @ Override
350535 protected void buildMessageInternal () {
351536 queueMessageBuildException (new MessagingException ("expected error" ));
@@ -361,7 +546,7 @@ protected void buildMessageInternal() {
361546 @ Test
362547 public void buildWithException_detachAndReattach_shouldThrow () throws MessagingException {
363548 Callback anotherCallback = mock (Callback .class );
364- MessageBuilder messageBuilder = new SimpleMessageBuilder (messageIdGenerator , boundaryGenerator , resourceProvider ) {
549+ MessageBuilder messageBuilder = new SimpleMessageBuilder (messageIdGenerator , boundaryGenerator , resourceProvider , fakeSettingsManager ) {
365550 @ Override
366551 protected void buildMessageInternal () {
367552 queueMessageBuildException (new MessagingException ("expected error" ));
@@ -436,7 +621,7 @@ public boolean isInternalAttachment() {
436621
437622 private MessageBuilder createSimpleMessageBuilder () {
438623 Identity identity = createIdentity ();
439- return new SimpleMessageBuilder (messageIdGenerator , boundaryGenerator , resourceProvider )
624+ return new SimpleMessageBuilder (messageIdGenerator , boundaryGenerator , resourceProvider , fakeSettingsManager )
440625 .setSubject (TEST_SUBJECT )
441626 .setSentDate (SENT_DATE )
442627 .setHideTimeZone (true )
0 commit comments