Skip to content

Commit 50bf34a

Browse files
committed
fix jacoco on payments and broken tests
1 parent 081e2dc commit 50bf34a

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

ipp-v3-java-devkit/src/test/java/com/intuit/ipp/serialization/BatchItemRequestSerializerTest.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import java.io.OutputStream;
3939
import java.lang.reflect.Method;
4040
import java.math.BigDecimal;
41+
import java.text.ParseException;
42+
import java.text.SimpleDateFormat;
4143
import java.util.Calendar;
4244
import java.util.Collections;
4345
import java.util.Date;
@@ -239,8 +241,17 @@ private Invoice getInvoiceObject() {
239241
}
240242

241243
private Date getDate() {
242-
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
243-
calendar.setTimeInMillis(1546300800666L);
244+
SimpleDateFormat sdf = new SimpleDateFormat("dd-M-yyyy hh:mm:ss");
245+
String dateInString = "01-01-2019 00:00:00";
246+
Date date;
247+
Calendar calendar = Calendar.getInstance();
248+
try {
249+
date = sdf.parse(dateInString);
250+
calendar.setTime(date);
251+
} catch (ParseException e) {
252+
// TODO Auto-generated catch block
253+
e.printStackTrace();
254+
}
244255
return calendar.getTime();
245256
}
246257

payments-api/pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@
101101
</execution>
102102
</executions>
103103
</plugin>
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-surefire-plugin</artifactId>
107+
<version>3.0.0-M3</version>
108+
<configuration>
109+
<argLine>
110+
-Djdk.attach.allowAttachSelf <!-- required to run test with jmockit on JDK 9 -->
111+
</argLine>
112+
</configuration>
113+
</plugin>
104114
<plugin>
105115
<groupId>org.jacoco</groupId>
106116
<artifactId>jacoco-maven-plugin</artifactId>
@@ -142,16 +152,6 @@
142152
</execution>
143153
</executions>
144154
</plugin>
145-
<plugin>
146-
<groupId>org.apache.maven.plugins</groupId>
147-
<artifactId>maven-surefire-plugin</artifactId>
148-
<version>3.0.0-M3</version>
149-
<configuration>
150-
<argLine>
151-
-Djdk.attach.allowAttachSelf <!-- required to run test with jmockit on JDK 9 -->
152-
</argLine>
153-
</configuration>
154-
</plugin>
155155
</plugins>
156156
</build>
157157

0 commit comments

Comments
 (0)