-
-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) close #1704
- Loading branch information
Showing
3 changed files
with
59 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/test/java/org/akhq/modules/audit/KafkaAuditModuleNoSecTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.akhq.modules.audit; | ||
|
||
import io.micronaut.context.ApplicationContext; | ||
import io.micronaut.test.extensions.junit5.annotation.MicronautTest; | ||
import jakarta.inject.Inject; | ||
import org.akhq.AbstractTest; | ||
import org.akhq.KafkaClusterExtension; | ||
import org.akhq.KafkaTestCluster; | ||
import org.akhq.modules.KafkaModule; | ||
import org.akhq.repositories.TopicRepository; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.MockitoAnnotations; | ||
|
||
import java.io.IOException; | ||
import java.util.Collections; | ||
import java.util.concurrent.ExecutionException; | ||
|
||
/** | ||
* This only tests instantiation | ||
*/ | ||
@ExtendWith(KafkaClusterExtension.class) | ||
@MicronautTest(environments = "audit-no-security") | ||
public class KafkaAuditModuleNoSecTest extends AbstractTest { | ||
|
||
@Inject | ||
@InjectMocks | ||
protected TopicRepository topicRepository; | ||
|
||
@Mock | ||
ApplicationContext applicationContext; | ||
|
||
@BeforeEach | ||
void before() { | ||
MockitoAnnotations.initMocks(this); | ||
} | ||
|
||
@Test | ||
void topicAuditNoSec() throws ExecutionException, InterruptedException { | ||
topicRepository.create(KafkaTestCluster.CLUSTER_ID, "generated_dummy-no-sec", 1, (short) 1, Collections.emptyList() | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
micronaut: | ||
security: | ||
enabled: false | ||
akhq: | ||
audit: | ||
enabled: true | ||
cluster-id: test | ||
topic-name: audit |