Skip to content

Commit da4f4cd

Browse files
author
Anders Breid
authored
Refactor InformSubscriber, missed notification for emails (#301)
* Missed notifications is now saved when emails fails to be sent. * Serveral new classes created to split the InformSubscriber class. * Several new test has been created to test the new classes.
1 parent adb6f5d commit da4f4cd

File tree

73 files changed

+2518
-1528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2518
-1528
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ jobs:
5454
#
5555
# Also important that the first test to be run is a Spring Boot Test since spring boot also downloads
5656
# another version of embedded mongo db to avoid race conditions between Spring Boot tests
57-
- mvn -DsomeModule.test.includes="**/QueryServiceTest.java" test -DskipITs -B
58-
- mvn -DsomeModule.test.excludes="**/QueryServiceTest.java" test -DskipITs -B
57+
- mvn -Dsurefire.rerunFailingTestsCount=2 -DsomeModule.test.includes="**/QueryServiceTest.java" test -DskipITs -B
58+
- mvn -Dsurefire.rerunFailingTestsCount=2 -DsomeModule.test.excludes="**/QueryServiceTest.java" test -DskipITs -B
5959
- stage: test
6060
name: integrationTests
6161
script:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<dependency>
7575
<groupId>com.github.eiffel-community</groupId>
7676
<artifactId>eiffel-commons</artifactId>
77-
<version>0.0.12</version>
77+
<version>0.0.13</version>
7878
</dependency>
7979

8080
<dependency>

src/functionaltests/java/com/ericsson/ei/subscriptions/trigger/SubscriptionTriggerSteps.java renamed to src/functionaltests/java/com/ericsson/ei/notifications/trigger/SubscriptionNotificationSteps.java

Lines changed: 190 additions & 76 deletions
Large diffs are not rendered by default.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.ericsson.ei.notifications.trigger;
2+
3+
import org.junit.runner.RunWith;
4+
5+
import cucumber.api.CucumberOptions;
6+
import cucumber.api.junit.Cucumber;
7+
8+
@RunWith(Cucumber.class)
9+
@CucumberOptions(features = "src/functionaltests/resources/features/subscriptionNotification.feature", glue = {
10+
"com.ericsson.ei.notifications.trigger" }, plugin = {
11+
"html:target/cucumber-reports/TestSubscriptionNotificationRunner" })
12+
public class TestSubscriptionNotificationRunner {
13+
14+
}

src/functionaltests/java/com/ericsson/ei/notifications/ttl/TestTTLSteps.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
import com.ericsson.ei.exception.AuthenticationException;
2929
import com.ericsson.ei.handlers.MongoDBHandler;
30-
import com.ericsson.ei.subscription.InformSubscriber;
30+
import com.ericsson.ei.notifications.InformSubscriber;
3131
import com.ericsson.ei.utils.FunctionalTestBase;
3232
import com.ericsson.ei.utils.HttpRequest;
3333
import com.ericsson.ei.utils.HttpRequest.HttpMethod;
@@ -41,11 +41,14 @@
4141
import cucumber.api.java.en.When;
4242

4343
@Ignore
44-
@TestPropertySource(properties = { "notification.ttl.value:1", "aggregated.collection.ttlValue:1",
45-
"notification.failAttempt:1", "spring.data.mongodb.database: TestTTLSteps",
44+
@TestPropertySource(properties = {
45+
"notification.ttl.value:1",
46+
"aggregated.collection.ttlValue:1",
47+
"notification.failAttempt:1",
48+
"spring.data.mongodb.database: TestTTLSteps",
49+
"missedNotificationDataBaseName: TestTTLSteps-missedNotifications",
4650
"rabbitmq.exchange.name: TestTTLSteps-exchange",
47-
"rabbitmq.consumerName: TestTTLStepsConsumer",
48-
"missedNotificationDataBaseName: TestTTLStepsMissedNotification" })
51+
"rabbitmq.consumerName: TestTTLStepsConsumer"})
4952
public class TestTTLSteps extends FunctionalTestBase {
5053
private static final Logger LOGGER = LoggerFactory.getLogger(TestTTLSteps.class);
5154
private static final String BASE_URL = "localhost";

src/functionaltests/java/com/ericsson/ei/query/QueryAggregatedObjectsTestSteps.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@
3232
import cucumber.api.java.en.Then;
3333

3434
@Ignore
35-
@TestPropertySource(properties = { "spring.data.mongodb.database: QueryAggregatedObjectsTestSteps",
35+
@TestPropertySource(properties = {
36+
"spring.data.mongodb.database: QueryAggregatedObjectsTestSteps",
37+
"missedNotificationDataBaseName: QueryAggregatedObjectsTestSteps-missedNotifications",
3638
"rabbitmq.exchange.name: QueryAggregatedObjectsTestSteps-exchange",
37-
"rabbitmq.consumerName: rabbitmq.consumerName: QueryAggregatedObjectsTestStepsConsumer" })
39+
"rabbitmq.consumerName: QueryAggregatedObjectsTestStepsConsumer" })
3840
@AutoConfigureMockMvc
3941
public class QueryAggregatedObjectsTestSteps extends FunctionalTestBase {
4042

src/functionaltests/java/com/ericsson/ei/rabbitmq/RabbitMQTestConnectionSteps.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@
3535
import cucumber.api.java.en.When;
3636

3737
@Ignore
38-
@TestPropertySource(properties = { "spring.data.mongodb.database: RabbitMQTestConnectionSteps",
38+
@TestPropertySource(properties = {
39+
"spring.data.mongodb.database: RabbitMQTestConnectionSteps",
40+
"missedNotificationDataBaseName: RabbitMQTestConnectionSteps-missedNotifications",
3941
"rabbitmq.exchange.name: RabbitMQTestConnectionSteps-exchange",
40-
"rabbitmq.consumerName: rabbitmq.consumerName: RabbitMQTestConnectionStepsConsumer" })
42+
"rabbitmq.consumerName: RabbitMQTestConnectionStepsConsumer" })
4143
public class RabbitMQTestConnectionSteps extends FunctionalTestBase {
4244

4345
@Value("${rabbitmq.port}")

src/functionaltests/java/com/ericsson/ei/rules/RuleCheckSteps.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
import cucumber.api.java.en.When;
2727

2828
@Ignore
29-
@TestPropertySource(properties = { "spring.data.mongodb.database: RuleCheckSteps",
29+
@TestPropertySource(properties = {
30+
"spring.data.mongodb.database: RuleCheckSteps",
31+
"missedNotificationDataBaseName: RuleCheckSteps-missedNotifications",
3032
"rabbitmq.exchange.name: RuleCheckSteps-exchange",
31-
"rabbitmq.consumerName: rabbitmq.consumerName: RuleCheckStepsConsumer" })
33+
"rabbitmq.consumerName: RuleCheckStepsConsumer" })
3234
public class RuleCheckSteps extends FunctionalTestBase {
3335

3436
private static final String TEST_RESOURCES_PATH = "src/test/resources";

src/functionaltests/java/com/ericsson/ei/rules/TestRuleCheckRunner.java renamed to src/functionaltests/java/com/ericsson/ei/rules/RuleCheckTestRunner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
@RunWith(Cucumber.class)
88
@CucumberOptions(features = "src/functionaltests/resources/features/ruleCheck.feature", glue = {
99
"com.ericsson.ei.rules" }, plugin = { "pretty", "html:target/cucumber-reports/TestRuleCheckRunner" })
10-
public class TestRuleCheckRunner {
10+
public class RuleCheckTestRunner {
1111

1212
}

src/functionaltests/java/com/ericsson/ei/rules/RulesHandlerSteps.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
import cucumber.api.java.en.Then;
2222

2323
@Ignore
24-
@TestPropertySource(properties = { "spring.data.mongodb.database: RulesHandlerSteps",
24+
@TestPropertySource(properties = {
25+
"spring.data.mongodb.database: RulesHandlerSteps",
26+
"missedNotificationDataBaseName: RulesHandlerSteps-missedNotifications",
2527
"rabbitmq.exchange.name: RulesHandlerSteps-exchange",
26-
"rabbitmq.consumerName: rabbitmq.consumerName: RulesHandlerStepsConsumer" })
28+
"rabbitmq.consumerName: RulesHandlerStepsConsumer" })
2729
public class RulesHandlerSteps {
2830

2931
private ClientAndServer restServer;

0 commit comments

Comments
 (0)