-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from dartartem/master
moved swagger-ui to META-INF/static-content
- Loading branch information
Showing
6 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies { | ||
testCompile project(":eventuate-util-swagger-ui") | ||
testCompile "org.springframework.boot:spring-boot-starter-web:${springBootVersion}" | ||
testCompile "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" | ||
testCompile "junit:junit:4.12" | ||
} |
38 changes: 38 additions & 0 deletions
38
...r-ui-tests/src/test/java/io/eventuate/util/swaggerui/tests/SwaggerUiAvailabilityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package io.eventuate.util.swaggerui.tests; | ||
|
||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.boot.web.server.LocalServerPort; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
|
||
import java.io.IOException; | ||
import java.net.HttpURLConnection; | ||
import java.net.URL; | ||
|
||
@RunWith(SpringJUnit4ClassRunner.class) | ||
@SpringBootTest(classes = SwaggerUiAvailabilityTest.Config.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | ||
public class SwaggerUiAvailabilityTest { | ||
@Configuration | ||
@EnableAutoConfiguration | ||
public static class Config { | ||
} | ||
|
||
@LocalServerPort | ||
private int port; | ||
|
||
@Test | ||
public void testSwaggerUiAvailability() throws IOException { | ||
assertUrlStatusIsOk(String.format("http://%s:%s/swagger-ui/index.html", "localhost", port)); | ||
} | ||
|
||
private void assertUrlStatusIsOk(String url) throws IOException { | ||
HttpURLConnection connection = (HttpURLConnection)new URL(url).openConnection(); | ||
|
||
Assert.assertEquals(200, connection.getResponseCode()); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
eventuate-util-swagger-ui-tests/src/test/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
spring.resources.static-locations=classpath:META-INF/static-content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
deployUrl=file:///Users/cer/.m2/testdeploy | ||
eventuateMavenRepoUrl=file:///Users/cer/.m2/testdeploy,https://dl.bintray.com/eventuateio-oss/eventuate-maven-release,https://snapshots.repositories.eventuate.io/repository | ||
springBootVersion=1.4.7.RELEASE | ||
springBootVersion=2.2.6.RELEASE | ||
swaggerUiVersion=3.17.1 | ||
eventuatePluginsGradleVersion=0.8.0.RELEASE | ||
version=0.11.0-SNAPSHOT | ||
version=0.12.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
include "eventuate-util-test" | ||
include "eventuate-util-swagger-ui" | ||
include "eventuate-util-swagger-ui-tests" | ||
include "eventuate-util-spring-swagger" |