@Test public void shouldGetBasePathFromServerDefinition() { Assertions.assertThat(Oas30ModelHelper.getBasePath(getOpenApiDocWithUrl(null))).isEqualTo("/"); Assertions.assertThat(Oas30ModelHelper.getBasePath(getOpenApiDocWithUrl(""))).isEqualTo("/"); Assertions.assertThat(Oas30ModelHelper.getBasePath(getOpenApiDocWithUrl("http: Assertions.assertThat(Oas30ModelHelper.getBasePath(getOpenApiDocWithUrl("http: Assertions.assertThat(Oas30ModelHelper.getBasePath(getOpenApiDocWithUrl("http: Assertions.assertThat(Oas30ModelHelper.getBasePath(getOpenApiDocWithUrl("https: Assertions.assertThat(Oas30ModelHelper.getBasePath(getOpenApiDocWithUrl("/v1"))).isEqualTo("/v1"); Assertions.assertThat(Oas30ModelHelper.getBasePath(getOpenApiDocWithUrl("http is awesome!"))).isEqualTo("/"); Assertions.assertThat(Oas30ModelHelper.getBasePath(getOpenApiDocWithUrl("{scheme}: variable("scheme", "http", "https"), variable("basePath", "v1", "v2")))).isEqualTo("/v1"); }
static String getBasePath(Oas30Document openApiDoc) { if (openApiDoc.servers == null || openApiDoc.servers.isEmpty()) { return "/"; } return getBasePath(openApiDoc.servers.get(0)); }
Oas30ModelHelper { static String getBasePath(Oas30Document openApiDoc) { if (openApiDoc.servers == null || openApiDoc.servers.isEmpty()) { return "/"; } return getBasePath(openApiDoc.servers.get(0)); } }
Oas30ModelHelper { static String getBasePath(Oas30Document openApiDoc) { if (openApiDoc.servers == null || openApiDoc.servers.isEmpty()) { return "/"; } return getBasePath(openApiDoc.servers.get(0)); } private  Oas30ModelHelper(); }
Oas30ModelHelper { static String getBasePath(Oas30Document openApiDoc) { if (openApiDoc.servers == null || openApiDoc.servers.isEmpty()) { return "/"; } return getBasePath(openApiDoc.servers.get(0)); } private  Oas30ModelHelper();  }
Oas30ModelHelper { static String getBasePath(Oas30Document openApiDoc) { if (openApiDoc.servers == null || openApiDoc.servers.isEmpty()) { return "/"; } return getBasePath(openApiDoc.servers.get(0)); } private  Oas30ModelHelper();  static final String HTTP; }