Skip to content

Commit f3968f8

Browse files
pr remarks
1 parent d9e13cb commit f3968f8

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

core/common/base/src/test/java/org/eclipse/dataspaceconnector/core/security/DefaultPrivateKeyParseFunctionTest.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,6 @@ class DefaultPrivateKeyParseFunctionTest {
3232

3333
private DefaultPrivateKeyParseFunction parseFunction;
3434

35-
/**
36-
* Load content from a resource file.
37-
*/
38-
private static String loadResourceFile(String file) throws IOException {
39-
return new String(
40-
Objects.requireNonNull(
41-
DefaultPrivateKeyParseFunctionTest.class.getClassLoader().getResourceAsStream(file)
42-
)
43-
.readAllBytes());
44-
}
45-
4635
@BeforeEach
4736
public void setUp() {
4837
parseFunction = new DefaultPrivateKeyParseFunction();
@@ -65,4 +54,15 @@ void verifyParseSuccess(String keyFileName, String expectedAlgo) throws IOExcept
6554
assertThat(key).isNotNull();
6655
assertThat(key.getAlgorithm()).isEqualTo(expectedAlgo);
6756
}
57+
58+
/**
59+
* Load content from a resource file.
60+
*/
61+
private String loadResourceFile(String file) throws IOException {
62+
return new String(
63+
Objects.requireNonNull(
64+
DefaultPrivateKeyParseFunctionTest.class.getClassLoader().getResourceAsStream(file)
65+
)
66+
.readAllBytes());
67+
}
6868
}

data-protocols/ids/ids-api-multipart-endpoint-v1/src/test/java/org/eclipse/dataspaceconnector/ids/api/multipart/handler/EndpointDataReferenceHandlerTest.java

+22-22
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,6 @@ class EndpointDataReferenceHandlerTest {
5151
private EndpointDataReferenceReceiverRegistry receiverRegistry;
5252
private EndpointDataReferenceTransformerRegistry transformerRegistry;
5353

54-
private static EndpointDataReference createEndpointDataReference() {
55-
return EndpointDataReference.Builder.newInstance()
56-
.endpoint("some.endpoint.url")
57-
.authKey("test-authkey")
58-
.authCode(UUID.randomUUID().toString())
59-
.id(UUID.randomUUID().toString())
60-
.properties(Map.of("key1", UUID.randomUUID().toString()))
61-
.build();
62-
}
63-
64-
private static MultipartRequest createMultipartRequest(EndpointDataReference payload) throws JsonProcessingException {
65-
return MultipartRequest.Builder.newInstance()
66-
.header(new ParticipantUpdateMessageBuilder().build())
67-
.payload(MAPPER.writeValueAsString(payload))
68-
.claimToken(createClaimToken())
69-
.build();
70-
}
71-
72-
private static ClaimToken createClaimToken() {
73-
return ClaimToken.Builder.newInstance().build();
74-
}
75-
7654
@BeforeEach
7755
public void setUp() {
7856
var monitor = mock(Monitor.class);
@@ -154,4 +132,26 @@ void handleRequest_receiveFailure_shouldReturnMessageProcessedNotification() thr
154132
.isNotNull()
155133
.satisfies(r -> assertThat(r.getHeader()).isInstanceOf(RejectionMessage.class));
156134
}
135+
136+
private EndpointDataReference createEndpointDataReference() {
137+
return EndpointDataReference.Builder.newInstance()
138+
.endpoint("some.endpoint.url")
139+
.authKey("test-authkey")
140+
.authCode(UUID.randomUUID().toString())
141+
.id(UUID.randomUUID().toString())
142+
.properties(Map.of("key1", UUID.randomUUID().toString()))
143+
.build();
144+
}
145+
146+
private MultipartRequest createMultipartRequest(EndpointDataReference payload) throws JsonProcessingException {
147+
return MultipartRequest.Builder.newInstance()
148+
.header(new ParticipantUpdateMessageBuilder().build())
149+
.payload(MAPPER.writeValueAsString(payload))
150+
.claimToken(createClaimToken())
151+
.build();
152+
}
153+
154+
private ClaimToken createClaimToken() {
155+
return ClaimToken.Builder.newInstance().build();
156+
}
157157
}

0 commit comments

Comments
 (0)