forked from phoedos/pmd
Fixed Code Climate renderer test
This commit is contained in:
@ -72,13 +72,17 @@ public class CodeClimateRenderer extends AbstractIncrementingRenderer {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue.remediation_points = REMEDIATION_POINTS_DEFAULT;
|
||||||
if(rule.hasDescriptor(CODECLIMATE_REMEDIATION_MULTIPLIER)) {
|
if(rule.hasDescriptor(CODECLIMATE_REMEDIATION_MULTIPLIER)) {
|
||||||
issue.remediation_points = rule.getProperty(CODECLIMATE_REMEDIATION_MULTIPLIER) * REMEDIATION_POINTS_DEFAULT;
|
issue.remediation_points *= rule.getProperty(CODECLIMATE_REMEDIATION_MULTIPLIER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rule.hasDescriptor(CODECLIMATE_CATEGORIES)) {
|
if(rule.hasDescriptor(CODECLIMATE_CATEGORIES)) {
|
||||||
issue.categories = rule.getProperty(CODECLIMATE_CATEGORIES);
|
issue.categories = rule.getProperty(CODECLIMATE_CATEGORIES);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
issue.categories = new String[]{ "Style" };
|
||||||
|
}
|
||||||
|
|
||||||
return issue;
|
return issue;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ public class CodeClimateRendererTest extends AbstractRendererTst {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getExpected() {
|
public String getExpected() {
|
||||||
return "{\"type\":\"issue\",\"check_name\":\"Foo\",\"description\":\"blah\",\"content\":{\"body\":\"desc\"},\"categories\":[\"Style\"],\"location\":{\"path\":\"n/a\",\"lines\":{\"begin\":1,\"end\":1}},\"severity\":\"info\"}" + PMD.EOL;
|
return "{\"type\":\"issue\",\"check_name\":\"Foo\",\"description\":\"blah\",\"content\":{\"body\":\"desc\"},\"categories\":[\"Style\"],\"location\":{\"path\":\"n/a\",\"lines\":{\"begin\":1,\"end\":1}},\"severity\":\"info\",\"remediation_points\":50000}" + "\u0000" + PMD.EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -24,8 +24,8 @@ public class CodeClimateRendererTest extends AbstractRendererTst {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getExpectedMultiple() {
|
public String getExpectedMultiple() {
|
||||||
return "{\"type\":\"issue\",\"check_name\":\"Foo\",\"description\":\"blah\",\"content\":{\"body\":\"desc\"},\"categories\":[\"Style\"],\"location\":{\"path\":\"n/a\",\"lines\":{\"begin\":1,\"end\":1}},\"severity\":\"info\"}" + PMD.EOL +
|
return "{\"type\":\"issue\",\"check_name\":\"Foo\",\"description\":\"blah\",\"content\":{\"body\":\"desc\"},\"categories\":[\"Style\"],\"location\":{\"path\":\"n/a\",\"lines\":{\"begin\":1,\"end\":1}},\"severity\":\"info\",\"remediation_points\":50000}" + "\u0000" + PMD.EOL +
|
||||||
"{\"type\":\"issue\",\"check_name\":\"Foo\",\"description\":\"blah\",\"content\":{\"body\":\"desc\"},\"categories\":[\"Style\"],\"location\":{\"path\":\"n/a\",\"lines\":{\"begin\":1,\"end\":1}},\"severity\":\"info\"}" + PMD.EOL;
|
"{\"type\":\"issue\",\"check_name\":\"Foo\",\"description\":\"blah\",\"content\":{\"body\":\"desc\"},\"categories\":[\"Style\"],\"location\":{\"path\":\"n/a\",\"lines\":{\"begin\":1,\"end\":1}},\"severity\":\"info\",\"remediation_points\":50000}" + "\u0000" + PMD.EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static junit.framework.Test suite() {
|
public static junit.framework.Test suite() {
|
||||||
|
Reference in New Issue
Block a user