@Test
public void testInsert() throws Exception {

	DDMContent ddmContent = mock(DDMContent.class);
	when(
		_ddmContentLocalService.addContent(
			Matchers.anyLong(), Matchers.anyLong(), Matchers.anyString(),
			Matchers.anyString(), Matchers.anyString(),
			Matchers.any(ServiceContext.class))
	).thenReturn(
		ddmContent
	);
	when(
		ddmContent.getPrimaryKey()
	).thenReturn(
		1L
	);
	DDMFormValues ddmFormValues = mock(DDMFormValues.class);
	DDMFormValuesSerializerSerializeResponse
		ddmFormValuesSerializerSerializeResponse =
			DDMFormValuesSerializerSerializeResponse.Builder.newBuilder(
				"{}"
			).build();
	when(
		_ddmFormValuesSerializer.serialize(
			Mockito.any(DDMFormValuesSerializerSerializeRequest.class))
	).thenReturn(
		ddmFormValuesSerializerSerializeResponse
	);
	DDMStorageAdapterSaveRequest.Builder builder =
		DDMStorageAdapterSaveRequest.Builder.newBuilder(
			1, 1, ddmFormValues);
	DDMStorageAdapterSaveRequest ddmStorageAdapterSaveRequest =
		builder.build();
	DDMStorageAdapterSaveResponse ddmStorageAdapterSaveResponse =
		_jsonDDMStorageAdapter.save(ddmStorageAdapterSaveRequest);
	Assert.assertEquals(1L, ddmStorageAdapterSaveResponse.getPrimaryKey());
	Mockito.verify(
		_ddmFormValuesSerializer, Mockito.times(1)
	).serialize(
		Mockito.any(DDMFormValuesSerializerSerializeRequest.class)
	);
	Mockito.verify(
		_ddmContentLocalService, Mockito.times(1)
	).addContent(
		Matchers.anyLong(), Matchers.anyLong(), Matchers.anyString(),
		Matchers.anyString(), Matchers.anyString(),
		Matchers.any(ServiceContext.class)
	);
}