@POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Response createNetwork(InputStream input) {
        log.trace(String.format(MESSAGE, "CREATE"));
        URI location;

        try {
            ObjectNode jsonTree = readTreeFromStream(mapper(), input);
            final K8sNetwork network = codec(K8sNetwork.class).decode(jsonTree, this);
            adminService.createNetwork(network);
            location = new URI(network.networkId());
        } catch (IOException | URISyntaxException e) {
            throw new IllegalArgumentException(e);
        }

        return Response.created(location).build();
    }
@Test
    public void testCreateNetworkWithCreateOperation() {
        mockAdminService.createNetwork(anyObject());
        replay(mockAdminService);

        final WebTarget wt = target();
        InputStream jsonStream = K8sNetworkWebResourceTest.class
                .getResourceAsStream("k8s-network.json");
        Response response = wt.path(PATH).request(MediaType.APPLICATION_JSON_TYPE)
                .post(Entity.json(jsonStream));
        final int status = response.getStatus();

        assertThat(status, is(201));

        verify(mockAdminService);
    }