### Question:
TopologyResource { @PUT @Path("/{topologyId}") @Consumes(MediaType.APPLICATION_JSON) public Response updateTopology(@PathParam("topologyId") String topologyId, Topology topology) { String userId = (String) SecurityUtils.getSubject().getPrincipal(); topologyService.updateTopology(topologyId, topology, userId); return Response.ok().build(); } @Inject  TopologyResource(TopologyService topologyService); @GET @Produces(MediaType.APPLICATION_JSON) List<Topology> listTopologies(); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Topology createTopology(Topology topology); @GET @Path("/{topologyId}") @Produces(MediaType.APPLICATION_JSON) Topology getTopology(@PathParam("topologyId") String topologyId); @PUT @Path("/{topologyId}") @Consumes(MediaType.APPLICATION_JSON) Response updateTopology(@PathParam("topologyId") String topologyId, Topology topology); @DELETE @Path("/{topologyId}") Response deleteTopology(@PathParam("topologyId") String topologyId); @GET @Path("/{topologyId}/config") @Produces(MediaType.APPLICATION_JSON) TopologyConfig getTopologyConfig(@PathParam("topologyId") String topologyId); @PUT @Path("/{topologyId}/config") @Consumes(MediaType.APPLICATION_JSON) Response updateTopologyConfig(@PathParam("topologyId") String topologyId,
            TopologyConfig topologyConfig); @GET @Path("/{topologyId}/config/deployed") @Produces(MediaType.APPLICATION_JSON) TopologyConfig getDeployedTopologyConfig(@PathParam("topologyId") String topologyId); @GET @Path("/{topologyId}/info") @Produces(MediaType.APPLICATION_JSON) TopologyInfo getTopologyInfo(@PathParam("topologyId") String topologyId); @GET @Path("/{topologyId}/submit") @Produces(MediaType.APPLICATION_JSON) Topology submitTopology(@PathParam("topologyId") String topologyId,
            @QueryParam("clusterId") String clusterId,
            @QueryParam("logLevel") @DefaultValue("INFO") String logLevel,
            @QueryParam("classLoaderPolicy") @DefaultValue("FRAMEWORK_FIRST") String classLoaderPolicy); @GET @Path("/{topologyId}/kill") Response killTopology(@PathParam("topologyId") String topologyId,
            @QueryParam("waitTimeSecs") @DefaultValue("0") int waitTimeSecs,
            @QueryParam("async") @DefaultValue("false") boolean async); @GET @Path("/{topologyId}/clear") Response clearTopology(@PathParam("topologyId") String topologyId); @POST @Path("/{topologyId}/log") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) TopologyLogPage getTopologyLogCluster(@PathParam("topologyId") String topologyId,
            TopologyLogCriteria criteria); @GET @Path("/{topologyId}/log") @Produces(MediaType.APPLICATION_JSON) TopologyLog getTopologyLogLocal(@PathParam("topologyId") String topologyId,
            @QueryParam("offset") long offset, @QueryParam("limit") long limit);  }### Answer:
@Test public void updateTopologyWhileAuthenticated() { final Topology requestTopology = RandomGenerator.randomObject(Topology.class); doNothing() .when(topologyServiceMock) .updateTopology(requestTopology.getId(), requestTopology, TEST_SUBJECT_ID); mockAuthenticatedSubject(); ClientResponse clientResponse = resource().path("/api/topologies/" + requestTopology.getId()) .accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON) .put(ClientResponse.class, requestTopology); assertEquals("Response HTTP status code should be 200 (OK)", clientResponse.getStatus(), 200); verify(topologyServiceMock) .updateTopology(requestTopology.getId(), requestTopology, TEST_SUBJECT_ID); }