我试图通过尝试以下方法使用Spring的Reactive Framework实现和映像上传:
@RestController
@RequestMapping("/images")
public class ImageController {
@Autowired
private IImageService imageService;
@PostMapping(value = "", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
Mono<ImageEntity> saveImage(@RequestBody Mono<FilePart> part) throws Exception{
return part.flatMap(file -> imageService.saveImage(file));
}
}
Run Code Online (Sandbox Code Playgroud)
但我一直收到415,出现以下错误信息:
Response status 415 with reason "Content type 'multipart/form-data;boundary=--0b227e57d1a5ca41' not supported\
Run Code Online (Sandbox Code Playgroud)
不确定是什么问题,我正在通过以下方式卷曲API:
curl -v -F "file=@jinyang.gif" -H "Content-Type: multipart/form-data" localhost:8080/images
Run Code Online (Sandbox Code Playgroud)
我尝试过不同的标题和文件变体,结果相同.这里有点不知所措,因为我过去做过这件事情似乎工作正常.我在这篇文章中看到这个功能被合并了:
我正在编写一个应用程序,我想在其中使用 Firebase 对任何类型的后端调用进行身份验证。有没有办法让我通过 CLI 或curl本地测试获取令牌,而无需启动前端来获取令牌?
尝试使用PowerMock运行Mock测试时出现此堆栈
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.amazonaws.services.s3.AmazonS3Client]: Factory method 'amazonS3Client' threw exception; nested exception is org.apache.http.conn.ssl.SSLInitializationException: class configured for SSLContext: sun.security.ssl.SSLContextImpl$TLSContext not a SSLContext
Caused by: org.apache.http.conn.ssl.SSLInitializationException: class configured for SSLContext: sun.security.ssl.SSLContextImpl$TLSContext not a SSLContext
Caused by: java.security.NoSuchAlgorithmException: class configured for SSLContext: sun.security.ssl.SSLContextImpl$TLSContext not a SSLContext
Run Code Online (Sandbox Code Playgroud)
我已经尝试过使用@添加@PowerMockIgnore的建议,org.apache.http.con.ssl.*但是这样做会导致Rabbit连接器失败。我不确定是否有任何建议可以同时满足我的测试要求。如果测试不需要它,是否不初始化它?
我的能力有限,因为这对我的公司来说很重要。
使用Amazon SDK:1.11.69
这是我配置测试的方式
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations={"classpath:applicationContext-test.xml"})
@TestExecutionListeners(listeners={ServletTestExecutionListener.class,
DependencyInjectionTestExecutionListener.class,
DirtiesContextTestExecutionListener.class,
TransactionalTestExecutionListener.class,
WithSecurityContextTestExecutionListener.class})
@PrepareForTest({Observable.class,HardDeleteUserCommand.class,SoftDeleteUserCommand.class})
@PowerMockIgnore({ "javax.management.*", "ch.qos.logback.*",
"org.slf4j.*" })
Run Code Online (Sandbox Code Playgroud)
示例Bean:
@Configuration
@Profile("Test")
public class S3Configuration {
@Bean
public AmazonS3Client amazonS3Client() …Run Code Online (Sandbox Code Playgroud) 有没有办法在执行器/千分尺中关闭一些返回的公制值?现在看着它们我已经看到了1000左右,并希望将它们减少到少数几个说100实际被发送到我们的注册表.
我正在尝试找到一种方法来使用 Tensorflow 服务并能够添加新模型和新版本的模型。我可以将 tensorflow 服务指向 S3 存储桶吗?
我还需要它作为容器运行吗?这是可能的还是我需要实现另一个程序来下拉模型并将其添加到共享卷并要求 tensorflow 更新文件系统中的模型?
或者我是否需要构建自己的 docker 镜像才能从 s3 中提取内容?
spring ×2
amazon-s3 ×1
firebase ×1
java ×1
metrics ×1
micrometer ×1
powermockito ×1
reactive ×1
spring-mvc ×1
tensorflow ×1