void shouldThrow415ErrorIfFileExtensionNotSupported()

in digital-document-service/src/it/java/com/epam/digital/data/platform/dgtldcmnt/controller/InternalApiDocumentControllerIT.java [77:94]


  void shouldThrow415ErrorIfFileExtensionNotSupported() {
    remoteFileRepository.addStubMapping(
        stubFor(WireMock.get(urlPathEqualTo("/file.txt"))
            .willReturn(aResponse()
                .withHeader("Content-Type", "plain/text")
                .withStatus(200)
                .withBody(data))));

    var payload = RemoteDocumentDto.builder()
        .remoteFileLocation(new URL(remoteFileRepository.url("/file.txt"))).filename(filename)
        .build();

    mockMvc.perform(post(BASE_URL + "/" + rootProcessInstanceId)
            .header(JwtAuthenticationFilter.AUTHORIZATION_HEADER, accessToken)
            .content(objectMapper.writeValueAsString(payload))
            .contentType(MediaType.APPLICATION_JSON))
        .andExpect(status().isUnsupportedMediaType());
  }