@Test
public void testWrite() throws Exception {

	String openApiModule = "/headless-openapi-module/v1.0";
	String endpoint = "/catalogs/{siteId}/product";
	LiferayRequestContentAggregatorSink
		liferayRequestContentAggregatorSink =
			new LiferayRequestContentAggregatorSink();
	LiferayOutputProperties testLiferayOutputProperties =
		_getLiferayOutputProperties(
			Operation.Insert, openApiModule, _OAS_URL, endpoint, "siteId");
	JsonObject oasJsonObject = readObject("openapi.json");
	Schema postContentSchema = getSchema(
		"/v1.0/catalogs/{siteId}/product", "POST", oasJsonObject);
	testLiferayOutputProperties.resource.inboundSchemaProperties.schema.
		setValue(postContentSchema);
	testLiferayOutputProperties.resource.outboundSchemaProperties.schema.
		setValue(postContentSchema);
	LiferayWriter liferayWriter = new LiferayWriter(
		new LiferayWriteOperation(
			liferayRequestContentAggregatorSink,
			testLiferayOutputProperties),
		testLiferayOutputProperties);
	liferayWriter.open("aaaa-bbbb-cccc-dddd");
	liferayWriter.write(
		_createIndexedRecordFromFile(
			"product_content.json", postContentSchema));
	JsonObject outputJsonObject =
		liferayRequestContentAggregatorSink.getOutputJsonObject();
	Assert.assertTrue(
		"Output has name", outputJsonObject.containsKey("name"));
	JsonObject nameJsonObject = outputJsonObject.getJsonObject("name");
	Assert.assertNotNull("name is json object", nameJsonObject);
	Assert.assertTrue(
		"Name has key hr_HR", nameJsonObject.containsKey("hr_HR"));
}