@Test public void resetTopicConfig_existingConfig_resetsConfig() { expect( topicConfigManager.resetTopicConfig( CLUSTER_ID, TOPIC_NAME, CONFIG_1.getName())) .andReturn(completedFuture(null)); replay(topicConfigManager); FakeAsyncResponse response = new FakeAsyncResponse(); topicConfigsResource.resetTopicConfig( response, CLUSTER_ID, TOPIC_NAME, CONFIG_1.getName()); assertNull(response.getValue()); assertNull(response.getException()); assertTrue(response.isDone()); }
@DELETE @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.delete") public void resetTopicConfig( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @PathParam("name") String name ) { CompletableFuture<Void> response = topicConfigManager.get().resetTopicConfig(clusterId, topicName, name); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); }
TopicConfigsResource { @DELETE @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.delete") public void resetTopicConfig( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @PathParam("name") String name ) { CompletableFuture<Void> response = topicConfigManager.get().resetTopicConfig(clusterId, topicName, name); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } }
TopicConfigsResource { @DELETE @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.delete") public void resetTopicConfig( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @PathParam("name") String name ) { CompletableFuture<Void> response = topicConfigManager.get().resetTopicConfig(clusterId, topicName, name); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  TopicConfigsResource(
      Provider<TopicConfigManager> topicConfigManager,
      CrnFactory crnFactory,
      UrlFactory urlFactory); }
TopicConfigsResource { @DELETE @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.delete") public void resetTopicConfig( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @PathParam("name") String name ) { CompletableFuture<Void> response = topicConfigManager.get().resetTopicConfig(clusterId, topicName, name); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  TopicConfigsResource(
      Provider<TopicConfigManager> topicConfigManager,
      CrnFactory crnFactory,
      UrlFactory urlFactory); @GET @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.list") void listTopicConfigs(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName
  ); @GET @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.get") void getTopicConfig(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName,
      @PathParam("name") String name
  ); @PUT @Path("/{name}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.update") void updateTopicConfig(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName,
      @PathParam("name") String name,
      @Valid UpdateTopicConfigRequest request
  ); @DELETE @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.delete") void resetTopicConfig(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName,
      @PathParam("name") String name
  ); }
TopicConfigsResource { @DELETE @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.delete") public void resetTopicConfig( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @PathParam("name") String name ) { CompletableFuture<Void> response = topicConfigManager.get().resetTopicConfig(clusterId, topicName, name); AsyncResponseBuilder.from(Response.status(Status.NO_CONTENT)) .entity(response) .asyncResume(asyncResponse); } @Inject  TopicConfigsResource(
      Provider<TopicConfigManager> topicConfigManager,
      CrnFactory crnFactory,
      UrlFactory urlFactory); @GET @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.list") void listTopicConfigs(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName
  ); @GET @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.get") void getTopicConfig(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName,
      @PathParam("name") String name
  ); @PUT @Path("/{name}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.update") void updateTopicConfig(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName,
      @PathParam("name") String name,
      @Valid UpdateTopicConfigRequest request
  ); @DELETE @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.configs.delete") void resetTopicConfig(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName,
      @PathParam("name") String name
  );  }