Revision 45348
Added by Claudio Atzori over 6 years ago
modules/dnet-download-service/trunk/src/test/java/DownloadWorkerTest.java | ||
---|---|---|
7 | 7 |
import eu.dnetlib.data.objectstore.modular.ObjectStoreRecord; |
8 | 8 |
import eu.dnetlib.data.objectstore.modular.connector.ObjectStore; |
9 | 9 |
import eu.dnetlib.data.objectstore.rmi.Protocols; |
10 |
import org.bouncycastle.jce.provider.BouncyCastleProvider; |
|
10 |
|
|
11 | 11 |
import org.junit.Before; |
12 |
import org.junit.Ignore; |
|
12 | 13 |
import org.junit.Test; |
13 | 14 |
import org.junit.runner.RunWith; |
14 | 15 |
import org.mockito.Mock; |
15 |
import org.mockito.runners.MockitoJUnitRunner;
|
|
16 |
import org.mockito.junit.MockitoJUnitRunner;
|
|
16 | 17 |
|
17 | 18 |
import static org.junit.Assert.assertEquals; |
18 | 19 |
import static org.mockito.Matchers.any; |
... | ... | |
31 | 32 |
|
32 | 33 |
@Before |
33 | 34 |
public void prepare() throws Exception{ |
34 |
Security.insertProviderAt(new BouncyCastleProvider(),1); |
|
35 |
System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2"); |
|
35 |
//Security.insertProviderAt(new BouncyCastleProvider(),1);
|
|
36 |
//System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
|
|
36 | 37 |
reportMap = new DownloadReportMap(); |
37 | 38 |
|
38 | 39 |
when(objectStore.feedObjectRecord(any(ObjectStoreRecord.class))).thenReturn("OK"); |
... | ... | |
47 | 48 |
}); |
48 | 49 |
} |
49 | 50 |
|
51 |
@Ignore |
|
50 | 52 |
@Test |
51 | 53 |
public void testSSL(){ |
52 | 54 |
String url = "https://econstor.eu/bitstream/10419/45606/1/658945068.pdf"; |
modules/dnet-download-service/trunk/src/main/java/eu/dnetlib/data/download/DownloadServiceImpl.java | ||
---|---|---|
19 | 19 |
import eu.dnetlib.enabling.tools.blackboard.NotificationHandler; |
20 | 20 |
import org.apache.commons.logging.Log; |
21 | 21 |
import org.apache.commons.logging.LogFactory; |
22 |
import org.bouncycastle.jce.provider.BouncyCastleProvider; |
|
23 | 22 |
import org.springframework.beans.factory.annotation.Required; |
24 | 23 |
import org.springframework.beans.factory.annotation.Value; |
25 | 24 |
|
... | ... | |
102 | 101 |
} |
103 | 102 |
}).start(); |
104 | 103 |
} |
105 |
Security.insertProviderAt(new BouncyCastleProvider(),1); |
|
106 |
System.setProperty("https.protocols", httpsProtocols); |
|
104 |
//Security.insertProviderAt(new BouncyCastleProvider(),1);
|
|
105 |
//System.setProperty("https.protocols", httpsProtocols);
|
|
107 | 106 |
} |
108 | 107 |
|
109 | 108 |
private void disableSslVerification() { |
modules/dnet-download-service/trunk/pom.xml | ||
---|---|---|
3 | 3 |
<groupId>eu.dnetlib</groupId> |
4 | 4 |
<artifactId>dnet45-parent</artifactId> |
5 | 5 |
<version>1.0.0-SNAPSHOT</version> |
6 |
<relativePath />
|
|
6 |
<relativePath/> |
|
7 | 7 |
</parent> |
8 | 8 |
<modelVersion>4.0.0</modelVersion> |
9 | 9 |
<groupId>eu.dnetlib</groupId> |
10 | 10 |
<artifactId>dnet-download-service</artifactId> |
11 | 11 |
<version>2.2.1-SNAPSHOT</version> |
12 | 12 |
<scm> |
13 |
<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-download-service/trunk</developerConnection>
|
|
13 |
<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-download-service/trunk</developerConnection>
|
|
14 | 14 |
</scm> |
15 | 15 |
<dependencies> |
16 | 16 |
<dependency> |
17 | 17 |
<groupId>eu.dnetlib</groupId> |
18 | 18 |
<artifactId>dnet-download-service-rmi</artifactId> |
19 | 19 |
<version>[1.0.0,2.0.0)</version> |
20 |
</dependency>
|
|
20 |
</dependency> |
|
21 | 21 |
<dependency> |
22 | 22 |
<groupId>eu.dnetlib</groupId> |
23 | 23 |
<artifactId>cnr-service-common</artifactId> |
... | ... | |
28 | 28 |
<artifactId>dnet-modular-objectstore-service</artifactId> |
29 | 29 |
<version>[4.0.0,5.0.0)</version> |
30 | 30 |
</dependency> |
31 |
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on --> |
|
32 | 31 |
<dependency> |
33 |
<groupId>org.bouncycastle</groupId> |
|
34 |
<artifactId>bcprov-jdk15on</artifactId> |
|
35 |
<version>1.55</version> |
|
36 |
</dependency> |
|
37 |
<dependency> |
|
38 | 32 |
<groupId>junit</groupId> |
39 | 33 |
<artifactId>junit</artifactId> |
40 | 34 |
<version>${junit.version}</version> |
... | ... | |
42 | 36 |
</dependency> |
43 | 37 |
<dependency> |
44 | 38 |
<groupId>org.mockito</groupId> |
45 |
<artifactId>mockito-core</artifactId>
|
|
46 |
<version>${mockito.version}</version>
|
|
39 |
<artifactId>mockito-core</artifactId>
|
|
40 |
<version>${mockito.version}</version>
|
|
47 | 41 |
<scope>test</scope> |
48 | 42 |
</dependency> |
49 |
|
|
50 |
|
|
51 | 43 |
</dependencies> |
52 | 44 |
</project> |
Also available in: Unified diff
migrated to dnet45