-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds AWS::EC2::CustomerGateway support
- Loading branch information
Adam Fokken
committed
Jan 19, 2016
1 parent
aa4845f
commit ec247f6
Showing
10 changed files
with
134 additions
and
11 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
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
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
34 changes: 34 additions & 0 deletions
34
src/test/scala/com/monsanto/arch/cloudformation/model/resource/CGW_UT.scala
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.monsanto.arch.cloudformation.model.resource | ||
|
||
import com.monsanto.arch.cloudformation.model._ | ||
import org.scalatest.{FunSpec, Matchers} | ||
import spray.json._ | ||
|
||
class CGW_UT extends FunSpec with Matchers { | ||
describe("AWS::EC2::CustomerGateway") { | ||
val bpgAsn = 1234 | ||
val ipAddr = IPAddress(8, 8, 8, 8) | ||
val cgwType = "ipsec.1" | ||
val cgw = `AWS::EC2::CustomerGateway`( | ||
name = "cgw", | ||
BgpAsn = 1234, | ||
IpAddress = ipAddr, | ||
Tags = Seq(), | ||
Type = "ipsec.1" | ||
) | ||
it("should create a valid new Customer Gateway") { | ||
val expected = JsObject( | ||
"cgw" -> JsObject( | ||
"Type" -> JsString("AWS::EC2::CustomerGateway"), | ||
"Properties" -> JsObject( | ||
"BgpAsn" -> JsNumber(bpgAsn), | ||
"IpAddress" -> ipAddr.toJsString, | ||
"Tags" -> JsArray(), | ||
"Type" -> JsString(cgwType) | ||
) | ||
) | ||
) | ||
Seq[Resource[_]](cgw).toJson should be(expected) | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/test/scala/com/monsanto/arch/cloudformation/model/resource/EC2_UT.scala
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.monsanto.arch.cloudformation.model.resource | ||
|
||
import org.scalatest.{Matchers, FunSpec} | ||
import spray.json._ | ||
|
||
class EC2_UT extends FunSpec with Matchers { | ||
|
||
describe("CidrBlock"){ | ||
|
||
val cidr = CidrBlock(192,168,1,2,32) | ||
|
||
it("should write valid CidrBlock"){ | ||
cidr.toJson shouldEqual JsString("192.168.1.2/32") | ||
} | ||
|
||
it("should read valid CidrBlock") { | ||
JsString("192.168.1.2/32").convertTo[CidrBlock] shouldEqual cidr | ||
} | ||
|
||
} | ||
|
||
describe("IPAddress"){ | ||
val ipAddress = IPAddress(192,168,1,2) | ||
|
||
it("should write valid IPAddress"){ | ||
ipAddress.toJson shouldEqual JsString("192.168.1.2") | ||
} | ||
|
||
it("should read valid IPAddress"){ | ||
JsString("192.168.1.2").convertTo[IPAddress] shouldEqual ipAddress | ||
} | ||
|
||
} | ||
} |