Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ public interface BinaryRestService {
* @return the {@link BinaryObjectEto}
* @throws SQLException
*/
@Consumes("multipart/mixed")
@Consumes("multipart/form-data")
@POST
@Path("/binaryobject/")
public BinaryObjectEto saveBinaryObject(
@Multipart(value = "root", type = MediaType.APPLICATION_JSON) BinaryObjectEto binaryObjectEto,
@Multipart(value = "image", type = MediaType.APPLICATION_OCTET_STREAM) InputStream data);
public BinaryObjectEto saveBinaryObject(@Multipart("root") BinaryObjectEto binaryObjectEto,
@Multipart("image") InputStream data);
// end::saveBinaryObject[]

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void testSaveBinaryObject() throws IOException, URISyntaxException {

List<Attachment> attachments = createAttachments(imagePath, eto);

BinaryObjectEto resultEto = getClient().type("multipart/mixed").accept("application/json").path("binaryobject/")
BinaryObjectEto resultEto = getClient().type("multipart/form-data").accept("application/json").path("binaryobject/")
.post(attachments, BinaryObjectEto.class);
assertTrue(resultEto.getId() > 0);
assertEquals(resultEto.getSize(), Files.size(imagePath));
Expand Down Expand Up @@ -115,7 +115,7 @@ public void testSaveUploadDeleteBinaryObject() throws IOException, URISyntaxExce

List<Attachment> attachments = createAttachments(imagePath, myEto);

BinaryObjectEto resultEto = getClient().type("multipart/mixed").accept("application/json").path("binaryobject/")
BinaryObjectEto resultEto = getClient().type("multipart/form-data").accept("application/json").path("binaryobject/")
.post(attachments, BinaryObjectEto.class);
assertTrue(resultEto.getId() > 0);

Expand Down
4 changes: 3 additions & 1 deletion core/src/test/resources/config/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ spring.profiles.active=junit
spring.jpa.database=oracle
spring.datasource.username=c##blobapp
spring.datasource.password=blobapp
spring.datasource.url=jdbc:oracle:thin:@localhost:32769:ORCLCDB
spring.datasource.url=jdbc:oracle:thin:@localhost:1521:ORCLCDB
#spring.datasource.url=jdbc:oracle:thin:@localhost:32769:ORCLCDB
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove non-used code



spring.jpa.hibernate.ddl-auto=none

Expand Down