| | |
| | | this.logger.debug(origin+": "+highways); |
| | | return highways; |
| | | } |
| | | |
| | | @GetMapping("/countOrigins") |
| | | public Long findByOrigin() { |
| | | this.logger.debug("----- countOrigins -----"); |
| | | |
| | | Long count = 0L;// this.highwayRepository. |
| | | this.logger.debug("Count distinct Origins: "+count); |
| | | return count; |
| | | } |
| | | |
| | | } |
| | |
| | | mockMvc.perform(get("/highways/findByOrigin/{origin}", "Dortmund")) |
| | | .andExpect(jsonPath("$.size()",is(2))); |
| | | } |
| | | |
| | | @Test |
| | | void test02_countOrigins() throws Exception { |
| | | mockMvc.perform(get("/highways/countOrigins")) |
| | | .andExpect(jsonPath("$",is(2))); |
| | | } |
| | | } |