### Question:
OpenApiParser { public void parse() throws Exception { logger.info("Parsing definitions."); this.generateAlgodIndexerObjects(root); logger.info("Parsing responses."); this.generateReturnTypes(root); logger.info("Parsing paths."); this.generateQueryMethods(); publisher.terminate(); } @Deprecated  OpenApiParser(JsonNode root);  OpenApiParser(JsonNode root, Publisher publisher);  OpenApiParser(JsonNode root, Publisher publisher, HashSet<String> filterList); void parse(); static String getTypeFormat(JsonNode typeNode, String propName); void generateAlgodIndexerObjects(JsonNode root); void generateReturnTypes(JsonNode root); void generateQueryMethods(); static final String TAB; }### Answer:
@Test public void basicTest() throws Exception { Subscriber subscriber = mock(Subscriber.class); InputStream istream = getInputStreamForResource("petstore.json"); Publisher publisher = new Publisher(); publisher.subscribeAll(subscriber); JsonNode node = Utils.getRoot(istream); OpenApiParser parser = new OpenApiParser(node, publisher); parser.parse(); 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); verify(subscriber, times(14)) .onEvent(any()); verify(subscriber, times(14)) .onEvent(any(), any(QueryDef.class)); verify(subscriber, times(42)) .onEvent(any(), any(TypeDef.class)); }