Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何模拟S3以便在Junit中测试Java代码_Java_Amazon S3_Junit_Integration Testing - Fatal编程技术网

如何模拟S3以便在Junit中测试Java代码

如何模拟S3以便在Junit中测试Java代码,java,amazon-s3,junit,integration-testing,Java,Amazon S3,Junit,Integration Testing,为了实现集成测试的S3模拟,我采用了参考表格 我的困惑和部分,我没有得到的是,我如何才能使用docker在这里? 我必须安装一些东西吗 我刚刚在maven中添加了以下代码 <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk-datapipeline</artifactId> &

为了实现集成测试的S3模拟,我采用了参考表格

我的困惑和部分,我没有得到的是,我如何才能使用docker在这里? 我必须安装一些东西吗

我刚刚在maven中添加了以下代码

<dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-datapipeline</artifactId>
            <version>1.11.295</version>
        </dependency>
但是我无法编译我的类本身。
有人能帮我理解我还需要做些什么才能使这项工作顺利进行。

我相信你已经错过了S3Mock的依赖性,下面是maven:

<dependency>
    <groupId>io.findify</groupId>
    <artifactId>s3mock_2.12</artifactId>
    <version>0.2.5</version>
    <scope>test</scope>
</dependency>

伊奥·芬迪菲
S32.12
0.2.5
测试
另外,我建议您将类从
S3Mock
重命名为类似
AmazonS3Mock
的名称,以避免名称空间混乱

<dependency>
    <groupId>io.findify</groupId>
    <artifactId>s3mock_2.12</artifactId>
    <version>0.2.5</version>
    <scope>test</scope>
</dependency>