@PUT
    @Path("{id}")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Response updatePort(@PathParam("id") String id, InputStream input) {
        log.trace(String.format(MESSAGE, "UPDATED"));

        try {
            ObjectNode jsonTree = readTreeFromStream(mapper(), input);
            JsonNode specifiedPortId = jsonTree.get("portId");

            if (specifiedPortId != null && !specifiedPortId.asText().equals(id)) {
                throw new IllegalArgumentException(PORT_INVALID);
            }

            final K8sPort port = codec(K8sPort.class).decode(jsonTree, this);
            adminService.updatePort(port);
        } catch (IOException e) {
            throw new IllegalArgumentException(e);
        }

        return Response.ok().build();
    }
@Test
    public void testUpdatePortWithModifyOperation() {
        mockAdminService.updatePort(anyObject());
        replay(mockAdminService);

        String location = PATH + "/port-1";

        final WebTarget wt = target();
        InputStream jsonStream = K8sPortWebResourceTest.class
                .getResourceAsStream("k8s-port.json");
        Response response = wt.path(location)
                .request(MediaType.APPLICATION_JSON_TYPE)
                .put(Entity.json(jsonStream));
        final int status = response.getStatus();

        assertThat(status, is(200));

        verify(mockAdminService);
    }