ByteArrayOutputStream createConnectivityRequest(String uuid, FlowRule rule) {
        /*
        {
            "tapi-connectivity:connectivity-service":[
                {
                    "uuid":"ffb006d4-349e-4d2f-817e-0906c88458d0",
                    "service-layer":"PHOTONIC_MEDIA",
                    "service-type":"POINT_TO_POINT_CONNECTIVITY",
                    "end-point":[
                        {
                            "local-id":"1",
                            "layer-protocol-name":"PHOTONIC_MEDIA",
                            "layer-protocol-qualifier":"tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC",
                            "service-interface-point":{
                                "service-interface-point-uuid":"0923962e-b83f-4702-9b16-a1a0db0dc1f9"
                            }
                        },
                        {
                            "local-id":"2",
                            "layer-protocol-name":"PHOTONIC_MEDIA",
                            "layer-protocol-qualifier":"tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC",
                            "service-interface-point":{
                                "service-interface-point-uuid":"76be95de-5769-4e5d-b65e-62cb6c39cf6b "
                            }
                        }
                    ]
               }
           ]
        }
        */
        DeviceService deviceService = handler().get(DeviceService.class);
        PortCriterion inputPortCriterion = (PortCriterion) checkNotNull(rule.selector()
                .getCriterion(Criterion.Type.IN_PORT));
        String inputPortUuid = deviceService.getPort(rule.deviceId(),
                inputPortCriterion.port()).annotations().value(TapiDeviceHelper.UUID);

        Instructions.OutputInstruction outInstruction = (Instructions.OutputInstruction) checkNotNull(rule.treatment()
                .allInstructions().stream().filter(instr -> instr.type().equals(Instruction.Type.OUTPUT))
                .findFirst().orElse(null));
        String outputPortUuid = deviceService.getPort(rule.deviceId(),
                outInstruction.port()).annotations().value(TapiDeviceHelper.UUID);
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        try {
            JsonGenerator generator = getJsonGenerator(stream);
            generator.writeStartObject();
            generator.writeArrayFieldStart(TAPI_CONNECTIVITY_CONNECTIVITY_SERVICE);
            generator.writeStartObject();
            generator.writeStringField(TapiDeviceHelper.UUID, uuid);
            generator.writeStringField(SERVICE_LAYER, PHOTONIC_MEDIA);
            generator.writeStringField(SERVICE_TYPE, POINT_TO_POINT_CONNECTIVITY);
            generator.writeArrayFieldStart(END_POINT);
            //ADVA OLS requires these to be 1,2 for every connection
            addEndPoint(generator, inputPortUuid, 1);
            addEndPoint(generator, outputPortUuid, 2);
            generator.writeEndArray();
            generator.writeEndObject();
            generator.writeEndArray();
            generator.writeEndObject();
            generator.close();
            return stream;
        } catch (IOException e) {
            log.error("Cant' create json", e);
        }
        return stream;
    }
@Test
    public void createConnRequest() {
        String output = tapiFrp.createConnectivityRequest(CONNECTION_UUID, FLOW_RULE).toString();
        System.out.println(output);
        assertEquals("Json to create network connectivity is wrong", CONNECTIVITY_REQUEST, output);
    }