### Question:
SagaTransactionsController { @GetMapping(value = "/transactions") public ResponseEntity<Collection<SagaTransactionsController.TxEventVo>> getTransactions( @RequestParam(name = "status") String status) { Iterable<TxEvent> events; List<SagaTransactionsController.TxEventVo> eventVos = new LinkedList<>(); switch (status) { case "PENDING": events = eventRepository.findPendingEvents(); events.forEach(event -> eventVos.add(new SagaTransactionsController.TxEventVo(event))); break; case "COMMITTED": events = eventRepository.findCommittedEvents(); events.forEach(event -> eventVos.add(new SagaTransactionsController.TxEventVo(event))); break; case "COMPENSATING": events = eventRepository.findCompensatingEvents(); events.forEach(event -> eventVos.add(new SagaTransactionsController.TxEventVo(event))); break; case "ROLLBACKED": events = eventRepository.findRollBackedEvents(); events.forEach(event -> eventVos.add(new SagaTransactionsController.TxEventVo(event))); break; case "ALL": events = eventRepository.findAll(); events.forEach(event -> eventVos.add(new SagaTransactionsController.TxEventVo(event))); break; default: LOG.info("Unknown Status"); } return ResponseEntity.ok(eventVos); } SagaTransactionsController(TxEventEnvelopeRepository eventRepository); @GetMapping(value = "/stats") ResponseEntity<Stats> getStats(); @GetMapping(value = "/recent") ResponseEntity<Collection<SagaTransactionsController.TxEventVo>> recentTransactions(
      @RequestParam(name = "status") String status, @RequestParam(name = "count") int count); @GetMapping(value = "/transactions") ResponseEntity<Collection<SagaTransactionsController.TxEventVo>> getTransactions(
      @RequestParam(name = "status") String status); @GetMapping(value = "/findTransactions") ResponseEntity<Collection<SagaTransactionsController.TxEventVo>> findTransactions(
      @RequestParam(required = false, name = "globalTxID") Object globalTxID,
      @RequestParam(required = false, name = "microServiceName") String microServiceName);  }### Answer:
@Test public void getTransactionsTest() throws Exception { mockMvc.perform(get("/saga/transactions?status=PENDING")) .andExpect(status().isOk()) .andExpect(jsonPath("$", hasSize(2))); mockMvc.perform(get("/saga/transactions?status=COMMITTED")) .andExpect(status().isOk()) .andExpect(jsonPath("$", hasSize(4))); mockMvc.perform(get("/saga/transactions?status=COMPENSATING")) .andExpect(status().isOk()) .andExpect(jsonPath("$", hasSize(3))); mockMvc.perform(get("/saga/transactions?status=ROLLBACKED")) .andExpect(status().isOk()) .andExpect(jsonPath("$", hasSize(5))); mockMvc.perform(get("/saga/transactions?status=ALL")) .andExpect(status().isOk()) .andExpect(jsonPath("$", hasSize(1))); mockMvc.perform(get("/saga/transactions?status=FAILURECondition")) .andExpect(status().isOk()) .andExpect(jsonPath("$", hasSize(0))); }