Skip to content

Commit 167c1e7

Browse files
committed
Restoring Windows compatibility
1 parent e7581ca commit 167c1e7

File tree

2 files changed

+10
-44
lines changed

2 files changed

+10
-44
lines changed

core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ConnInstanceTest.java

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import static org.junit.jupiter.api.Assertions.assertTrue;
2525
import static org.junit.jupiter.api.Assertions.fail;
2626

27-
import java.nio.file.Path;
2827
import java.util.ArrayList;
2928
import java.util.List;
3029
import java.util.stream.Collectors;
@@ -88,27 +87,16 @@ public void findById() {
8887
}
8988

9089
@Test
91-
public void save() throws ClassNotFoundException {
90+
public void save() {
9291
ConnInstance connInstance = entityFactory.newEntity(ConnInstance.class);
93-
94-
connInstance.setLocation(Path.of(System.getProperty("java.io.tmpdir")).toUri().toString());
95-
96-
// set connector version
92+
connInstance.setLocation("file:" + System.getProperty("java.io.tmpdir"));
9793
connInstance.setVersion("1.0");
98-
99-
// set connector name
10094
connInstance.setConnectorName("WebService");
101-
102-
// set bundle name
10395
connInstance.setBundleName("org.apache.syncope.core.persistence.test.util");
104-
10596
connInstance.setDisplayName("New");
106-
10797
connInstance.setConnRequestTimeout(60);
10898

109-
// set the connector configuration using PropertyTO
110-
List<ConnConfProperty> conf = new ArrayList<>();
111-
99+
// set the connector configuration
112100
ConnConfPropSchema endpointSchema = new ConnConfPropSchema();
113101
endpointSchema.setName("endpoint");
114102
endpointSchema.setType(String.class.getName());
@@ -125,10 +113,9 @@ public void save() throws ClassNotFoundException {
125113
servicename.setSchema(servicenameSchema);
126114
endpoint.getValues().add("Provisioning");
127115

116+
List<ConnConfProperty> conf = new ArrayList<>();
128117
conf.add(endpoint);
129118
conf.add(servicename);
130-
131-
// set connector configuration
132119
connInstance.setConf(conf);
133120
assertFalse(connInstance.getConf().isEmpty());
134121

@@ -147,11 +134,7 @@ public void save() throws ClassNotFoundException {
147134

148135
assertEquals(60, actual.getConnRequestTimeout().intValue());
149136

150-
conf = connInstance.getConf();
151-
assertFalse(conf.isEmpty());
152-
153-
assertNotNull(conf);
154-
assertEquals(2, conf.size());
137+
assertEquals(2, connInstance.getConf().size());
155138
}
156139

157140
@Test

core/persistence-neo4j/src/test/java/org/apache/syncope/core/persistence/neo4j/inner/ConnInstanceTest.java

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import static org.junit.jupiter.api.Assertions.assertTrue;
2525
import static org.junit.jupiter.api.Assertions.fail;
2626

27-
import java.nio.file.Path;
2827
import java.util.ArrayList;
2928
import java.util.List;
3029
import java.util.stream.Collectors;
@@ -88,27 +87,16 @@ public void findById() {
8887
}
8988

9089
@Test
91-
public void save() throws ClassNotFoundException {
90+
public void save() {
9291
ConnInstance connInstance = entityFactory.newEntity(ConnInstance.class);
93-
94-
connInstance.setLocation(Path.of(System.getProperty("java.io.tmpdir")).toUri().toString());
95-
96-
// set connector version
92+
connInstance.setLocation("file:" + System.getProperty("java.io.tmpdir"));
9793
connInstance.setVersion("1.0");
98-
99-
// set connector name
10094
connInstance.setConnectorName("WebService");
101-
102-
// set bundle name
10395
connInstance.setBundleName("org.apache.syncope.core.persistence.test.util");
104-
10596
connInstance.setDisplayName("New");
106-
10797
connInstance.setConnRequestTimeout(60);
10898

109-
// set the connector configuration using PropertyTO
110-
List<ConnConfProperty> conf = new ArrayList<>();
111-
99+
// set the connector configuration
112100
ConnConfPropSchema endpointSchema = new ConnConfPropSchema();
113101
endpointSchema.setName("endpoint");
114102
endpointSchema.setType(String.class.getName());
@@ -125,10 +113,9 @@ public void save() throws ClassNotFoundException {
125113
servicename.setSchema(servicenameSchema);
126114
endpoint.getValues().add("Provisioning");
127115

116+
List<ConnConfProperty> conf = new ArrayList<>();
128117
conf.add(endpoint);
129118
conf.add(servicename);
130-
131-
// set connector configuration
132119
connInstance.setConf(conf);
133120
assertFalse(connInstance.getConf().isEmpty());
134121

@@ -147,11 +134,7 @@ public void save() throws ClassNotFoundException {
147134

148135
assertEquals(60, actual.getConnRequestTimeout().intValue());
149136

150-
conf = connInstance.getConf();
151-
assertFalse(conf.isEmpty());
152-
153-
assertNotNull(conf);
154-
assertEquals(2, conf.size());
137+
assertEquals(2, connInstance.getConf().size());
155138
}
156139

157140
@Test

0 commit comments

Comments
 (0)