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

Allow default message handlers #19

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

reinierl
Copy link

@reinierl reinierl commented Jan 6, 2021

Hey guys, I added a feature to make docile-charge-point respond to any incoming request matching a certain pattern, regardless of the expectations the scripts may set up later.

For example:

handlingIncomingMessages(getConfigurationReq.respondingWith(GetConfigurationRes(List(), List()))) {
  handlingIncomingMessages(getLocalListVersionReq.respondingWith(GetLocalListVersionRes(AuthListNotSupported))) {

    bootNotification(chargePointVendor = "CIRCONTROL", chargePointModel = "R50 CCS CHA T2S32")

    for (i <- 0.to(2)) {
      statusNotification(scope = ConnectorScope(i), timestamp=Some(ZonedDateTime.now.withNano(0)))
    }
  }
}

That would send a BootNotification request, expect a BootNotification response, and then send a StatusNotification request and expect a corresponding response three times.

Any GetLocalListVersion request or GetConfiguration request that comes in in the mean time will be responded to with the default responses given in the top two lines. Moreover, they will be ignored for the purposes of the script's expectations, which is really nice because many production back-offices have a habit of messing up your carefully-crafted scripted with their GetConfiguration's and GetLocalListVersion's.

@reinierl reinierl force-pushed the allow-default-message-handlers branch from a7c366e to d250a58 Compare January 6, 2021 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant