Skip to content

Commit f43bb6a

Browse files
pacmano1claude
andcommitted
Reword the S3Connection header comment and type the test's matcher
The comment said passivate() "puts the first ones back", which reads as the first message's headers, the bug this pull request fixes. Say which headers instead. FileDispatcherTest matched the download transformer with a raw ResponseTransformer, which added an unchecked warning to the server test compile. Give the matcher its types. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Finnegan's Owner <44065187+pacmano1@users.noreply.github.com>
1 parent 058d352 commit f43bb6a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎server/src/main/java/com/mirth/connect/connectors/file/filesystems/S3Connection.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ public void populateSourceMap(Map<String, Object> sourceMap) {
157157
S3Client client;
158158
StsClient sts;
159159
int stsDuration;
160-
// The headers sent with each write. They start as the ones this connection was created with,
161-
// the File Writer sets each message's before writing, and passivate() puts the first ones back.
160+
// The headers sent with each write: the ones this connection was created with, replaced by
161+
// each message's while the File Writer has it, and put back by passivate().
162162
// schemeProps belongs to the message that created the pool and is shared by every connection in
163163
// it, so per-message headers can't go there.
164164
Map<String, List<String>> customHeaders;

‎server/src/test/java/com/mirth/connect/connectors/file/FileDispatcherTest.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.junit.BeforeClass;
2323
import org.junit.Test;
2424
import org.mockito.ArgumentCaptor;
25+
import org.mockito.ArgumentMatchers;
2526

2627
import com.mirth.connect.connectors.file.filesystems.S3Connection;
2728
import com.mirth.connect.donkey.model.message.ConnectorMessage;
@@ -87,7 +88,7 @@ public void pooledS3ConnectionSendsEachMessagesHeaders() throws Exception {
8788
@Test
8889
public void pooledS3ConnectionSendsEachMessagesHeadersThroughTemporaryFile() throws Exception {
8990
S3Client client = mockClient();
90-
when(client.getObject(any(GetObjectRequest.class), any(ResponseTransformer.class))).thenAnswer(invocation -> {
91+
when(client.getObject(any(GetObjectRequest.class), ArgumentMatchers.<ResponseTransformer<GetObjectResponse, Object>>any())).thenAnswer(invocation -> {
9192
ResponseTransformer<GetObjectResponse, ?> transformer = invocation.getArgument(1);
9293
return transformer.transform(GetObjectResponse.builder().contentLength(7L).build(), AbortableInputStream.create(new ByteArrayInputStream("message".getBytes())));
9394
});

0 commit comments

Comments
 (0)