Search in sources :

Example 1 with AuthorizeResponse

use of ocpp.cs._2010._08.AuthorizeResponse in project steve by RWTH-i5-IDSG.

the class ApplicationTest method testOcpp12.

@Test
public void testOcpp12() {
    ocpp.cs._2010._08.CentralSystemService client = getForOcpp12();
    BootNotificationResponse boot = client.bootNotification(new BootNotificationRequest().withChargePointVendor(getRandomString()).withChargePointModel(getRandomString()), REGISTERED_CHARGE_BOX_ID);
    Assert.assertNotNull(boot);
    Assert.assertEquals(RegistrationStatus.ACCEPTED, boot.getStatus());
    AuthorizeResponse auth = client.authorize(new AuthorizeRequest().withIdTag(REGISTERED_OCPP_TAG), REGISTERED_CHARGE_BOX_ID);
    Assert.assertNotNull(auth);
    Assert.assertEquals(AuthorizationStatus.ACCEPTED, auth.getIdTagInfo().getStatus());
}
Also used : BootNotificationResponse(ocpp.cs._2010._08.BootNotificationResponse) AuthorizeResponse(ocpp.cs._2010._08.AuthorizeResponse) AuthorizeRequest(ocpp.cs._2010._08.AuthorizeRequest) BootNotificationRequest(ocpp.cs._2010._08.BootNotificationRequest) Test(org.junit.Test)

Example 2 with AuthorizeResponse

use of ocpp.cs._2010._08.AuthorizeResponse in project steve by RWTH-i5-IDSG.

the class CentralSystemService16_Service method authorize.

public AuthorizeResponse authorize(AuthorizeRequest parameters, String chargeBoxIdentity) {
    // Get the authorization info of the user
    String idTag = parameters.getIdTag();
    IdTagInfo idTagInfo = ocppTagService.getIdTagInfo(idTag);
    return new AuthorizeResponse().withIdTagInfo(idTagInfo);
}
Also used : AuthorizeResponse(ocpp.cs._2015._10.AuthorizeResponse) IdTagInfo(ocpp.cs._2015._10.IdTagInfo)

Example 3 with AuthorizeResponse

use of ocpp.cs._2010._08.AuthorizeResponse in project steve by RWTH-i5-IDSG.

the class ApplicationTest method testOcpp15.

@Test
public void testOcpp15() {
    CentralSystemService client = getForOcpp15();
    ocpp.cs._2012._06.BootNotificationResponse boot = client.bootNotification(new ocpp.cs._2012._06.BootNotificationRequest().withChargePointVendor(getRandomString()).withChargePointModel(getRandomString()), REGISTERED_CHARGE_BOX_ID);
    Assert.assertNotNull(boot);
    Assert.assertEquals(ocpp.cs._2012._06.RegistrationStatus.ACCEPTED, boot.getStatus());
    ocpp.cs._2012._06.AuthorizeResponse auth = client.authorize(new ocpp.cs._2012._06.AuthorizeRequest().withIdTag(REGISTERED_OCPP_TAG), REGISTERED_CHARGE_BOX_ID);
    Assert.assertNotNull(auth);
    Assert.assertEquals(ocpp.cs._2012._06.AuthorizationStatus.ACCEPTED, auth.getIdTagInfo().getStatus());
}
Also used : AuthorizeRequest(ocpp.cs._2010._08.AuthorizeRequest) CentralSystemService(ocpp.cs._2012._06.CentralSystemService) Test(org.junit.Test)

Aggregations

AuthorizeRequest (ocpp.cs._2010._08.AuthorizeRequest)2 Test (org.junit.Test)2 AuthorizeResponse (ocpp.cs._2010._08.AuthorizeResponse)1 BootNotificationRequest (ocpp.cs._2010._08.BootNotificationRequest)1 BootNotificationResponse (ocpp.cs._2010._08.BootNotificationResponse)1 CentralSystemService (ocpp.cs._2012._06.CentralSystemService)1 AuthorizeResponse (ocpp.cs._2015._10.AuthorizeResponse)1 IdTagInfo (ocpp.cs._2015._10.IdTagInfo)1