Skip to content

Commit dc79635

Browse files
Apply suggestions from code review
Co-authored-by: Hans Aikema <aikebah-github@aikebah.net>
1 parent 945208d commit dc79635

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

ant/src/test/java/org/owasp/dependencycheck/taskdefs/DependencyCheckTaskIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ public void setUp() throws Exception {
4949
@AfterEach
5050
@Override
5151
public void tearDown() throws Exception {
52-
super.tearDown();
5352
if (buildFileRule.getProject() != null) {
5453
if (this.buildFileRule.getProject().getTargets().containsKey("tearDown")) {
5554
this.buildFileRule.getProject().executeTarget("tearDown");
5655
}
5756
}
57+
super.tearDown();
5858
}
5959

6060
/**

cli/src/test/java/org/owasp/dependencycheck/AppTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void testPopulateSettings() throws Exception {
118118
@Test
119119
void testPopulateSettingsException() {
120120
String[] args = {"-invalidPROPERTY"};
121-
Exception exception = assertThrows(UnrecognizedOptionException.class, () -> testBooleanProperties(args, null));
121+
UnrecognizedOptionException exception = assertThrows(UnrecognizedOptionException.class, () -> testBooleanProperties(args, null));
122122
assertTrue(exception.getMessage().contains("Unrecognized option: -invalidPROPERTY"));
123123
}
124124

maven/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
117117
<dependency>
118118
<groupId>org.mockito</groupId>
119119
<artifactId>mockito-core</artifactId>
120-
<version>${mockito.version}</version>
121120
<scope>test</scope>
122121
</dependency>
123122
<dependency>

pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,6 @@ Copyright (c) 2012 - Jeremy Long
523523
<detectJavaApiLink>false</detectJavaApiLink>
524524
</configuration>
525525
</plugin>
526-
<!--
527526
<plugin>
528527
<groupId>org.apache.maven.plugins</groupId>
529528
<artifactId>maven-enforcer-plugin</artifactId>
@@ -578,7 +577,6 @@ Copyright (c) 2012 - Jeremy Long
578577
</execution>
579578
</executions>
580579
</plugin>
581-
-->
582580
<plugin>
583581
<groupId>org.jacoco</groupId>
584582
<artifactId>jacoco-maven-plugin</artifactId>
@@ -958,6 +956,12 @@ Copyright (c) 2012 - Jeremy Long
958956
<version>${mock-server.version}</version>
959957
<scope>test</scope>
960958
</dependency>
959+
<dependency>
960+
<groupId>org.mockito</groupId>
961+
<artifactId>mockito-core</artifactId>
962+
<version>${mockito.version}</version>
963+
<scope>test</scope>
964+
</dependency>
961965
<dependency>
962966
<groupId>org.mockito</groupId>
963967
<artifactId>mockito-junit-jupiter</artifactId>

utils/src/test/java/org/owasp/dependencycheck/utils/ExpectedObjectInputStreamTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ void testResolveClassException() throws Exception {
6666
ByteArrayOutputStream mem = new ByteArrayOutputStream();
6767
byte[] buf;
6868
try (ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(mem))) {
69-
out.writeObject(data);
70-
out.flush();
71-
buf = mem.toByteArray();
72-
}
69+
out.writeObject(data);
70+
out.flush();
71+
buf = mem.toByteArray();
72+
}
7373
ByteArrayInputStream in = new ByteArrayInputStream(buf);
7474
ExpectedObjectInputStream instance = new ExpectedObjectInputStream(in, "java.util.ArrayList", "org.owasp.dependencycheck.utils.SimplePojo");
7575
assertThrows(java.io.InvalidClassException.class, instance::readObject);

0 commit comments

Comments
 (0)