@@ -149,33 +149,29 @@ internal class ObjectControllerTest : BaseControllerTest() {
149149 val key = " .././sampleFile.txt"
150150
151151 val testFile = File (UPLOAD_FILE_NAME )
152- val digest = DigestUtil .hexDigest(Files .newInputStream( testFile.toPath() ))
153- val tempFile = Files .createTempFile(" testPutObject_Ok " , " " ).also {
152+ val digest = DigestUtil .hexDigest(testFile.inputStream( ))
153+ val tempFile = Files .createTempFile(" testPutObject_withPathsegments_Ok " , " " ).also {
154154 testFile.copyTo(it.toFile(), overwrite = true )
155155 }
156156 whenever(
157157 objectService.toTempFile(
158- any(
159- InputStream ::class .java
160- ), any(HttpHeaders ::class .java)
158+ isA<InputStream >(),
159+ isA<HttpHeaders >()
161160 )
162161 )
163162 .thenReturn(
164- FileChecksum (
165- tempFile,
166- DigestUtil .checksumFor(testFile.toPath(), DefaultChecksumAlgorithm .CRC32 )
167- )
163+ tempFile to DigestUtil .checksumFor(testFile.toPath(), DefaultChecksumAlgorithm .CRC32 )
168164 )
169165
170166 whenever(
171- objectService.putS3Object (
167+ objectService.putObject (
172168 eq(TEST_BUCKET_NAME ),
173169 eq(key),
174- contains(MediaType .TEXT_PLAIN_VALUE ),
175- anyMap (),
176- any( Path :: class .java ),
177- anyMap (),
178- anyMap (),
170+ argThat< String >{ this . contains(MediaType .TEXT_PLAIN_VALUE ) } ,
171+ isA< Map < String , String >> (),
172+ isA< Path >( ),
173+ isA< Map < String , String >> (),
174+ isA< Map < String , String >> (),
179175 isNull(),
180176 isNull(),
181177 isNull(),
0 commit comments