Package org.sonar.server.rule.RuleOperations

Examples of org.sonar.server.rule.RuleOperations.RuleChange


    when(characteristicDao.selectByKey("COMPILER", session)).thenReturn(null);

    try {
      operations.updateRule(
        new RuleChange().setRuleKey(ruleKey).setDebtCharacteristicKey("COMPILER")
          .setDebtRemediationFunction("LINEAR_OFFSET").setDebtRemediationCoefficient("2h").setDebtRemediationOffset("20min"),
        authorizedUserSession
      );
    } catch (Exception e) {
      assertThat(e).isInstanceOf(NotFoundException.class);
View Full Code Here


    CharacteristicDto subCharacteristic = new CharacteristicDto().setId(2).setKey("COMPILER").setName("Compiler").setParentId(1);
    when(characteristicDao.selectByKey("COMPILER", session)).thenReturn(subCharacteristic);

    try {
      operations.updateRule(
        new RuleChange().setRuleKey(ruleKey).setDebtCharacteristicKey("COMPILER")
          .setDebtRemediationFunction("LINEAR").setDebtRemediationCoefficient("foo"),
        authorizedUserSession
      );
    } catch (Exception e) {
      assertThat(e).isInstanceOf(BadRequestException.class).hasMessage("Invalid coefficient: foo (Duration 'foo' is invalid, it should use the following sample format : 2d 10h 15min)");
View Full Code Here

TOP

Related Classes of org.sonar.server.rule.RuleOperations.RuleChange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.