Skip to content
Merged
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
2 changes: 1 addition & 1 deletion redis-om-spring/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ dependencies {
api "com.squareup:javapoet:${javapoetVersion}"

compileOnly "javax.enterprise:cdi-api:${cdi}"
implementation "com.google.auto.service:auto-service:${autoServiceVersion}"
compileOnly "com.google.auto.service:auto-service:${autoServiceVersion}"
annotationProcessor "com.google.auto.service:auto-service:${autoServiceVersion}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import javax.annotation.processing.Processor;
import javax.tools.JavaFileObject;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
import java.util.ServiceLoader;
import java.util.stream.Collectors;

import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -30,6 +32,26 @@
{ MetamodelGenerator.class }
)
class MetamodelGeneratorTest {

@Test
void testAnnotationProcessorServiceRegistration() {
// Verify that MetamodelGenerator is properly registered as a service
// This ensures that the @AutoService annotation is working correctly
ServiceLoader<Processor> loader = ServiceLoader.load(Processor.class);
boolean foundMetamodelGenerator = false;

for (Processor processor : loader) {
if (processor instanceof MetamodelGenerator) {
foundMetamodelGenerator = true;
break;
}
}

assertThat(foundMetamodelGenerator)
.as("MetamodelGenerator should be discoverable via ServiceLoader")
.isTrue();
}

@Test
@Classpath(
"data.metamodel.ValidDocumentIndexed"
Expand Down