### Question:
WebServerServiceImpl implements WebServerService { @Override public Optional<WebServer> findById(Integer webServerId) { return webServerDao.findById(webServerId); }  @Override Optional<WebServer> findById(Integer webServerId);  }### Answer:
@Test public void find_by_id_no_data() { Optional<WebServer> webServerOption = webServerService.findById(1); assertThat(webServerOption).isEmpty(); }
@Test public void find_by_id_success() { WebServer webServer = new WebServer(); webServer.setArch(Arch.UNKNOWN); webServer.setIp("ip"); webServer.setOsType(OsType.UNKNOWN); webServer.setOsVersion("v1"); webServer.setServerToken("server_token"); webServer.setUserId(1); webServer.setCreateUserId(1); webServer.setCreateTime(LocalDateTime.now()); webServerDao.save(webServer); Optional<WebServer> webServerOption = webServerService.findById(webServer.getId()); assertThat(webServerOption).isPresent(); }