    @Test
    public void basicTest() throws Exception {

        // Given - mock subscriber listening to all events while parsing "petstore.json"
        Subscriber subscriber = mock(Subscriber.class);
        InputStream istream = getInputStreamForResource("petstore.json");
        Publisher publisher = new Publisher();
        publisher.subscribeAll(subscriber);

        // When - we receive events
        JsonNode node = Utils.getRoot(istream);
        OpenApiParser parser = new OpenApiParser(node, publisher);
        parser.parse();

        // Then - verify that some of the expected events

        // 'onEvent(evt, StructDef)` is called as expected
        List<String> expectedStructs = ImmutableList.of("ApiResponse", "Category", "Pet", "Tag", "Order", "User");
        ArgumentCaptor<StructDef> structDefArgumentCaptor = ArgumentCaptor.forClass(StructDef.class);
        verify(subscriber, times(expectedStructs.size()))
                .onEvent(any(), structDefArgumentCaptor.capture());

        assertThat(structDefArgumentCaptor.getAllValues())
                .extracting("name")
                .containsAll(expectedStructs);

        // 'onEvent(evt)' - called 14 times, once for each END_QUERY.
        verify(subscriber, times(14))
                .onEvent(any());

        // 'onEvent(evt, []String)` - called 14 times, once for each NEW_QUERY.
        verify(subscriber, times(14))
                .onEvent(any(), any(QueryDef.class));

        // Property, Path param, Query param, Body
        verify(subscriber, times(42))
                .onEvent(any(), any(TypeDef.class));
    }