11*** Settings ***
22Library ConfluentKafkaLibrary
3- Library oauth_example
3+ Library oauth2_test
44Library Collections
55Library String
66
77
88*** Variables ***
9- ${SEEN_RF_OAUTH_CB } ${False }
9+ ${SEEN_RF_OAUTH_CB_PRODUCER } ${False }
10+ ${SEEN_RF_OAUTH_CB_CONSUMER } ${False }
11+ ${KAFKA_BOOTSTRAP_SERVERS } localhost:9092
12+ ${TEST_TOPIC } oauth2-test-topic
1013
1114
1215*** Test Cases ***
13- Example Oauth
14- [Documentation] Example of how to use OAUTH with library and call functools
15- ... via get_token function. For better handling there could be
16- ... some global variable which can be set inside of python lib.
17- ... Not executable right now, needs update env (issue #21).
16+ Test OAuth2 Token Generation
17+ ${ test_token } = oauth2_test.create_test_token
18+ Should Not Be Empty ${ test_token }
19+ ${ producer_token_func } = oauth2_test.get_test_producer_token
20+ ${ consumer_token_func } = oauth2_test.get_test_consumer_token
1821
19- Skip
2022
23+ Test OAuth2 Library Integration
2124 ${string_serializer } = Get String Serializer
22- ${value_serializer } = Get String Serializer
23-
24- # This returns: functools.partial(<function oauth_cb at 0x7f...>, 'configuration')
25- ${ fun } = oauth_example.get_token configuration
26-
27- ${ producer_id } = Create Producer key_serializer= ${ string_serializer } value_serializer= ${ value_serializer } legacy= ${ False } security.protocol=sasl_plaintext sasl.mechanisms=OAUTHBEARER oauth_cb= ${ fun }
28-
29- #...
25+ ${oauth_func } = oauth2_test.get_test_producer_token
26+
27+ ${ status } ${ error } = Run Keyword And Ignore Error
28+ ... Create Producer localhost:9092
29+ ... oauth_cb= ${ oauth_func }
30+ ... security.protocol=sasl_plaintext
31+ ... sasl.mechanisms=OAUTHBEARER
32+ Should Be Equal ${ status } PASS
0 commit comments