Skip to content

Commit 2f1eb63

Browse files
committed
Start automatic event persistance
1 parent e631f98 commit 2f1eb63

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

src/main/java/com/securenative/SecureNative.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ private SecureNative(SecureNativeOptions options) throws SecureNativeSDKExceptio
3030
throw new SecureNativeSDKException("You must pass your SecureNative api key");
3131
}
3232
this.options = options;
33-
this.apiManager = new ApiManagerImpl(new SecureNativeEventManager(new SecureNativeHTTPClient(options), options), options);
33+
34+
EventManager eventManager = new SecureNativeEventManager(new SecureNativeHTTPClient(options), options);
35+
if(options.getAutoSend()){
36+
eventManager.startEventsPersist();
37+
}
38+
this.apiManager = new ApiManagerImpl(eventManager, options);
3439
Logger.initLogger(options.getLogLevel());
3540
}
3641

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.securenative.utils;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
import java.io.IOException;
6+
import java.net.JarURLConnection;
7+
import java.net.URL;
8+
import java.util.Enumeration;
9+
import java.util.jar.Attributes;
10+
import java.util.jar.Manifest;
11+
12+
public class VersionTest {
13+
14+
@Test
15+
public void testManifest() throws IOException {
16+
URL res = org.junit.Assert.class.getResource(org.junit.Assert.class.getSimpleName() + ".class");
17+
JarURLConnection conn = (JarURLConnection) res.openConnection();
18+
Manifest mf = conn.getManifest();
19+
20+
Attributes atts = mf.getMainAttributes();
21+
for (Object v : atts.values()) {
22+
System.out.println(v);
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)