components/global/core/io.cellery.observability.tracing.receiver/src/test/java/io/cellery/observability/tracing/receiver/internal/CodecTestCase.java
private List<Span> generateSpans() {
        List<Span> spansList = new ArrayList<>();
        spansList.add(Span.newBuilder()
                .traceId("1234567890")
                .id("1234567891")
                .parentId("1234567890")
                .name("test-a-span")
                .kind(Span.Kind.CLIENT)
                .duration(10001)
                .timestamp(100000001)
                .remoteEndpoint(Endpoint.newBuilder()
                        .ip("192.168.56.101")
                        .port(9001)
                        .serviceName("hello")
                        .build())
                .localEndpoint(Endpoint.newBuilder()
                        .ip("192.168.56.100")
                        .port(9000)
                        .serviceName("hello-caller")
                        .build())
                .putTag("keyA1", "valueA1")
                .putTag("keyA2", "valueA2")
                .build());
        spansList.add(Span.newBuilder()
                .traceId("2234567890")
                .id("2234567891")
                .parentId("2234567890")
                .name("test-b-span")
                .kind(Span.Kind.SERVER)
                .duration(30001)
                .timestamp(300000001)
                .remoteEndpoint(Endpoint.newBuilder()
                        .ip("192.168.57.201")
                        .port(8004)
                        .serviceName("pet-fe")
                        .build())
                .localEndpoint(Endpoint.newBuilder()
                        .ip("192.168.57.205")
                        .port(7000)
                        .serviceName("pet-be")
                        .build())
                .putTag("keyB1", "valueB1")
                .putTag("keyB2", "valueB2")
                .putTag("keyB3", "valueB3")
                .build());
        spansList.add(Span.newBuilder()
                .traceId("3234567890")
                .id("3234567891")
                .parentId("3234567890")
                .name("test-c-span")
                .kind(Span.Kind.PRODUCER)
                .duration(40001)
                .timestamp(400000001)
                .localEndpoint(Endpoint.newBuilder()
                        .ip("192.168.60.232")
                        .port(10000)
                        .serviceName("hello-api-worker")
                        .build())
                .putTag("keyC1", "valueC1")
                .build());
        spansList.add(Span.newBuilder()
                .traceId("4234567890")
                .id("4234567891")
                .parentId("4234567890")
                .name("test-d-span")
                .kind(Span.Kind.CONSUMER)
                .duration(70001)
                .timestamp(400000001)
                .localEndpoint(Endpoint.newBuilder()
                        .ip("192.168.100.104")
                        .port(12000)
                        .serviceName("pet-recommendations")
                        .build())
                .putTag("keyD1", "valueD1")
                .putTag("keyD2", "valueD2")
                .putTag("keyD3", "valueD3")
                .putTag("keyD4", "valueD4")
                .build());
        spansList.add(Span.newBuilder()
                .traceId("4234567890")
                .id("4234567891")
                .parentId("4234567890")
                .name("test-d-span")
                .duration(70001)
                .timestamp(400000001)
                .putTag("keyD1", "valueD1")
                .putTag("keyD2", "valueD2")
                .putTag("keyD3", "valueD3")
                .putTag("keyD4", "valueD4")
                .build());
        return spansList;
    }
/**
     * Generate spans list for testing.
     *
     * @return The generated spans list
     */
Generate spans list for testing.
@return The generated spans list
Generate spans list for testing . @return The generated spans list
private List<Span> generateSpans() {
        List<Span> spansList = new ArrayList<>();
        spansList.add(Span.newBuilder()
                .traceId("1234567890")
                .id("1234567891")
                .parentId("1234567890")
                .name("test-a-span")
                .kind(Span.Kind.CLIENT)
                .duration(10001)
                .timestamp(100000001)
                .remoteEndpoint(Endpoint.newBuilder()
                        .ip("192.168.56.101")
                        .port(9001)
                        .serviceName("hello")
                        .build())
                .localEndpoint(Endpoint.newBuilder()
                        .ip("192.168.56.100")
                        .port(9000)
                        .serviceName("hello-caller")
                        .build())
                .putTag("keyA1", "valueA1")
                .putTag("keyA2", "valueA2")
                .build());
        spansList.add(Span.newBuilder()
                .traceId("2234567890")
                .id("2234567891")
                .parentId("2234567890")
                .name("test-b-span")
                .kind(Span.Kind.SERVER)
                .duration(30001)
                .timestamp(300000001)
                .remoteEndpoint(Endpoint.newBuilder()
                        .ip("192.168.57.201")
                        .port(8004)
                        .serviceName("pet-fe")
                        .build())
                .localEndpoint(Endpoint.newBuilder()
                        .ip("192.168.57.205")
                        .port(7000)
                        .serviceName("pet-be")
                        .build())
                .putTag("keyB1", "valueB1")
                .putTag("keyB2", "valueB2")
                .putTag("keyB3", "valueB3")
                .build());
        spansList.add(Span.newBuilder()
                .traceId("3234567890")
                .id("3234567891")
                .parentId("3234567890")
                .name("test-c-span")
                .kind(Span.Kind.PRODUCER)
                .duration(40001)
                .timestamp(400000001)
                .localEndpoint(Endpoint.newBuilder()
                        .ip("192.168.60.232")
                        .port(10000)
                        .serviceName("hello-api-worker")
                        .build())
                .putTag("keyC1", "valueC1")
                .build());
        spansList.add(Span.newBuilder()
                .traceId("4234567890")
                .id("4234567891")
                .parentId("4234567890")
                .name("test-d-span")
                .kind(Span.Kind.CONSUMER)
                .duration(70001)
                .timestamp(400000001)
                .localEndpoint(Endpoint.newBuilder()
                        .ip("192.168.100.104")
                        .port(12000)
                        .serviceName("pet-recommendations")
                        .build())
                .putTag("keyD1", "valueD1")
                .putTag("keyD2", "valueD2")
                .putTag("keyD3", "valueD3")
                .putTag("keyD4", "valueD4")
                .build());
        spansList.add(Span.newBuilder()
                .traceId("4234567890")
                .id("4234567891")
                .parentId("4234567890")
                .name("test-d-span")
                .duration(70001)
                .timestamp(400000001)
                .putTag("keyD1", "valueD1")
                .putTag("keyD2", "valueD2")
                .putTag("keyD3", "valueD3")
                .putTag("keyD4", "valueD4")
                .build());
        return spansList;
    }
