-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collections are always initialized
- Loading branch information
Aleksandar Stojsavljevic
committed
Jul 25, 2018
1 parent
757ce95
commit 0d9cef5
Showing
7 changed files
with
693 additions
and
0 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
34 changes: 34 additions & 0 deletions
34
src/test/java/com/phoenixnap/oss/ramlplugin/raml2code/github/Issue266RulesTest.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,34 @@ | ||
package com.phoenixnap.oss.ramlplugin.raml2code.github; | ||
|
||
import org.junit.Test; | ||
|
||
import com.phoenixnap.oss.ramlplugin.raml2code.plugin.TestConfig; | ||
import com.phoenixnap.oss.ramlplugin.raml2code.rules.GitHubAbstractRuleTestBase; | ||
import com.phoenixnap.oss.ramlplugin.raml2code.rules.Spring4ControllerDecoratorRule; | ||
|
||
/** | ||
* @author aleksandars | ||
* @since 2.0.4 | ||
*/ | ||
public class Issue266RulesTest extends GitHubAbstractRuleTestBase { | ||
|
||
@Test | ||
public void verify_collection_initialization_false() throws Exception { | ||
TestConfig.setInitializeCollections(false); | ||
loadRaml("issue-266.raml"); | ||
rule = new Spring4ControllerDecoratorRule(); | ||
rule.apply(getControllerMetadata(), jCodeModel); | ||
verifyGeneratedCode("Issue266-1Spring4ControllerStub"); | ||
TestConfig.setInitializeCollections(true); | ||
} | ||
|
||
@Test | ||
public void verify_collection_initialization_true() throws Exception { | ||
TestConfig.setInitializeCollections(true); | ||
loadRaml("issue-266.raml"); | ||
rule = new Spring4ControllerDecoratorRule(); | ||
rule.apply(getControllerMetadata(), jCodeModel); | ||
verifyGeneratedCode("Issue266-2Spring4ControllerStub"); | ||
TestConfig.setInitializeCollections(true); | ||
} | ||
} |
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
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,26 @@ | ||
#%RAML 1.0 | ||
title: Collections are always initialized #266 | ||
version: 1.0 | ||
|
||
types: | ||
Address: | ||
type: object | ||
properties: | ||
city: string | ||
street: string | ||
houseNumber: string | ||
Student: | ||
type: object | ||
properties: | ||
firstName: string | ||
lastName: string | ||
addresses: Address[] | ||
|
||
/students: | ||
get: | ||
description: Get all | ||
responses: | ||
200: | ||
body: | ||
application/json: | ||
type: Student[] |
Oops, something went wrong.