Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void findById() {
assertEquals("net.tirasa.connid.bundles.soap.WebServiceConnector", connector.getConnectorName());
assertEquals("net.tirasa.connid.bundles.soap", connector.getBundleName());

Mapping mapping = resource.getProvisionByAnyType(AnyTypeKind.USER.name()).get().getMapping();
Mapping mapping = resource.getProvisionByAnyType(AnyTypeKind.USER.name()).orElseThrow().getMapping();
assertFalse(mapping.getItems().isEmpty());

assertTrue(mapping.getItems().stream().
Expand All @@ -80,6 +80,12 @@ public void findById() {
}
}

@Test
public void propagationActions() {
ExternalResource resource = resourceDAO.findById("resource-ldap").orElseThrow();
assertEquals(2, resource.getPropagationActions().size());
}

@Test
public void findWithOrgUnit() {
ExternalResource resource = resourceDAO.findById("resource-ldap-orgunit").orElseThrow();
Expand Down Expand Up @@ -110,8 +116,8 @@ public void findAll() {
@Test
public void getConnObjectKey() {
ExternalResource resource = resourceDAO.findById("ws-target-resource-2").orElseThrow();
assertEquals("fullname", resource.getProvisionByAnyType(AnyTypeKind.USER.name()).get().
getMapping().getConnObjectKeyItem().get().getIntAttrName());
assertEquals("fullname", resource.getProvisionByAnyType(AnyTypeKind.USER.name()).orElseThrow().
getMapping().getConnObjectKeyItem().orElseThrow().getIntAttrName());
}

@Test
Expand Down Expand Up @@ -277,7 +283,8 @@ public void saveWithGroupMappingType() {
entityManager.flush();
assertNotNull(actual);

assertEquals(3, actual.getProvisionByAnyType(AnyTypeKind.USER.name()).get().getMapping().getItems().size());
assertEquals(3, actual.getProvisionByAnyType(AnyTypeKind.USER.name()).orElseThrow().getMapping().getItems().
size());
}

@Test
Expand Down
6 changes: 0 additions & 6 deletions core/persistence-neo4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ under the License.
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-neo4j</artifactId>
</dependency>
<!-- keep until https://github.com/spring-projects/spring-data-commons/issues/3500 -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>4.0.5</version>
</dependency>

<dependency>
<groupId>org.apache.syncope.core</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.core.persistence.neo4j.converters;

import org.apache.syncope.common.lib.policy.AccessPolicyConf;

public class AccessPolicyConfConverter extends SerializableConverter<AccessPolicyConf> {

public AccessPolicyConfConverter() {
super(AccessPolicyConf.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.core.persistence.neo4j.converters;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.apache.syncope.common.lib.Attr;
import org.apache.syncope.core.provisioning.api.serialization.POJOHelper;
import org.neo4j.driver.Value;
import org.neo4j.driver.Values;
import org.springframework.data.neo4j.core.convert.Neo4jPersistentPropertyConverter;
import tools.jackson.core.type.TypeReference;

public class AttrListConverter implements Neo4jPersistentPropertyConverter<List<Attr>> {

protected static final TypeReference<List<Attr>> TYPEREF = new TypeReference<List<Attr>>() {
};

@Override
public Value write(final List<Attr> source) {
return Optional.ofNullable(source).
map(POJOHelper::serialize).map(Values::value).orElse(Values.value(List.of()));
}

@Override
public List<Attr> read(final Value source) {
return Optional.ofNullable(source).
map(data -> POJOHelper.deserialize(source.asString(), TYPEREF)).orElseGet(ArrayList::new);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.core.persistence.neo4j.converters;

import org.apache.syncope.common.lib.policy.AttrReleasePolicyConf;

public class AttrReleasePolicyConfConverter extends SerializableConverter<AttrReleasePolicyConf> {

public AttrReleasePolicyConfConverter() {
super(AttrReleasePolicyConf.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.core.persistence.neo4j.converters;

import org.apache.syncope.common.lib.attr.AttrRepoConf;

public class AttrRepoConfConverter extends SerializableConverter<AttrRepoConf> {

public AttrRepoConfConverter() {
super(AttrRepoConf.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.core.persistence.neo4j.converters;

import org.apache.syncope.common.lib.auth.AuthModuleConf;

public class AuthModuleConfConverter extends SerializableConverter<AuthModuleConf> {

public AuthModuleConfConverter() {
super(AuthModuleConf.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.core.persistence.neo4j.converters;

import org.apache.syncope.common.lib.policy.AuthPolicyConf;

public class AuthPolicyConfConverter extends SerializableConverter<AuthPolicyConf> {

public AuthPolicyConfConverter() {
super(AuthPolicyConf.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.core.persistence.neo4j.converters;

import java.util.List;
import org.apache.syncope.common.lib.types.ConnConfProperty;
import tools.jackson.core.type.TypeReference;

public class ConnConfPropertyListConverter extends SerializableListConverter<ConnConfProperty> {

protected static final TypeReference<List<ConnConfProperty>> TYPEREF =
new TypeReference<List<ConnConfProperty>>() {
};

@Override
protected TypeReference<List<ConnConfProperty>> typeRef() {
return TYPEREF;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.core.persistence.neo4j.converters;

import org.apache.syncope.common.lib.types.ConnPoolConf;

public class ConnPoolConfConverter extends SerializableConverter<ConnPoolConf> {

public ConnPoolConfConverter() {
super(ConnPoolConf.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.core.persistence.neo4j.converters;

import java.util.Set;
import org.apache.syncope.common.lib.types.ConnectorCapability;
import tools.jackson.core.type.TypeReference;

public class ConnectorCapabilitySetConverter extends SerializableSetConverter<ConnectorCapability> {

protected static final TypeReference<Set<ConnectorCapability>> TYPEREF =
new TypeReference<Set<ConnectorCapability>>() {
};

@Override
protected TypeReference<Set<ConnectorCapability>> typeRef() {
return TYPEREF;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.core.persistence.neo4j.converters;

import java.util.List;
import org.apache.syncope.common.lib.wa.GoogleMfaAuthAccount;
import tools.jackson.core.type.TypeReference;

public class GoogleMfaAuthAccountListConverter extends SerializableListConverter<GoogleMfaAuthAccount> {

protected static final TypeReference<List<GoogleMfaAuthAccount>> TYPEREF =
new TypeReference<List<GoogleMfaAuthAccount>>() {
};

@Override
protected TypeReference<List<GoogleMfaAuthAccount>> typeRef() {
return TYPEREF;
}
}
Loading
Loading