@Test public void testTransformApiDoc_whenOpenDocIsPresent() { ApiDocInfo apiDocInfo = new ApiDocInfo(null, "DOC3", null); transformApiDocService.transformApiDoc(SERVICE_ID, apiDocInfo); verify( beanApiDocFactory.apply("DOC3") ).transformApiDoc(SERVICE_ID, apiDocInfo); verify( beanApiDocFactory.apply("DOC2"), never() ).transformApiDoc(SERVICE_ID, apiDocInfo); }
public String transformApiDoc(String serviceId, ApiDocInfo apiDocInfo) { AbstractApiDocService abstractApiDocService = beanApiDocFactory.apply(apiDocInfo.getApiDocContent()); if (abstractApiDocService == null) { throw new UnexpectedTypeException("Response is not a Swagger or OpenAPI type object."); } return abstractApiDocService.transformApiDoc(serviceId, apiDocInfo); }
TransformApiDocService { public String transformApiDoc(String serviceId, ApiDocInfo apiDocInfo) { AbstractApiDocService abstractApiDocService = beanApiDocFactory.apply(apiDocInfo.getApiDocContent()); if (abstractApiDocService == null) { throw new UnexpectedTypeException("Response is not a Swagger or OpenAPI type object."); } return abstractApiDocService.transformApiDoc(serviceId, apiDocInfo); } }
TransformApiDocService { public String transformApiDoc(String serviceId, ApiDocInfo apiDocInfo) { AbstractApiDocService abstractApiDocService = beanApiDocFactory.apply(apiDocInfo.getApiDocContent()); if (abstractApiDocService == null) { throw new UnexpectedTypeException("Response is not a Swagger or OpenAPI type object."); } return abstractApiDocService.transformApiDoc(serviceId, apiDocInfo); }  }
TransformApiDocService { public String transformApiDoc(String serviceId, ApiDocInfo apiDocInfo) { AbstractApiDocService abstractApiDocService = beanApiDocFactory.apply(apiDocInfo.getApiDocContent()); if (abstractApiDocService == null) { throw new UnexpectedTypeException("Response is not a Swagger or OpenAPI type object."); } return abstractApiDocService.transformApiDoc(serviceId, apiDocInfo); }  String transformApiDoc(String serviceId, ApiDocInfo apiDocInfo); }
TransformApiDocService { public String transformApiDoc(String serviceId, ApiDocInfo apiDocInfo) { AbstractApiDocService abstractApiDocService = beanApiDocFactory.apply(apiDocInfo.getApiDocContent()); if (abstractApiDocService == null) { throw new UnexpectedTypeException("Response is not a Swagger or OpenAPI type object."); } return abstractApiDocService.transformApiDoc(serviceId, apiDocInfo); }  String transformApiDoc(String serviceId, ApiDocInfo apiDocInfo);  }