Skip to content

Commit

Permalink
feat: updaste dastabases qualifier
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Mar 4, 2024
1 parent dfaf3e3 commit 4aa0b86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -49,11 +49,12 @@ public static void addDatabase(final ProcessProducer processProducer, final Data
databaseOptional.ifPresent(database -> {
if (!type.equals(database.value())) {
String simpleName = processProducer.getAnnotatedMember().getDeclaringType().getJavaClass().getSimpleName();
throw new IllegalStateException(String.format("The %s is producing a wrong manager for %s type", simpleName, type));
LOGGER.info(String.format("Ignoring because the %s is producing a wrong manager for %s type", simpleName, type));
} else {
final DatabaseMetadata metadata = DatabaseMetadata.of(database);
LOGGER.info(String.format("Found the type %s to metadata %s", type, metadata));
databases.add(metadata);
}
final DatabaseMetadata metadata = DatabaseMetadata.of(database);
LOGGER.info(String.format("Found the type %s to metadata %s", type, metadata));
databases.add(metadata);
});
}
}
Expand Up @@ -30,6 +30,7 @@

class DatabasesTest {

@SuppressWarnings("rawtypes")
@Test
void shouldAddDatabaseValidDatabaseTypeAddsMetadataToSet() {
ProcessProducer processProducer = mock(ProcessProducer.class);
Expand All @@ -53,6 +54,7 @@ void shouldAddDatabaseValidDatabaseTypeAddsMetadataToSet() {
assertTrue(databases.contains(DatabaseMetadata.of(databaseAnnotation)));
}

@SuppressWarnings("rawtypes")
@Test
void shouldAddDatabase_NoDatabaseAnnotation_NoMetadataAdded() {
ProcessProducer processProducer = mock(ProcessProducer.class);
Expand Down

0 comments on commit 4aa0b86

Please sign in to comment.