mirror of https://github.com/apache/kafka.git
KAFKA-14283: Fix connector creation Auth tests (#12721)
Reviewers: Sagar Rao <sagarmeansocean@gmail.com>, Chris Egerton <chrise@aiven.io>
This commit is contained in:
parent
42b311ed44
commit
de05665876
|
@ -334,8 +334,11 @@ public class ConnectorsResourceTest {
|
|||
EasyMock.expect(httpHeaders.getHeaderString("Authorization")).andReturn("Basic YWxhZGRpbjpvcGVuc2VzYW1l").times(1);
|
||||
EasyMock.replay(httpHeaders);
|
||||
herder.putConnectorConfig(EasyMock.eq(CONNECTOR_NAME), EasyMock.eq(body.config()), EasyMock.eq(false), EasyMock.capture(cb));
|
||||
expectAndCallbackResult(cb, new Herder.Created<>(true, new ConnectorInfo(CONNECTOR_NAME, CONNECTOR_CONFIG,
|
||||
CONNECTOR_TASK_NAMES, ConnectorType.SOURCE)));
|
||||
expectAndCallbackNotLeaderException(cb);
|
||||
|
||||
EasyMock.expect(RestClient.httpRequest(EasyMock.eq(LEADER_URL + "connectors?forward=false"),
|
||||
EasyMock.eq("POST"), EasyMock.eq(httpHeaders), EasyMock.anyObject(), EasyMock.anyObject(), EasyMock.anyObject(WorkerConfig.class)))
|
||||
.andReturn(new RestClient.HttpResponse<>(202, new HashMap<>(), null));
|
||||
|
||||
PowerMock.replayAll();
|
||||
|
||||
|
@ -354,8 +357,11 @@ public class ConnectorsResourceTest {
|
|||
EasyMock.expect(httpHeaders.getHeaderString("Authorization")).andReturn(null).times(1);
|
||||
EasyMock.replay(httpHeaders);
|
||||
herder.putConnectorConfig(EasyMock.eq(CONNECTOR_NAME), EasyMock.eq(body.config()), EasyMock.eq(false), EasyMock.capture(cb));
|
||||
expectAndCallbackResult(cb, new Herder.Created<>(true, new ConnectorInfo(CONNECTOR_NAME, CONNECTOR_CONFIG,
|
||||
CONNECTOR_TASK_NAMES, ConnectorType.SOURCE)));
|
||||
expectAndCallbackNotLeaderException(cb);
|
||||
|
||||
EasyMock.expect(RestClient.httpRequest(EasyMock.eq(LEADER_URL + "connectors?forward=false"),
|
||||
EasyMock.eq("POST"), EasyMock.eq(httpHeaders), EasyMock.anyObject(), EasyMock.anyObject(), EasyMock.anyObject(WorkerConfig.class)))
|
||||
.andReturn(new RestClient.HttpResponse<>(202, new HashMap<>(), null));
|
||||
|
||||
PowerMock.replayAll();
|
||||
|
||||
|
|
Loading…
Reference in New Issue