Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resume testUpdateSystemProperty() #18

Closed
gkwan-ibm opened this issue Aug 21, 2020 · 1 comment
Closed

Resume testUpdateSystemProperty() #18

gkwan-ibm opened this issue Aug 21, 2020 · 1 comment
Labels
Blocked by Blocked by other issue

Comments

@gkwan-ibm
Copy link
Member

gkwan-ibm commented Aug 21, 2020

Because MST RESTClient does not support CompletionStage, the testUpdateSystemProperty() in inventory/src/test/java/it/io/openliberty/guides/inventory/InventoryServiceIT.java was disabled.

When MicroShed/microshed-testing#213 is resolved, resume the testUpdateSystemProperty() test case:

    @Test
    public void testUpdateSystemProperty() throws ExecutionException, InterruptedException {
        CountDownLatch countDown = new CountDownLatch(1);
        int responseStatus[] = new int[] {0};
        inventoryResource.updateSystemProperty("os.name").thenAcceptAsync(r -> {
            responseStatus[0] = r.getStatus();
            countDown.countDown();
        });

        try {
            countDown.await();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        Assertions.assertEquals(200, responseStatus[0],
                "Response should be 200");

        ConsumerRecords<String, String> records = propertyConsumer.poll(Duration.ofMillis(30*1000));
        System.out.println("Polled " + records.count() + " records from Kafka:");
        assertTrue(records.count() > 0, "No records processed");
        for (ConsumerRecord<String, String> record : records) {
            String p = record.value();
            System.out.println(p);
            assertEquals("os.name", p);
        }
        
        propertyConsumer.commitAsync();
    }
@gkwan-ibm gkwan-ibm changed the title Resume testGetProperty() Resume testUpdateSystemProperty() Aug 21, 2020
@gkwan-ibm gkwan-ibm added the Blocked by Blocked by other issue label Jun 22, 2021
@gkwan-ibm
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked by Blocked by other issue
Projects
None yet
Development

No branches or pull requests

1 participant