@PUT
    @Path("{id}")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Response updateRouter(@PathParam("id") String id, InputStream input) throws IOException {
        log.trace(String.format(MESSAGE_ROUTER, "UPDATE " + id));

        String inputStr = IOUtils.toString(input, REST_UTF8);

        if (!haService.isActive()
                && !DEFAULT_ACTIVE_IP_ADDRESS.equals(haService.getActiveIp())) {
            return syncPut(haService, ROUTERS, id, inputStr);
        }

        final NeutronRouter osRouter = (NeutronRouter)
                jsonToModelEntity(inputStr, NeutronRouter.class);

        osRouter.setId(id);
        adminService.updateRouter(osRouter);

        return status(Response.Status.OK).build();
    }
@Test
    public void testUpdateRouterWithUpdatingOperation() {
        expect(mockOpenstackHaService.isActive()).andReturn(true).anyTimes();
        replay(mockOpenstackHaService);
        mockOpenstackRouterAdminService.updateRouter(anyObject());
        replay(mockOpenstackRouterAdminService);

        final WebTarget wt = target();
        InputStream jsonStream = OpenstackRouterWebResourceTest.class
                .getResourceAsStream("openstack-router.json");

        Response response = wt.path(PATH + "/f49a1319-423a-4ee6-ba54-1d95a4f6cc68")
                .request(MediaType.APPLICATION_JSON_TYPE)
                .put(Entity.json(jsonStream));
        final int status = response.getStatus();

        assertThat(status, is(200));

        verify(mockOpenstackRouterAdminService);
    }