Skip to content

Commit

Permalink
HSEARCH-3654 Add start with parameters to helper extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-bekhta committed Sep 27, 2023
1 parent 1da09f0 commit acb12d3
Show file tree
Hide file tree
Showing 46 changed files with 286 additions and 193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.alternative.alternativebinder;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.List;
Expand Down Expand Up @@ -44,14 +45,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( BlogEntry.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( BlogEntry.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.binding.identifierbridge.binder;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.List;
Expand Down Expand Up @@ -39,14 +40,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Book.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Book.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.binding.identifierbridge.simple;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.List;
Expand Down Expand Up @@ -39,14 +40,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Book.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Book.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.binding.propertybridge.bridgedelement;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.math.BigDecimal;
Expand Down Expand Up @@ -41,14 +42,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Invoice.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Invoice.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.binding.propertybridge.param.annotation;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.math.BigDecimal;
Expand Down Expand Up @@ -45,9 +46,8 @@ public static List<? extends Arguments> params() {
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Invoice.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Invoice.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.binding.propertybridge.param.string;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.math.BigDecimal;
Expand Down Expand Up @@ -48,9 +49,8 @@ public static List<? extends Arguments> params() {
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Invoice.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Invoice.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.binding.routingbridge.conditionalindexing;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.List;
Expand Down Expand Up @@ -46,14 +47,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Book.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Book.class );
initData();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.binding.routingbridge.routingkey;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.List;
Expand Down Expand Up @@ -53,9 +54,8 @@ public static List<? extends Arguments> params() {
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Book.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Book.class );
initData();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.binding.typebridge.param.annotation;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.List;
Expand Down Expand Up @@ -38,14 +39,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Author.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Author.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.binding.typebridge.param.string;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.Collections;
Expand Down Expand Up @@ -39,14 +40,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Author.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Author.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.binding.valuebridge.binder;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.List;
Expand Down Expand Up @@ -45,14 +46,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Book.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Book.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.binding.valuebridge.simple;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.List;
Expand Down Expand Up @@ -40,14 +41,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Book.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Book.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.containerextractor;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.math.BigDecimal;
Expand Down Expand Up @@ -52,14 +53,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Book.class, Author.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Book.class, Author.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.directfieldmapping;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.List;
Expand Down Expand Up @@ -60,14 +61,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Book.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Book.class );
initData();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.Arrays;
Expand Down Expand Up @@ -66,9 +67,8 @@ public static List<? extends Arguments> params() {
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Book.class, User.class, Author.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Book.class, User.class, Author.class );
initData();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.documentation.mapper.orm.identifiermapping.naturalid;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.search.documentation.testsupport.DocumentationSetupHelper.SetupVariant.variant;
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;

import java.util.List;
Expand Down Expand Up @@ -39,14 +40,12 @@ public static List<? extends Arguments> params() {
}

@RegisterExtension
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend(
BackendConfigurations.simple() );
public DocumentationSetupHelper setupHelper = DocumentationSetupHelper.withSingleBackend( BackendConfigurations.simple() );
private EntityManagerFactory entityManagerFactory;

public void init(Boolean annotationProcessingEnabled, HibernateOrmSearchMappingConfigurer mappingContributor) {
setupHelper.withAnnotationProcessingEnabled( annotationProcessingEnabled )
.withMappingConfigurer( mappingContributor );
entityManagerFactory = setupHelper.start().setup( Book.class );
entityManagerFactory = setupHelper.start( variant( annotationProcessingEnabled, mappingContributor ) )
.setup( Book.class );
}

@ParameterizedTest(name = "{0}")
Expand Down
Loading

0 comments on commit acb12d3

Please sign in to comment.