private List < Span > generateSpans ( ) { List < Span > spansList = new ArrayList < > ( ) ; spansList . add ( Span . newBuilder ( ) . traceId ( "1234567890" ) . id ( "1234567891" ) . parentId ( "1234567890" ) . name ( "test-a-span" ) . kind ( Span . Kind . CLIENT ) . duration ( 10001 ) . timestamp ( 100000001 ) . remoteEndpoint ( Endpoint . newBuilder ( ) . ip ( "192.168.56.101" ) . port ( 9001 ) . serviceName ( "hello" ) . build ( ) ) . localEndpoint ( Endpoint . newBuilder ( ) . ip ( "192.168.56.100" ) . port ( 9000 ) . serviceName ( "hello-caller" ) . build ( ) ) . putTag ( "keyA1" , "valueA1" ) . putTag ( "keyA2" , "valueA2" ) . build ( ) ) ; spansList . add ( Span . newBuilder ( ) . traceId ( "2234567890" ) . id ( "2234567891" ) . parentId ( "2234567890" ) . name ( "test-b-span" ) . kind ( Span . Kind . SERVER ) . duration ( 30001 ) . timestamp ( 300000001 ) . remoteEndpoint ( Endpoint . newBuilder ( ) . ip ( "192.168.57.201" ) . port ( 8004 ) . serviceName ( "pet-fe" ) . build ( ) ) . localEndpoint ( Endpoint . newBuilder ( ) . ip ( "192.168.57.205" ) . port ( 7000 ) . serviceName ( "pet-be" ) . build ( ) ) . putTag ( "keyB1" , "valueB1" ) . putTag ( "keyB2" , "valueB2" ) . putTag ( "keyB3" , "valueB3" ) . build ( ) ) ; spansList . add ( Span . newBuilder ( ) . traceId ( "3234567890" ) . id ( "3234567891" ) . parentId ( "3234567890" ) . name ( "test-c-span" ) . kind ( Span . Kind . PRODUCER ) . duration ( 40001 ) . timestamp ( 400000001 ) . localEndpoint ( Endpoint . newBuilder ( ) . ip ( "192.168.60.232" ) . port ( 10000 ) . serviceName ( "hello-api-worker" ) . build ( ) ) . putTag ( "keyC1" , "valueC1" ) . build ( ) ) ; spansList . add ( Span . newBuilder ( ) . traceId ( "4234567890" ) . id ( "4234567891" ) . parentId ( "4234567890" ) . name ( "test-d-span" ) . kind ( Span . Kind . CONSUMER ) . duration ( 70001 ) . timestamp ( 400000001 ) . localEndpoint ( Endpoint . newBuilder ( ) . ip ( "192.168.100.104" ) . port ( 12000 ) . serviceName ( "pet-recommendations" ) . build ( ) ) . putTag ( "keyD1" , "valueD1" ) . putTag ( "keyD2" , "valueD2" ) . putTag ( "keyD3" , "valueD3" ) . putTag ( "keyD4" , "valueD4" ) . build ( ) ) ; spansList . add ( Span . newBuilder ( ) . traceId ( "4234567890" ) . id ( "4234567891" ) . parentId ( "4234567890" ) . name ( "test-d-span" ) . duration ( 70001 ) . timestamp ( 400000001 ) . putTag ( "keyD1" , "valueD1" ) . putTag ( "keyD2" , "valueD2" ) . putTag ( "keyD3" , "valueD3" ) . putTag ( "keyD4" , "valueD4" ) . build ( ) ) ; return spansList ; }
Generate spans list for testing.
Generate spans list for testing .