Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/toggle service interface #34

Merged
merged 29 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2d13369
integrate permissions contract and setup integration test
May 19, 2020
efe6faa
integrate new permissions contract with updated getters
May 20, 2020
81e37a1
create async task service for request forwarding
May 26, 2020
3c3e308
move EnableAsync/Scheduling to Configuration bean; fix tests not buil…
May 27, 2020
083dc86
bump version; upgrade notary to fix brotli errors on windows/darwin
May 28, 2020
3686c41
provide more context to async tasks
May 28, 2020
e2c2961
separate registry related methods from routing service; trigger async…
May 28, 2020
5551dc0
split requestHandlerBuilder into separate request and response handlers
May 29, 2020
47c6d14
convert request handler service test to separate component tests; add…
May 29, 2020
7ee3326
modify request handler api and rework tests
May 29, 2020
467df80
cleanup including organisation of imports
May 29, 2020
b378435
rename OcpiRequestHandler.forward overrides; implement forwardAgain m…
Jun 2, 2020
cd969ea
replace event listener with forwarding in the same thread
Jun 2, 2020
fc2f5b2
test app interface with local and remote message forwarding
Jun 3, 2020
2c21a14
add tests for OcnAppPermissions enum matcher methods and RegistryServ…
Jun 3, 2020
f9ab2a5
fix BigInteger instantiation in registyr test case and update changelog
Jun 3, 2020
4871a17
intial custom modules controller and unit test
Jun 4, 2020
2aefb88
Merge branch 'feature/app-permissions-contract' into feature/custom-m…
Jun 4, 2020
fb34b30
start integrating custom modules into request handling flow
Jun 4, 2020
760d55d
custom modules controller test; further custom module id integration;…
Jun 5, 2020
aa550a5
Merged in feature/app-give-permissions (pull request #29)
Jun 5, 2020
38dea86
integrate custom modules into ocnrules
Jun 5, 2020
5dde8ce
change custom module path placement and update asciidoc documentation
Jun 8, 2020
1c055f6
clean docs and fix custom module mapping matching
Jun 8, 2020
4009fde
Merge branch 'feature/app-permissions-contract' into feature/custom-m…
Jun 16, 2020
fbe2b6c
rename app to service
Jun 16, 2020
1b1299f
set service/permission option
Jun 19, 2020
5911412
changed variable name
Jun 19, 2020
19b2954
Merge branch 'develop' into feature/app-permissions-contract
dv-rosales Aug 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Includes initial hubclientinfo OCPI module implementation.
- Optional "Planned Party" search scans registry for newly planned parties at regular intervals.
- New configuration properties under `ocn.node`: `stillAliveEnabled`, `stillAliveRate`,
`plannedPartySearchEnabled`, `plannedPartySearchRate`.

## 1.0.0
### Mar 03, 2020

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import snc.openchargingnetwork.node.services.HttpService
import snc.openchargingnetwork.node.services.RegistryService
import snc.openchargingnetwork.node.tools.*


@RestController
@RequestMapping("/ocpi/2.2/credentials")
class CredentialsController(private val platformRepo: PlatformRepository,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package snc.openchargingnetwork.node.integration

import org.awaitility.kotlin.await
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.springframework.http.HttpMethod
import snc.openchargingnetwork.node.integration.utils.*
import snc.openchargingnetwork.node.models.OcnServicePermission
import snc.openchargingnetwork.node.models.ocpi.InterfaceRole
import snc.openchargingnetwork.node.models.ocpi.ModuleID
import java.util.concurrent.TimeUnit

class ServiceInterfaceTest {

// TODO: integration test setup could be in an inheritable class
private lateinit var networkComponents: NetworkComponents
private lateinit var cpo1: TestCpo
private lateinit var cpo2: TestCpo
private lateinit var msp: TestMsp


@BeforeEach
fun bootStrap() {
networkComponents = setupNetwork(HubClientInfoParams())
cpo1 = networkComponents.cpos[0]
cpo2 = networkComponents.cpos[1]
msp = networkComponents.msps.first()
}

@AfterEach
fun stopTestParties() {
stopPartyServers(networkComponents)
}

private fun seenByBothCpos(): Boolean {
val message = ReceivedMessage(
module = ModuleID.LOCATIONS,
interfaceRole = InterfaceRole.SENDER,
method = HttpMethod.GET,
sender = msp.party)
val cpo1Seen = cpo1.server.messageStore.contains(message)
val cpo2Seen = cpo2.server.messageStore.contains(message)
return cpo1Seen && cpo2Seen
}

private fun testForwarding(recipient: TestCpo, service: TestCpo) {
service.server.setServicePermissions(listOf(OcnServicePermission.FORWARD_ALL))
msp.server.agreeToServicePermissions(service.address)
msp.server.getLocation(recipient.party)
await.atMost(2L, TimeUnit.SECONDS).until { seenByBothCpos() }
}

@Test
fun fowardsRequestToService_Local() {
testForwarding(recipient = cpo2, service = cpo1)

}

@Test
fun fowardsRequestToService_Remote() {
testForwarding(recipient = cpo1, service = cpo2)
}

}
Loading