Merge pull request #44 from kemitix/kcr-33-34-35-36-local-variables

KCR33,34,35 & 36 local variables
This commit is contained in:
Paul Campbell 2017-05-29 14:07:53 +01:00 committed by GitHub
commit 94a5faebcb
2 changed files with 9 additions and 19 deletions

View file

@ -25,10 +25,6 @@ public class ReadmeWriterTest {
private ReadmeWriter readmeWriter; private ReadmeWriter readmeWriter;
private TemplateProperties templateProperties;
private OutputProperties outputProperties;
private RulesProperties rulesProperties; private RulesProperties rulesProperties;
@Mock @Mock
@ -37,10 +33,6 @@ public class ReadmeWriterTest {
@Mock @Mock
private ReadmeIndexBuilder indexBuilder; private ReadmeIndexBuilder indexBuilder;
private Path template;
private Path fragments;
private Path readme; private Path readme;
@org.junit.Rule @org.junit.Rule
@ -49,17 +41,17 @@ public class ReadmeWriterTest {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);
template = folder.newFile("README-template.md") final Path template = folder.newFile("README-template.md")
.toPath(); .toPath();
Files.write(template, Arrays.asList("i:%s", "ce:%s", "se:%s", "cd:%s", "sd:%s")); Files.write(template, Arrays.asList("i:%s", "ce:%s", "se:%s", "cd:%s", "sd:%s"));
fragments = folder.newFolder("fragments") final TemplateProperties templateProperties = new TemplateProperties();
templateProperties.setReadmeTemplate(template);
final Path fragments = folder.newFolder("fragments")
.toPath(); .toPath();
templateProperties.setReadmeFragments(fragments);
final OutputProperties outputProperties = new OutputProperties();
readme = folder.newFile("README.md") readme = folder.newFile("README.md")
.toPath(); .toPath();
templateProperties = new TemplateProperties();
templateProperties.setReadmeTemplate(template);
templateProperties.setReadmeFragments(fragments);
outputProperties = new OutputProperties();
outputProperties.setReadme(readme); outputProperties.setReadme(readme);
rulesProperties = new RulesProperties(); rulesProperties = new RulesProperties();
readmeWriter = readmeWriter =

View file

@ -72,8 +72,6 @@ public class DefaultCheckstyleExecutorTest {
@Mock @Mock
private Artifact artifact; private Artifact artifact;
private File artifactFile;
@Mock @Mock
private MavenXpp3Reader mavenXpp3Reader; private MavenXpp3Reader mavenXpp3Reader;
@ -122,8 +120,8 @@ public class DefaultCheckstyleExecutorTest {
.level(level) .level(level)
.build(); .build();
artifactFile = folder.newFile("pom.xml");
given(artifactRepository.find(any())).willReturn(artifact); given(artifactRepository.find(any())).willReturn(artifact);
final File artifactFile = folder.newFile("pom.xml");
given(artifact.getFile()).willReturn(artifactFile); given(artifact.getFile()).willReturn(artifactFile);
given(mavenXpp3Reader.read(any(FileReader.class))).willReturn(pomModel); given(mavenXpp3Reader.read(any(FileReader.class))).willReturn(pomModel);
final Properties properties = new Properties(); final Properties properties = new Properties();