@Test public void shouldReturnFalseWhenNotSyncing() throws Exception { final boolean isSyncing = false; final tech.pegasys.teku.sync.SyncingStatus syncingStatus = new tech.pegasys.teku.sync.SyncingStatus(isSyncing, null); final SyncingStatus expectedResponse = new SyncingStatus(false, new SyncStatus(null, null, null)); final GetSyncing handler = new GetSyncing(syncDataProvider, jsonProvider); when(syncService.getSyncStatus()).thenReturn(syncingStatus); handler.handle(context); verify(context).result(jsonProvider.objectToJSON(expectedResponse)); verify(context).header(Header.CACHE_CONTROL, CACHE_NONE); }
@OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get synchronization status.", tags = {TAG_NODE}, description = "Returns an object with data about the synchronization status, or false if not synchronizing. " + "Replaced by standard api endpoint `/eth/v1/node/syncing`.", responses = { @OpenApiResponse(status = RES_OK, content = @OpenApiContent(from = SyncingStatus.class)), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override public void handle(Context ctx) throws Exception { ctx.header(CACHE_CONTROL, CACHE_NONE); final SyncingStatus syncingStatus = syncDataProvider.getSyncStatus(); ctx.result(jsonProvider.objectToJSON(syncingStatus)); }
GetSyncing implements Handler { @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get synchronization status.", tags = {TAG_NODE}, description = "Returns an object with data about the synchronization status, or false if not synchronizing. " + "Replaced by standard api endpoint `/eth/v1/node/syncing`.", responses = { @OpenApiResponse(status = RES_OK, content = @OpenApiContent(from = SyncingStatus.class)), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override public void handle(Context ctx) throws Exception { ctx.header(CACHE_CONTROL, CACHE_NONE); final SyncingStatus syncingStatus = syncDataProvider.getSyncStatus(); ctx.result(jsonProvider.objectToJSON(syncingStatus)); } }
GetSyncing implements Handler { @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get synchronization status.", tags = {TAG_NODE}, description = "Returns an object with data about the synchronization status, or false if not synchronizing. " + "Replaced by standard api endpoint `/eth/v1/node/syncing`.", responses = { @OpenApiResponse(status = RES_OK, content = @OpenApiContent(from = SyncingStatus.class)), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override public void handle(Context ctx) throws Exception { ctx.header(CACHE_CONTROL, CACHE_NONE); final SyncingStatus syncingStatus = syncDataProvider.getSyncStatus(); ctx.result(jsonProvider.objectToJSON(syncingStatus)); } GetSyncing(SyncDataProvider syncDataProvider, JsonProvider jsonProvider); }
GetSyncing implements Handler { @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get synchronization status.", tags = {TAG_NODE}, description = "Returns an object with data about the synchronization status, or false if not synchronizing. " + "Replaced by standard api endpoint `/eth/v1/node/syncing`.", responses = { @OpenApiResponse(status = RES_OK, content = @OpenApiContent(from = SyncingStatus.class)), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override public void handle(Context ctx) throws Exception { ctx.header(CACHE_CONTROL, CACHE_NONE); final SyncingStatus syncingStatus = syncDataProvider.getSyncStatus(); ctx.result(jsonProvider.objectToJSON(syncingStatus)); } GetSyncing(SyncDataProvider syncDataProvider, JsonProvider jsonProvider); @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get synchronization status.", tags = {TAG_NODE}, description = "Returns an object with data about the synchronization status, or false if not synchronizing. " + "Replaced by standard api endpoint `/eth/v1/node/syncing`.", responses = { @OpenApiResponse(status = RES_OK, content = @OpenApiContent(from = SyncingStatus.class)), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override void handle(Context ctx); }
GetSyncing implements Handler { @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get synchronization status.", tags = {TAG_NODE}, description = "Returns an object with data about the synchronization status, or false if not synchronizing. " + "Replaced by standard api endpoint `/eth/v1/node/syncing`.", responses = { @OpenApiResponse(status = RES_OK, content = @OpenApiContent(from = SyncingStatus.class)), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override public void handle(Context ctx) throws Exception { ctx.header(CACHE_CONTROL, CACHE_NONE); final SyncingStatus syncingStatus = syncDataProvider.getSyncStatus(); ctx.result(jsonProvider.objectToJSON(syncingStatus)); } GetSyncing(SyncDataProvider syncDataProvider, JsonProvider jsonProvider); @OpenApi( deprecated = true, path = ROUTE, method = HttpMethod.GET, summary = "Get synchronization status.", tags = {TAG_NODE}, description = "Returns an object with data about the synchronization status, or false if not synchronizing. " + "Replaced by standard api endpoint `/eth/v1/node/syncing`.", responses = { @OpenApiResponse(status = RES_OK, content = @OpenApiContent(from = SyncingStatus.class)), @OpenApiResponse(status = RES_INTERNAL_ERROR) }) @Override void handle(Context ctx); static final String ROUTE; }