class Router {

  @GetMapping("build/{uuid}")
  public BuildDetails getBuild(@PathVariable("uuid") final String buildUuid) {
    return buildService.get(buildUuid).orElseThrow(ResourceNotFoundException::new);
  }

}

class RouterTest  {

  protected Router router;
  @Mock
  protected BuildService buildService;
  @Mock
  protected ContractService contractService;
  @Mock
  protected LiveUpdateService liveUpdateService;

  @Test
  public void testGetBuild() {

    final String buildUuid = randomUUID().toString();
    when(buildService.get(anyString())).thenReturn(ofNullable(new BuildDetails()));
    router.getBuild(buildUuid);
  }

}