Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 3e115afd authored by Jean Claude Correale's avatar Jean Claude Correale
Browse files

Remove participant type enum

parent 64cb9c0f
No related branches found
No related tags found
4 merge requests!130Release,!129Release,!128fix unit tests - add property,!115Remove participant type enum
Pipeline #224045 failed
...@@ -2,7 +2,7 @@ package com.aruba.simpl.usersroles.configurations; ...@@ -2,7 +2,7 @@ package com.aruba.simpl.usersroles.configurations;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "microservices") @ConfigurationProperties(prefix = "microservice")
public record MicroserviceProperties(IdentityProvider identityProvider) { public record MicroserviceProperties(IdentityProvider identityProvider) {
public record IdentityProvider(String url) {} public record IdentityProvider(String url) {}
......
...@@ -10,7 +10,6 @@ import io.swagger.v3.oas.annotations.Parameter; ...@@ -10,7 +10,6 @@ import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponse;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody; import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
...@@ -54,7 +53,6 @@ public class CredentialController implements CredentialExchange { ...@@ -54,7 +53,6 @@ public class CredentialController implements CredentialExchange {
return service.insert(file); return service.insert(file);
} }
@GetMapping
@Operation( @Operation(
summary = "Check if a credential is present", summary = "Check if a credential is present",
description = "Returns true if a credential is present, false otherwise", description = "Returns true if a credential is present, false otherwise",
...@@ -71,12 +69,11 @@ public class CredentialController implements CredentialExchange { ...@@ -71,12 +69,11 @@ public class CredentialController implements CredentialExchange {
description = "Boolean indicating if a credential is present", description = "Boolean indicating if a credential is present",
type = "boolean"))) type = "boolean")))
}) })
@Override
public boolean hasCredential() { public boolean hasCredential() {
return service.hasCredential(); return service.hasCredential();
} }
@ResponseStatus(HttpStatus.NO_CONTENT)
@DeleteMapping
@Operation( @Operation(
summary = "Delete the credential", summary = "Delete the credential",
description = "Deletes the existing credential from the server", description = "Deletes the existing credential from the server",
...@@ -84,6 +81,7 @@ public class CredentialController implements CredentialExchange { ...@@ -84,6 +81,7 @@ public class CredentialController implements CredentialExchange {
@ApiResponse(responseCode = "204", description = "Successfully deleted credential"), @ApiResponse(responseCode = "204", description = "Successfully deleted credential"),
@ApiResponse(responseCode = "404", description = "Credential not found") @ApiResponse(responseCode = "404", description = "Credential not found")
}) })
@Override
public void delete() { public void delete() {
service.deleteCredential(); service.deleteCredential();
} }
......
...@@ -31,4 +31,8 @@ client: ...@@ -31,4 +31,8 @@ client:
url: https://tls.authority.aruba-simpl.cloud url: https://tls.authority.aruba-simpl.cloud
server: server:
port: 8081 port: 8081
\ No newline at end of file
microservice:
identity-provider:
url: [IDENTITY_PROVIDER_URL]
...@@ -44,4 +44,8 @@ client: ...@@ -44,4 +44,8 @@ client:
type: FEIGN type: FEIGN
certificate-password: [CLIENT_CERTIFICATE_PASSWORD] certificate-password: [CLIENT_CERTIFICATE_PASSWORD]
authority: authority:
url: [CLIENT_AUTHORITY_URL] url: [CLIENT_AUTHORITY_URL]
\ No newline at end of file
microservice:
identity-provider:
url: "http://localhost:8083"
\ No newline at end of file
...@@ -3,7 +3,6 @@ package com.aruba.simpl.usersroles.services.impl; ...@@ -3,7 +3,6 @@ package com.aruba.simpl.usersroles.services.impl;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import com.aruba.simpl.common.model.dto.IdentityAttributeDTO; import com.aruba.simpl.common.model.dto.IdentityAttributeDTO;
import com.aruba.simpl.common.model.enums.ParticipantType;
import com.aruba.simpl.usersroles.model.entities.IdentityAttributeWithOwnership; import com.aruba.simpl.usersroles.model.entities.IdentityAttributeWithOwnership;
import com.aruba.simpl.usersroles.model.mappers.IdentityAttributeWithOwnershipMapper; import com.aruba.simpl.usersroles.model.mappers.IdentityAttributeWithOwnershipMapper;
import java.util.HashSet; import java.util.HashSet;
...@@ -114,7 +113,7 @@ class IdentityAttributeUpdateHelperTest { ...@@ -114,7 +113,7 @@ class IdentityAttributeUpdateHelperTest {
.setAssignableToRoles(true) .setAssignableToRoles(true)
.setEnabled(true) .setEnabled(true)
.setAssignedToParticipant(assigned) .setAssignedToParticipant(assigned)
.setParticipantTypes(new HashSet<>(Set.of(ParticipantType.CONSUMER.name()))); .setParticipantTypes(new HashSet<>(Set.of("CONSUMER")));
} }
private IdentityAttributeDTO idaDTO(String label, Consumer<IdentityAttributeDTO> customizer) { private IdentityAttributeDTO idaDTO(String label, Consumer<IdentityAttributeDTO> customizer) {
...@@ -124,7 +123,7 @@ class IdentityAttributeUpdateHelperTest { ...@@ -124,7 +123,7 @@ class IdentityAttributeUpdateHelperTest {
.setDescription(label) .setDescription(label)
.setAssignableToRoles(true) .setAssignableToRoles(true)
.setEnabled(true) .setEnabled(true)
.setParticipantTypes(new HashSet<>(Set.of(ParticipantType.CONSUMER.name()))); .setParticipantTypes(new HashSet<>(Set.of("CONSUMER")));
customizer.accept(dto); customizer.accept(dto);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment