@Test
public void testUpgradeDisabledByDefault() throws Exception {

  Service service = createService();
  ServiceClient client = MockServiceClient.create(rule, service, false);
  //upgrade the service
  service.setVersion("v2");
  try {
    client.initiateUpgrade(service);
  } catch (YarnException ex) {
    Assert.assertEquals(ErrorStrings.SERVICE_UPGRADE_DISABLED,
        ex.getMessage());
    return;
  }
  Assert.fail();
}