33
33
import org .junit .BeforeClass ;
34
34
import org .junit .Test ;
35
35
import org .junit .runner .RunWith ;
36
+ import org .slf4j .Logger ;
37
+ import org .slf4j .LoggerFactory ;
36
38
import org .springframework .beans .factory .annotation .Autowired ;
37
39
import org .springframework .boot .test .context .SpringBootTest ;
38
40
import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
39
41
40
42
import com .ericsson .ei .App ;
41
43
import com .ericsson .ei .controller .model .Subscription ;
42
44
import com .ericsson .ei .exception .SubscriptionNotFoundException ;
45
+ import com .ericsson .ei .handlers .test .ObjectHandlerTest ;
43
46
import com .ericsson .ei .mongodbhandler .MongoDBHandler ;
44
47
import com .ericsson .ei .services .ISubscriptionService ;
45
48
import com .fasterxml .jackson .databind .ObjectMapper ;
52
55
@ SpringBootTest (classes = App .class )
53
56
public class SubscriptionServiceTest {
54
57
58
+ final static Logger LOGGER = (Logger ) LoggerFactory .getLogger (SubscriptionServiceTest .class );
59
+
55
60
String subscriptionName ;
56
61
57
62
@ Autowired
@@ -71,7 +76,12 @@ public class SubscriptionServiceTest {
71
76
72
77
@ BeforeClass
73
78
public static void setMongoDB () throws IOException , JSONException {
74
- testsFactory = MongodForTestsFactory .with (Version .V3_4_1 );
79
+ try {
80
+ testsFactory = MongodForTestsFactory .with (Version .V3_4_1 );
81
+ } catch (Exception e ) {
82
+ LOGGER .error (e .getMessage (), e );
83
+ e .printStackTrace ();
84
+ }
75
85
String readFileToString = FileUtils .readFileToString (new File (subscriptionJsonPath ), "UTF-8" );
76
86
jsonArray = new JSONArray (readFileToString );
77
87
mongoClient = testsFactory .newMongo ();
0 commit comments