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

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

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

        final NeutronSubnet subnet = (NeutronSubnet)
                            jsonToModelEntity(inputStr, NeutronSubnet.class);

        adminService.updateSubnet(subnet);

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

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

        Response response = wt.path(PATH + "/d32019d3-bc6e-4319-9c1d-6722fc136a22")
                .request(MediaType.APPLICATION_JSON_TYPE)
                .put(Entity.json(jsonStream));
        final int status = response.getStatus();

        assertThat(status, is(200));

        verify(mockOpenstackNetworkAdminService);
    }