@Test
public void test_doAction_nodeIsNull() throws PersistenceException, RepositoryException {

    when(resource.adaptTo(Node.class)).thenReturn(null);
    ChangePrimaryType changePrimaryType = new ChangePrimaryType(newPrimaryType);
    changePrimaryType.doAction(resource);
    verify(node, never()).setPrimaryType(newPrimaryType);
}