1package com.cheogram.android;
2
3import static org.junit.Assert.assertNotNull;
4
5import android.app.NotificationChannel;
6import android.app.NotificationManager;
7import android.content.Context;
8import android.os.Build;
9
10import org.junit.Test;
11import org.junit.runner.RunWith;
12import org.robolectric.Robolectric;
13import org.robolectric.RobolectricTestRunner;
14import org.robolectric.RuntimeEnvironment;
15import org.robolectric.annotation.Config;
16import org.robolectric.annotation.ConscryptMode;
17
18import eu.siacs.conversations.Conversations;
19
20@RunWith(RobolectricTestRunner.class)
21@Config(sdk = Build.VERSION_CODES.TIRAMISU, application = Conversations.class)
22@ConscryptMode(ConscryptMode.Mode.OFF)
23public class DownloadDefaultStickersTest {
24
25 @Test
26 public void testBackupChannelExistsAfterOnCreate() {
27 Robolectric.buildService(DownloadDefaultStickers.class).create().get();
28
29 NotificationManager nm = (NotificationManager)
30 RuntimeEnvironment.getApplication()
31 .getSystemService(Context.NOTIFICATION_SERVICE);
32
33 NotificationChannel channel = nm.getNotificationChannel("backup");
34 assertNotNull("backup channel should exist after onCreate", channel);
35 }
36}