Skip to content
Snippets Groups Projects
Unverified Commit aadab762 authored by Paul Latzelsperger's avatar Paul Latzelsperger
Browse files

fix: compile error after IH update

parent a3cf1d2c
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,7 @@ public class ParticipantContextSeedExtension implements ServiceExtension { ...@@ -91,7 +91,7 @@ public class ParticipantContextSeedExtension implements ServiceExtension {
.onFailure(f -> monitor.warning("Error overriding API key for '%s': %s".formatted(superUserParticipantId, f.getFailureDetail()))); .onFailure(f -> monitor.warning("Error overriding API key for '%s': %s".formatted(superUserParticipantId, f.getFailureDetail())));
return key; return key;
}) })
.orElse(generatedKey.get("apiKey").toString()); .orElse(generatedKey.apiKey());
monitor.info("Created user 'super-user'. Please take note of the API Key: %s".formatted(apiKey)); monitor.info("Created user 'super-user'. Please take note of the API Key: %s".formatted(apiKey));
}) })
.orElseThrow(f -> new EdcException("Error creating Super-User: " + f.getFailureDetail())); .orElseThrow(f -> new EdcException("Error creating Super-User: " + f.getFailureDetail()));
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
package org.eclipse.edc.identityhub.seed; package org.eclipse.edc.identityhub.seed;
import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService;
import org.eclipse.edc.identityhub.spi.participantcontext.model.CreateParticipantContextResponse;
import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
import org.eclipse.edc.junit.extensions.DependencyInjectionExtension; import org.eclipse.edc.junit.extensions.DependencyInjectionExtension;
import org.eclipse.edc.spi.EdcException; import org.eclipse.edc.spi.EdcException;
...@@ -27,8 +28,6 @@ import org.junit.jupiter.api.BeforeEach; ...@@ -27,8 +28,6 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.contains; import static org.mockito.ArgumentMatchers.contains;
...@@ -60,7 +59,7 @@ class ParticipantContextSeedExtensionTest { ...@@ -60,7 +59,7 @@ class ParticipantContextSeedExtensionTest {
void start_verifySuperUser(ParticipantContextSeedExtension ext, void start_verifySuperUser(ParticipantContextSeedExtension ext,
ServiceExtensionContext context) { ServiceExtensionContext context) {
when(participantContextService.createParticipantContext(any())).thenReturn(ServiceResult.success(Map.of(API_KEY, "some-key"))); when(participantContextService.createParticipantContext(any())).thenReturn(ServiceResult.success(new CreateParticipantContextResponse("some-key", null, null)));
ext.initialize(context); ext.initialize(context);
ext.start(); ext.start();
...@@ -94,7 +93,7 @@ class ParticipantContextSeedExtensionTest { ...@@ -94,7 +93,7 @@ class ParticipantContextSeedExtensionTest {
.thenReturn(apiKeyOverride); .thenReturn(apiKeyOverride);
when(participantContextService.createParticipantContext(any())) when(participantContextService.createParticipantContext(any()))
.thenReturn(ServiceResult.success(Map.of(API_KEY, "generated-api-key"))); .thenReturn(ServiceResult.success(new CreateParticipantContextResponse("generated-api-key", null, null)));
when(participantContextService.getParticipantContext(eq(SUPER_USER))) when(participantContextService.getParticipantContext(eq(SUPER_USER)))
.thenReturn(ServiceResult.notFound("foobar")) .thenReturn(ServiceResult.notFound("foobar"))
.thenReturn(ServiceResult.success(superUserContext().build())); .thenReturn(ServiceResult.success(superUserContext().build()));
...@@ -117,7 +116,7 @@ class ParticipantContextSeedExtensionTest { ...@@ -117,7 +116,7 @@ class ParticipantContextSeedExtensionTest {
.thenReturn(apiKeyOverride); .thenReturn(apiKeyOverride);
when(participantContextService.createParticipantContext(any())) when(participantContextService.createParticipantContext(any()))
.thenReturn(ServiceResult.success(Map.of(API_KEY, "generated-api-key"))); .thenReturn(ServiceResult.success(new CreateParticipantContextResponse("generated-api-key", null, null)));
when(participantContextService.getParticipantContext(eq(SUPER_USER))) when(participantContextService.getParticipantContext(eq(SUPER_USER)))
.thenReturn(ServiceResult.notFound("foobar")) .thenReturn(ServiceResult.notFound("foobar"))
.thenReturn(ServiceResult.success(superUserContext().build())); .thenReturn(ServiceResult.success(superUserContext().build()));
...@@ -141,7 +140,7 @@ class ParticipantContextSeedExtensionTest { ...@@ -141,7 +140,7 @@ class ParticipantContextSeedExtensionTest {
.thenReturn(apiKeyOverride); .thenReturn(apiKeyOverride);
when(participantContextService.createParticipantContext(any())) when(participantContextService.createParticipantContext(any()))
.thenReturn(ServiceResult.success(Map.of(API_KEY, "generated-api-key"))); .thenReturn(ServiceResult.success(new CreateParticipantContextResponse("generated-api-key", null, null)));
when(participantContextService.getParticipantContext(eq(SUPER_USER))) when(participantContextService.getParticipantContext(eq(SUPER_USER)))
.thenReturn(ServiceResult.notFound("foobar")) .thenReturn(ServiceResult.notFound("foobar"))
.thenReturn(ServiceResult.success(superUserContext().build())); .thenReturn(ServiceResult.success(superUserContext().build()));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment