Search in sources :

Example 1 with TopicsSpec

use of org.apache.kafka.trogdor.workload.TopicsSpec in project kafka by apache.

the class JsonSerializationTest method testDeserializationDoesNotProduceNulls.

@Test
public void testDeserializationDoesNotProduceNulls() throws Exception {
    verify(new FilesUnreadableFaultSpec(0, 0, null, null, null, 0));
    verify(new Kibosh.KiboshControlFile(null));
    verify(new NetworkPartitionFaultSpec(0, 0, null));
    verify(new ProcessStopFaultSpec(0, 0, null, null));
    verify(new AgentStatusResponse(0, null));
    verify(new TasksResponse(null));
    verify(new WorkerDone(null, null, 0, 0, null, null));
    verify(new WorkerRunning(null, null, 0, null));
    verify(new WorkerStopping(null, null, 0, null));
    verify(new ProduceBenchSpec(0, 0, null, null, 0, 0, null, null, Optional.empty(), null, null, null, null, null, false, false));
    verify(new RoundTripWorkloadSpec(0, 0, null, null, null, null, null, null, 0, null, null, 0));
    verify(new TopicsSpec());
    verify(new PartitionsSpec(0, (short) 0, null, null));
    Map<Integer, List<Integer>> partitionAssignments = new HashMap<Integer, List<Integer>>();
    partitionAssignments.put(0, Arrays.asList(1, 2, 3));
    partitionAssignments.put(1, Arrays.asList(1, 2, 3));
    verify(new PartitionsSpec(0, (short) 0, partitionAssignments, null));
    verify(new PartitionsSpec(0, (short) 0, null, null));
}
Also used : WorkerDone(org.apache.kafka.trogdor.rest.WorkerDone) WorkerStopping(org.apache.kafka.trogdor.rest.WorkerStopping) TasksResponse(org.apache.kafka.trogdor.rest.TasksResponse) WorkerRunning(org.apache.kafka.trogdor.rest.WorkerRunning) HashMap(java.util.HashMap) NetworkPartitionFaultSpec(org.apache.kafka.trogdor.fault.NetworkPartitionFaultSpec) RoundTripWorkloadSpec(org.apache.kafka.trogdor.workload.RoundTripWorkloadSpec) Kibosh(org.apache.kafka.trogdor.fault.Kibosh) AgentStatusResponse(org.apache.kafka.trogdor.rest.AgentStatusResponse) ProcessStopFaultSpec(org.apache.kafka.trogdor.fault.ProcessStopFaultSpec) ProduceBenchSpec(org.apache.kafka.trogdor.workload.ProduceBenchSpec) PartitionsSpec(org.apache.kafka.trogdor.workload.PartitionsSpec) FilesUnreadableFaultSpec(org.apache.kafka.trogdor.fault.FilesUnreadableFaultSpec) List(java.util.List) TopicsSpec(org.apache.kafka.trogdor.workload.TopicsSpec) Test(org.junit.jupiter.api.Test)

Aggregations

HashMap (java.util.HashMap)1 List (java.util.List)1 FilesUnreadableFaultSpec (org.apache.kafka.trogdor.fault.FilesUnreadableFaultSpec)1 Kibosh (org.apache.kafka.trogdor.fault.Kibosh)1 NetworkPartitionFaultSpec (org.apache.kafka.trogdor.fault.NetworkPartitionFaultSpec)1 ProcessStopFaultSpec (org.apache.kafka.trogdor.fault.ProcessStopFaultSpec)1 AgentStatusResponse (org.apache.kafka.trogdor.rest.AgentStatusResponse)1 TasksResponse (org.apache.kafka.trogdor.rest.TasksResponse)1 WorkerDone (org.apache.kafka.trogdor.rest.WorkerDone)1 WorkerRunning (org.apache.kafka.trogdor.rest.WorkerRunning)1 WorkerStopping (org.apache.kafka.trogdor.rest.WorkerStopping)1 PartitionsSpec (org.apache.kafka.trogdor.workload.PartitionsSpec)1 ProduceBenchSpec (org.apache.kafka.trogdor.workload.ProduceBenchSpec)1 RoundTripWorkloadSpec (org.apache.kafka.trogdor.workload.RoundTripWorkloadSpec)1 TopicsSpec (org.apache.kafka.trogdor.workload.TopicsSpec)1 Test (org.junit.jupiter.api.Test)1