本文整理汇总了Golang中github.com/cloudfoundry-incubator/routing-api/db/fakes.FakeDB.SaveTcpRouteMappingArgsForCall方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeDB.SaveTcpRouteMappingArgsForCall方法的具体用法?Golang FakeDB.SaveTcpRouteMappingArgsForCall怎么用?Golang FakeDB.SaveTcpRouteMappingArgsForCall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry-incubator/routing-api/db/fakes.FakeDB
的用法示例。
在下文中一共展示了FakeDB.SaveTcpRouteMappingArgsForCall方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
request = handlers.NewTestRequest(tcpMappings)
tcpRouteMappingsHandler.Upsert(responseRecorder, request)
Expect(responseRecorder.Code).To(Equal(http.StatusCreated))
})
It("accepts a list of routes in the body", func() {
tcpMappings = append(tcpMappings, tcpMappings[0])
tcpMappings[1].HostIP = "5.4.3.2"
request = handlers.NewTestRequest(tcpMappings)
tcpRouteMappingsHandler.Upsert(responseRecorder, request)
Expect(responseRecorder.Code).To(Equal(http.StatusCreated))
Expect(database.SaveTcpRouteMappingCallCount()).To(Equal(2))
Expect(database.SaveTcpRouteMappingArgsForCall(0)).To(Equal(tcpMappings[0]))
Expect(database.SaveTcpRouteMappingArgsForCall(1)).To(Equal(tcpMappings[1]))
})
It("logs the route declaration", func() {
request = handlers.NewTestRequest(tcpMappings)
tcpRouteMappingsHandler.Upsert(responseRecorder, request)
tcpMapping = db.NewTcpRouteMapping("router-group-guid-001", 52000, "1.2.3.4", 60000)
routeData := map[string]interface{}{
"router_group_guid": "router-group-guid-001",
"external_port": float64(52000),
}
data := map[string]interface{}{
"host_ip": "1.2.3.4",