Skip to content

Commit 555d451

Browse files
author
Vasile Baluta
committed
fix null pointer exception
1 parent 8f1636c commit 555d451

File tree

6 files changed

+13
-23
lines changed

6 files changed

+13
-23
lines changed

src/main/java/com/ericsson/ei/controller/QueryAggregatedObjectController.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
package com.ericsson.ei.controller;
33

4-
import com.ericsson.ei.controller.model.QueryResponse;
54
import org.springframework.http.ResponseEntity;
65
import org.springframework.web.bind.annotation.RequestMapping;
76
import org.springframework.web.bind.annotation.RequestMethod;

src/main/java/com/ericsson/ei/controller/QueryMissedNotificationController.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
package com.ericsson.ei.controller;
33

4-
import com.ericsson.ei.controller.model.QueryResponse;
54
import org.springframework.http.ResponseEntity;
65
import org.springframework.web.bind.annotation.RequestMapping;
76
import org.springframework.web.bind.annotation.RequestMethod;

src/main/java/com/ericsson/ei/controller/RuleCheckController.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
package com.ericsson.ei.controller;
33

44
import javax.validation.Valid;
5-
import com.ericsson.ei.controller.model.RuleCheckBody;
65
import org.springframework.http.ResponseEntity;
76
import org.springframework.web.bind.annotation.RequestBody;
87
import org.springframework.web.bind.annotation.RequestMapping;

src/main/java/com/ericsson/ei/controller/SubscriptionController.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public interface SubscriptionController {
2626
*
2727
*/
2828
@RequestMapping(value = "", method = RequestMethod.GET)
29-
public ResponseEntity<List<com.ericsson.ei.controller.model.Subscription>> getSubscriptions();
29+
public ResponseEntity<List<String>> getSubscriptions();
3030

3131
/**
3232
* Takes the subscription rules, the name for subscription and the user name of the person registering this subscription and saves the subscription in subscription database. The name needs to be unique.
@@ -36,34 +36,34 @@ public interface SubscriptionController {
3636
public ResponseEntity<?> createSubscription(
3737
@Valid
3838
@RequestBody
39-
List<com.ericsson.ei.controller.model.Subscription> subscription);
39+
List<String> string);
4040

4141
/**
4242
* Modify an existing Subscription.
4343
*
4444
*/
4545
@RequestMapping(value = "", method = RequestMethod.PUT)
46-
public ResponseEntity<com.ericsson.ei.controller.model.SubscriptionResponse> updateSubscriptions(
46+
public ResponseEntity<SubscriptionResponse> updateSubscriptions(
4747
@Valid
4848
@RequestBody
49-
List<com.ericsson.ei.controller.model.Subscription> subscription);
49+
List<String> string);
5050

5151
/**
5252
* Returns the subscription rules for given subscription name.
5353
*
5454
*/
5555
@RequestMapping(value = "/{subscriptionName}", method = RequestMethod.GET)
56-
public ResponseEntity<List<com.ericsson.ei.controller.model.Subscription>> getSubscriptionById(
56+
public ResponseEntity<List<String>> getSubscriptionById(
5757
@PathVariable(required = false)
58-
String subscriptionName);
58+
java.lang.String subscriptionName);
5959

6060
/**
6161
* Removes the subscription from the database.
6262
*
6363
*/
6464
@RequestMapping(value = "/{subscriptionName}", method = RequestMethod.DELETE)
65-
public ResponseEntity<com.ericsson.ei.controller.model.SubscriptionResponse> deleteSubscriptionById(
65+
public ResponseEntity<SubscriptionResponse> deleteSubscriptionById(
6666
@PathVariable(required = false)
67-
String subscriptionName);
67+
java.lang.String subscriptionName);
6868

6969
}

src/test/java/com/ericsson/ei/flowtests/FlowTestBase.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ public abstract class FlowTestBase extends AbstractTestExecutionListener {
7777

7878
private static ObjectMapper objectMapper = new ObjectMapper();
7979

80-
// final FlowTestConfigs configs = new FlowTestConfigs();
81-
8280
private static HashMap<String, FlowTestConfigs> configsMap = new HashMap<String, FlowTestConfigs>();
8381

8482
@Override
@@ -90,11 +88,6 @@ public void beforeTestClass(TestContext testContext) throws Exception {
9088
getFlowTestConfigs().init();
9189
}
9290

93-
// @BeforeClass
94-
// public static void setUp() throws Exception {
95-
//
96-
// }
97-
9891
@PostConstruct
9992
public void init() throws Exception {
10093
mongoDBHandler.setMongoClient(getFlowTestConfigs().getMongoClient());
@@ -104,7 +97,6 @@ public void init() throws Exception {
10497

10598
protected FlowTestConfigs getFlowTestConfigs() {
10699
return configsMap.get(getClasName());
107-
// return configs;
108100
}
109101

110102
private void createFlowTestConfigs() {

src/test/java/com/ericsson/ei/subscription/SubscriptionServiceTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ public void initMocks() {
8888

8989
@AfterClass
9090
public static void tearDownMongoDB() throws Exception {
91-
testsFactory.shutdown();
92-
mongoClient.close();
91+
if (testsFactory != null)
92+
testsFactory.shutdown();
93+
if (mongoClient != null)
94+
mongoClient.close();
9395
}
9496

9597
@Test
@@ -123,8 +125,7 @@ public void testUpdateSubscription() {
123125
// the subscription(subscriptionName=Subscription_Test_Modify)
124126
subscription = mapper.readValue(jsonArray.getJSONObject(1).toString(), Subscription.class);
125127
String expectedModifiedSubscriptionName = subscription2.getSubscriptionName();
126-
boolean addSubscription = subscriptionService.modifySubscription(subscription,
127-
subscriptionName);
128+
boolean addSubscription = subscriptionService.modifySubscription(subscription, subscriptionName);
128129

129130
// test update done successfully
130131
assertEquals(addSubscription, true);

0 commit comments

Comments
 (0)