assertThat(profile, nullValue());
}
@Test
public void shouldGetProfile() {
Profile profile = new ProfileUnmarshaller().toModel(loadFile("/profiles/profile.json"));
assertThat(profile.getLanguage(), is("java"));
assertThat(profile.getName(), is("Sonar way"));
assertThat(profile.getParentName(), nullValue());
assertThat(profile.isDefaultProfile(), is(true));
assertThat(profile.getRules().size(), is(116));
Profile.Rule rule1 = profile.getRules().get(0);
assertThat(rule1.getKey(), is("com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck"));
assertThat(rule1.getRepository(), is("checkstyle"));
assertThat(rule1.getInheritance(), nullValue());
assertThat(rule1.getSeverity(), is("MAJOR"));
assertThat(rule1.getParameters().size(), is(0));
assertThat(rule1.getParameter("foo"), nullValue());
Profile.Rule rule2 = profile.getRule("checkstyle", "com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck");
assertThat(rule2.getParameters().size(), is(1));
assertThat(rule2.getParameter("format"), is("^[a-z][a-zA-Z0-9]*$"));
}