Well, it turns out that casting them into View objects is sufficient for unit testing purpose. So the code will be like so
addContactsBtn = (View)viewContacts.findViewById(R.id.action_add);
searchBtn = (View)viewContacts.findViewById(R.id.action_search);