-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'opensearch-project:main' into frequent-check-pointing
- Loading branch information
Showing
11 changed files
with
278 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...s/s3-source/src/test/java/org/opensearch/dataprepper/plugins/source/s3/S3ServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.opensearch.dataprepper.plugins.source.s3; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
import org.opensearch.dataprepper.model.acknowledgements.AcknowledgementSet; | ||
|
||
import java.io.IOException; | ||
|
||
import static org.mockito.ArgumentMatchers.eq; | ||
import static org.mockito.Mockito.doNothing; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.verify; | ||
|
||
@ExtendWith(MockitoExtension.class) | ||
public class S3ServiceTest { | ||
|
||
@Mock | ||
private S3ObjectHandler s3ObjectHandler; | ||
|
||
private S3Service createObjectUnderTest() { | ||
return new S3Service(s3ObjectHandler); | ||
} | ||
|
||
@Test | ||
void addS3Object_calls_parseS3Object_on_S3ObjectHandler() throws IOException { | ||
final AcknowledgementSet acknowledgementSet = mock(AcknowledgementSet.class); | ||
final S3ObjectReference s3ObjectReference = mock(S3ObjectReference.class); | ||
|
||
doNothing().when(s3ObjectHandler).parseS3Object(eq(s3ObjectReference), eq(acknowledgementSet), eq(null), eq(null)); | ||
|
||
final S3Service objectUnderTest = createObjectUnderTest(); | ||
|
||
objectUnderTest.addS3Object(s3ObjectReference, acknowledgementSet); | ||
|
||
verify(s3ObjectHandler).parseS3Object(s3ObjectReference, acknowledgementSet, null, null); | ||
} | ||
|
||
@Test | ||
void deleteS3Object_calls_deleteS3Object_on_s3ObjectHandler() throws IOException { | ||
final S3ObjectReference s3ObjectReference = mock(S3ObjectReference.class); | ||
doNothing().when(s3ObjectHandler).deleteS3Object(s3ObjectReference); | ||
|
||
final S3Service s3Service = createObjectUnderTest(); | ||
|
||
s3Service.deleteS3Object(s3ObjectReference); | ||
verify(s3ObjectHandler).deleteS3Object(s3ObjectReference); | ||
|
||
} | ||
} |
Oops, something went wrong.