@Test
public void soundTest() {

    //Mock decorator context
    final boolean[] marker = new boolean[1];
    final String ringtone = "adara";
    Context context = mock(Context.class);
    Resources res = mock(Resources.class);
    NotificationSoundDecorator decorator = new NotificationSoundDecorator(context, null);
    when(context.getResources()).thenReturn(res);
    when(res.getIdentifier(ringtone, "raw", context.getPackageName())).thenReturn(1);
    when(res.getResourcePackageName(1)).thenReturn("com.mobgen.halo.android.sdk");
    when(res.getResourceTypeName(1)).thenReturn("raw");
    when(res.getResourceEntryName(1)).thenReturn(ringtone);
    Bundle bundle = BundleTestUtils.builder().putString("sound", ringtone).build();
    when(getBuilder().setSound(any(Uri.class))).then(new Answer<Object>() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            marker[0] = true;
            Assert.assertEquals(Uri.parse("android.resource://com.mobgen.halo.android.sdk/raw/" + ringtone), invocation.getArguments()[0]);
            return null;
        }
    });
    decorator.decorate(getBuilder(), bundle);
    Assert.assertTrue(marker[0]);
}