MetricProfileController { @PostMapping @ResponseStatus(HttpStatus.CREATED) public String createMetricProfile(@RequestBody CreateMetricProfilingRequest request) { request.validate(); return metricProfilingRepo.createMetricProfile(request); }  @PostMapping @ResponseStatus(HttpStatus.CREATED) String createMetricProfile(@RequestBody CreateMetricProfilingRequest request); @PutMapping @ResponseStatus(HttpStatus.OK) void updateMetricProfile(@RequestParam String id, @RequestParam Boolean isStationary); @PostMapping @RequestMapping(value = "/search/findByTags") Boolean profilingExists(@RequestBody Map<String, String> tags);  }
@Test public void testCreateMetricProfile() { val createMetricProfilingRequest = new CreateMetricProfilingRequest(); createMetricProfilingRequest.setExpression(expression); createMetricProfilingRequest.setIsStationary(true); val response = controllerUnderTest.createMetricProfile(createMetricProfilingRequest); assertNotNull(response); }
@Test(expected = IllegalArgumentException.class) public void testCreateMetricProfile_notNull() throws IOException { controllerUnderTest.createMetricProfile(new CreateMetricProfilingRequest()); }