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

    ChangePrimaryType changePrimaryType = new ChangePrimaryType(newPrimaryType);
    String result = changePrimaryType.doAction(resource);
    verify(node, times(1)).setPrimaryType(newPrimaryType);
    assertEquals("Updated jcr:primaryType to " + newPrimaryType, result);
}