Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
cbornet committed Nov 7, 2023
1 parent 57d774b commit 2a2c73a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public void onError(Throwable throwable) {

@Override
public void onCompleted() {

if (!restarting.get()) {
agentContext.criticalFailure(
new RuntimeException("gRPC server completed the stream unexpectedly"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public void onCompleted() {

@BeforeEach
public void setUp() throws Exception {
log.info("Starting test");
String serverName = InProcessServerBuilder.generateName();
server =
InProcessServerBuilder.forName(serverName)
Expand All @@ -145,6 +146,7 @@ public void setUp() throws Exception {

@AfterEach
public void tearDown() throws Exception {
log.info("Shutting down test");
processor.close();
channel.shutdownNow();
server.shutdownNow();
Expand All @@ -170,11 +172,13 @@ void testTopicProducerSuccess() throws Exception {

@Test
void testTopicProducerError() throws Exception {
log.info("Starting testTopicProducerError");
TestAgentContext context = new TestAgentContextFailure();
startProcessor(context);
assertEquals(
"getTopicProducerRecords: gRPC server sent error: INTERNAL: test-error",
context.failure.get(15, TimeUnit.SECONDS).getMessage());
log.info("Finished testTopicProducerError");
}

@Test
Expand Down

0 comments on commit 2a2c73a

Please sign in to comment.