-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 #1235 from iushankin/issue-1234
Fixed #1234: The Mule module doesn't support BeanConfig
- Loading branch information
Showing
4 changed files
with
52 additions
and
5 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
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
31 changes: 31 additions & 0 deletions
31
modules/swagger-mule/src/test/java/io/swagger/mule/ApiListingJSONTest.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,31 @@ | ||
package io.swagger.mule; | ||
|
||
import io.swagger.jaxrs.config.BeanConfig; | ||
import io.swagger.models.Swagger; | ||
|
||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
public class ApiListingJSONTest { | ||
|
||
@Test(description = "test Swagger initialization from BeanConfig") | ||
public void initializeTest() { | ||
final BeanConfig bc = new BeanConfig(); | ||
bc.setTitle("Petstore Sample API"); | ||
bc.setHost("petstore.swagger.io"); | ||
bc.setBasePath("/api"); | ||
bc.setScan(true); | ||
|
||
final ApiListingJSON listing = new ApiListingJSON(); | ||
// Initializing by Swagger object | ||
ApiListingJSON.init(new Swagger()); | ||
// Reading configuration and scanning resources | ||
listing.scan(null); | ||
|
||
final Swagger sw = ApiListingJSON.swagger; | ||
Assert.assertNotNull(sw); | ||
Assert.assertEquals(sw.getInfo().getTitle(), "Petstore Sample API"); | ||
Assert.assertEquals(sw.getHost(), "petstore.swagger.io"); | ||
Assert.assertEquals(sw.getBasePath(), "/api"); | ||
} | ||
} |
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,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<layout class="ch.qos.logback.classic.PatternLayout"> | ||
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern> | ||
</layout> | ||
</appender> | ||
<logger name="io.swagger" level="error"/> | ||
<root level="error"> | ||
<appender-ref ref="STDOUT"/> | ||
</root> | ||
</configuration> |