Skip to content

Commit 6d3701f

Browse files
Codacy report fix (#438)
* Use jacoco instead of cobertura
1 parent 6fc2ebb commit 6d3701f

File tree

5 files changed

+31
-17
lines changed

5 files changed

+31
-17
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ jobs:
4343
name: report_coverage
4444
# Generating test coverage report and publishing to Codacy
4545
script:
46-
- mvn cobertura:cobertura -B
46+
- mvn jacoco:prepare-agent test jacoco:report -B
4747
- curl -Ls -o codacy-coverage-reporter-assembly.jar https://github.com/codacy/codacy-coverage-reporter/releases/download/6.0.2/codacy-coverage-reporter-6.0.2-assembly.jar
48-
- java -jar codacy-coverage-reporter-assembly.jar report -l Java -r target/site/cobertura/coverage.xml
48+
- java -jar codacy-coverage-reporter-assembly.jar report -l Java -r target/site/jacoco/jacoco.xml

pom.xml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@
426426
<version>${springBootVersion}</version>
427427
</plugin>
428428

429-
<!-- PhoenixNAP RAML Code Generator plugin used to generate sources
429+
<!-- PhoenixNAP RAML Code Generator plugin used to generate sources
430430
from raml -->
431431
<plugin>
432432
<groupId>com.phoenixnap.oss</groupId>
@@ -504,9 +504,9 @@
504504
<groupId>org.apache.maven.plugins</groupId>
505505
<artifactId>maven-surefire-plugin</artifactId>
506506
<version>2.22.2</version>
507-
<!-- Surefire tests are split into parallel and sequential tests.
508-
If the test is sensitive to run in parallel it should be
509-
excluded from that execution and moved into sequential. -->
507+
<!-- Surefire tests are split into parallel and sequential
508+
tests. If the test is sensitive to run in parallel it should be excluded
509+
from that execution and moved into sequential. -->
510510
<executions>
511511
<execution>
512512
<id>default-test</id>
@@ -603,15 +603,29 @@
603603
</configuration>
604604
</plugin>
605605
<plugin>
606-
<groupId>org.codehaus.mojo</groupId>
607-
<artifactId>cobertura-maven-plugin</artifactId>
608-
<version>2.7</version>
606+
<groupId>org.jacoco</groupId>
607+
<artifactId>jacoco-maven-plugin</artifactId>
608+
<version>0.8.5</version>
609609
<configuration>
610-
<formats>
611-
<format>html</format>
612-
<format>xml</format>
613-
</formats>
610+
<excludes>
611+
<exclude>com/ericsson/ei/controller/model/*</exclude>
612+
</excludes>
614613
</configuration>
614+
<executions>
615+
<execution>
616+
<id>jacoco-initialize</id>
617+
<goals>
618+
<goal>prepare-agent</goal>
619+
</goals>
620+
</execution>
621+
<execution>
622+
<id>jacoco-site</id>
623+
<phase>package</phase>
624+
<goals>
625+
<goal>report</goal>
626+
</goals>
627+
</execution>
628+
</executions>
615629
</plugin>
616630
</plugins>
617631
</build>

src/functionaltests/java/com/ericsson/ei/notifications/trigger/SubscriptionNotificationSteps.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public class SubscriptionNotificationSteps extends FunctionalTestBase {
9393
@Autowired
9494
private MongoDBHandler mongoDBHandler;
9595

96-
@InjectMocks
96+
@Autowired
9797
private EmailSender emailSender;
9898

9999
private SimpleSmtpServer smtpServer;
@@ -195,12 +195,13 @@ public void send_one_previous_event() throws Throwable {
195195
eventManager.sendEiffelEvents(EIFFEL_EVENTS_JSON_PATH, eventNamesToSend);
196196
}
197197

198-
@Then("^Then Notification email contains ('(.*?)') and ('(.*?)') values")
198+
@Then("^Notification email contains '(.*)' and '(.*)' values")
199199
public void notification_email_contains_expected_values(String sender, String subject) {
200200
assertEquals(sender, emailSender.getSender());
201201
assertEquals(subject, emailSender.getSubject());
202202
}
203203

204+
204205
@Then("^Mail subscriptions were triggered$")
205206
public void mail_subscriptions_were_triggered() {
206207
LOGGER.debug("Verifying received emails.");

src/functionaltests/resources/features/subscriptionNotification.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Feature: Test Subscription Trigger
88
And Subscriptions are created
99
When I send Eiffel events
1010
And Wait for EI to aggregate objects
11-
Then Notification email contains <our expected> values
1211
Then Mail subscriptions were triggered
1312
And Rest subscriptions were triggered
1413
When I send one previous event again

src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ failed.notifications.collection.name: failed_notifications
4545
failed.notifications.collection.ttl: 600
4646
notification.retry: 3
4747

48-
email.sender: noreply@ericsson.com
48+
email.sender: noreply@domain.com
4949
email.subject: Email Subscription Notification
5050

5151
spring.mail.host:

0 commit comments

Comments
 (0)