VmManagementResource implements VmManagementEndpoint { @GET @Path(PATH_LIST_SERVER_INFOS) @Override public List<ServerInfo> getServerInfos() { return serverInfoResolver.resolveAll(); } @Inject  VmManagementResource(ServerInfoResolver serverInfoResolver, VMOperations vmOps); @GET @Path(PATH_LIST_SERVER_INFOS) @Override List<ServerInfo> getServerInfos(); @GET @Path(PATH_LIST_AGENTS) @Override List<VMOperations.AgentInfo> getAgents(@QueryParam("detached") Boolean detached); @GET @Path(PATH_LIST_JOBS_ON_VM) @Override Map<String, List<VMOperations.JobsOnVMStatus>> getJobsOnVM(
            @QueryParam("idleOnly") boolean idleOnly,
            @QueryParam("excludeIdle") boolean excludeIdle);  }
@Test public void testGetServerInfos() { when(serverInfoResolver.resolveAll()).thenReturn(Collections.singletonList(createServerInfo())); testClient.get().uri(VmManagementEndpoint.PATH_LIST_SERVER_INFOS).exchange() .expectBody(LIST_SERVER_INFOS_TREF) .value(serverInfos -> assertThat(serverInfos).hasSize(1)); verify(serverInfoResolver, times(1)).resolveAll(); }