Skip to content

Commit

Permalink
broker: test deleting topic
Browse files Browse the repository at this point in the history
  • Loading branch information
travisjeffery committed Oct 28, 2017
1 parent c66e9ed commit 790c1e9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions broker/broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,34 @@ func TestBroker_Run(t *testing.T) {
}},
},
},
{
name: "delete topic",
fields: newFields(),
args: args{
requestCh: make(chan jocko.Request, 2),
responseCh: make(chan jocko.Response, 2),
requests: []jocko.Request{{
Header: &protocol.RequestHeader{CorrelationID: 1},
Request: &protocol.CreateTopicRequests{Requests: []*protocol.CreateTopicRequest{{
Topic: "the-topic",
NumPartitions: 1,
ReplicationFactor: 1,
}}}}, {
Header: &protocol.RequestHeader{CorrelationID: 2},
Request: &protocol.DeleteTopicsRequest{Topics: []string{"the-topic"}}},
},
responses: []jocko.Response{{
Header: &protocol.RequestHeader{CorrelationID: 1},
Response: &protocol.Response{CorrelationID: 1, Body: &protocol.CreateTopicsResponse{
TopicErrorCodes: []*protocol.TopicErrorCode{{Topic: "the-topic", ErrorCode: protocol.ErrNone.Code()}},
}},
}, {
Header: &protocol.RequestHeader{CorrelationID: 2},
Response: &protocol.Response{CorrelationID: 2, Body: &protocol.DeleteTopicsResponse{
TopicErrorCodes: []*protocol.TopicErrorCode{{Topic: "the-topic", ErrorCode: protocol.ErrNone.Code()}},
}}}},
},
},
{
name: "produce version 2 ok",
fields: newFields(),
Expand Down

0 comments on commit 790c1e9

Please sign in to comment.