@Test
    public void testEntrySpanMQRef() {
        final MockReceiver mockReceiver = new MockReceiver();
        RPCAnalysisListener listener = new RPCAnalysisListener(
            mockReceiver,
            CONFIG,
            CACHE,
            NAMING_CONTROL
        );

        final long startTime = System.currentTimeMillis();
        SpanObject spanObject = SpanObject.newBuilder()
                                          .setOperationName("/springMVC")
                                          .setStartTime(startTime)
                                          .setEndTime(startTime + 1000L)
                                          .setIsError(true)
                                          .setSpanType(SpanType.Entry)
                                          .setSpanLayer(SpanLayer.MQ)
                                          .addRefs(
                                              SegmentReference.newBuilder()
                                                              .setRefType(RefType.CrossProcess)
                                                              .setParentService("downstream-service")
                                                              .setParentServiceInstance("downstream-instance")
                                                              .setParentEndpoint("downstream-endpoint")
                                                              .setNetworkAddressUsedAtPeer("127.0.0.1")
                                                              .build()
                                          )
                                          .build();
        final SegmentObject segment = SegmentObject.newBuilder()
                                                   .setService("mock-service")
                                                   .setServiceInstance("mock-instance")
                                                   .addSpans(spanObject)
                                                   .build();
        listener.parseEntry(spanObject, segment);
        listener.build();

        final List<ISource> receivedSources = mockReceiver.getReceivedSources();
        Assertions.assertEquals(6, receivedSources.size());
        final Service service = (Service) receivedSources.get(0);
        final ServiceInstance serviceInstance = (ServiceInstance) receivedSources.get(1);
        final ServiceRelation serviceRelation = (ServiceRelation) receivedSources.get(2);
        final ServiceInstanceRelation serviceInstanceRelation = (ServiceInstanceRelation) receivedSources.get(3);
        final Endpoint endpoint = (Endpoint) receivedSources.get(4);
        final EndpointRelation endpointRelation = (EndpointRelation) receivedSources.get(5);
        Assertions.assertEquals("mock-service", service.getName());
        Assertions.assertEquals("mock-instance", serviceInstance.getName());
        Assertions.assertEquals("/springMVC", endpoint.getName());
        Assertions.assertEquals("127.0.0.1", serviceRelation.getSourceServiceName());
        Assertions.assertEquals(service.getName(), serviceRelation.getDestServiceName());
        Assertions.assertEquals("127.0.0.1", serviceInstanceRelation.getSourceServiceInstanceName());
        Assertions.assertEquals(serviceInstance.getName(), serviceInstanceRelation.getDestServiceInstanceName());
        Assertions.assertEquals("downstream-endpoint", endpointRelation.getEndpoint());
        Assertions.assertEquals("downstream-service", endpointRelation.getServiceName());
        Assertions.assertEquals(endpoint.getName(), endpointRelation.getChildEndpoint());
    }
Entry span with ref, but as a MQ server, or uninstrumented server.
oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/RPCAnalysisListenerTest.java