@Test
public void shouldApplyWriteConcernConfiguredOnPropertyLevelForCreationOfAssociationStoredAsDocument() {
// given an empty database
MockMongoClient mockClient = mockClient().build();
OgmConfiguration configuration = TestHelper.getDefaultTestConfiguration( getAnnotatedClasses() );
configuration.getProperties().put( OgmProperties.DATASTORE_PROVIDER, new MongoDBDatastoreProvider( mockClient.getClient() ) );
configuration.getProperties().put( DocumentStoreProperties.ASSOCIATIONS_STORE, AssociationStorageType.ASSOCIATION_DOCUMENT );
configuration.configureOptionsFor( MongoDB.class )
.entity( GolfPlayer.class )
.writeConcern( WriteConcernType.REPLICA_ACKNOWLEDGED )
.property( "playedCourses", ElementType.FIELD )
.writeConcern( WriteConcernType.ACKNOWLEDGED );
sessions = configuration.buildSessionFactory();
Session session = sessions.openSession();
Transaction transaction = session.beginTransaction();
// when inserting a player with an associated course