// Path: ocpp-v1_6-example/json_server_example/src/test/java/eu/chargetime/ocpp/jsonserverimplementation/config/TestServerCoreProfileConfig.java
// @TestConfiguration
// @Getter
// @Slf4j
// public class TestServerCoreProfileConfig {
// 
//     @Bean
//     public ServerCoreEventHandler getCoreEventHandler() {
//         return new ServerCoreEventHandler() {
//             @Override
//             public AuthorizeConfirmation handleAuthorizeRequest(UUID sessionIndex, AuthorizeRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
//                 IdTagInfo idTagInfo = new IdTagInfo();
//                 idTagInfo.setExpiryDate(ZonedDateTime.now());
//                 idTagInfo.setParentIdTag("test");
//                 idTagInfo.setStatus(AuthorizationStatus.Accepted);
// 
//                 return new AuthorizeConfirmation(idTagInfo);
//             }
// 
//             @Override
//             public BootNotificationConfirmation handleBootNotificationRequest(UUID sessionIndex, BootNotificationRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public DataTransferConfirmation handleDataTransferRequest(UUID sessionIndex, DataTransferRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public HeartbeatConfirmation handleHeartbeatRequest(UUID sessionIndex, HeartbeatRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public MeterValuesConfirmation handleMeterValuesRequest(UUID sessionIndex, MeterValuesRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public StartTransactionConfirmation handleStartTransactionRequest(UUID sessionIndex, StartTransactionRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public StatusNotificationConfirmation handleStatusNotificationRequest(UUID sessionIndex, StatusNotificationRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public StopTransactionConfirmation handleStopTransactionRequest(UUID sessionIndex, StopTransactionRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
//         };
//     }
// 
//     @Bean
//     public ServerCoreProfile createCore(ServerCoreEventHandler serverCoreEventHandler) {
//         return new ServerCoreProfile(serverCoreEventHandler);
//     }
// }
// 
// Path: ocpp-v1_6-example/json_server_example/src/test/java/eu/chargetime/ocpp/jsonserverimplementation/config/TestServerEventConfig.java
// @TestConfiguration
// @Getter
// @Slf4j
// public class TestServerEventConfig {
// 
//     @Bean
//     public ServerEvents createServerCoreImpl() {
//         return getNewServerEventsImpl();
//     }
// 
//     private ServerEvents getNewServerEventsImpl() {
//         return new ServerEvents() {
// 
//             @Override
//             public void newSession(UUID sessionIndex, SessionInformation information) {
// 
//                 // sessionIndex is used to send messages.
//                 System.out.println("New session " + sessionIndex + ": " + information.getIdentifier());
//             }
// 
//             @Override
//             public void lostSession(UUID sessionIndex) {
// 
//                 System.out.println("Session " + sessionIndex + " lost connection");
//             }
//         };
//     }
// }


import eu.chargetime.ocpp.feature.profile.ServerCoreEventHandler;
import eu.chargetime.ocpp.jsonserverimplementation.config.TestServerCoreProfileConfig;
import eu.chargetime.ocpp.jsonserverimplementation.config.TestServerEventConfig;
import eu.chargetime.ocpp.model.core.AuthorizationStatus;
import eu.chargetime.ocpp.model.core.AuthorizeConfirmation;
import eu.chargetime.ocpp.model.core.AuthorizeRequest;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertEquals;
package eu.chargetime.ocpp.jsonserverimplementation.handler;




@RunWith(SpringRunner.class)
@Slf4j
// Path: ocpp-v1_6-example/json_server_example/src/test/java/eu/chargetime/ocpp/jsonserverimplementation/config/TestServerCoreProfileConfig.java
// @TestConfiguration
// @Getter
// @Slf4j
// public class TestServerCoreProfileConfig {
// 
//     @Bean
//     public ServerCoreEventHandler getCoreEventHandler() {
//         return new ServerCoreEventHandler() {
//             @Override
//             public AuthorizeConfirmation handleAuthorizeRequest(UUID sessionIndex, AuthorizeRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
//                 IdTagInfo idTagInfo = new IdTagInfo();
//                 idTagInfo.setExpiryDate(ZonedDateTime.now());
//                 idTagInfo.setParentIdTag("test");
//                 idTagInfo.setStatus(AuthorizationStatus.Accepted);
// 
//                 return new AuthorizeConfirmation(idTagInfo);
//             }
// 
//             @Override
//             public BootNotificationConfirmation handleBootNotificationRequest(UUID sessionIndex, BootNotificationRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public DataTransferConfirmation handleDataTransferRequest(UUID sessionIndex, DataTransferRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public HeartbeatConfirmation handleHeartbeatRequest(UUID sessionIndex, HeartbeatRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public MeterValuesConfirmation handleMeterValuesRequest(UUID sessionIndex, MeterValuesRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public StartTransactionConfirmation handleStartTransactionRequest(UUID sessionIndex, StartTransactionRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public StatusNotificationConfirmation handleStatusNotificationRequest(UUID sessionIndex, StatusNotificationRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
// 
//             @Override
//             public StopTransactionConfirmation handleStopTransactionRequest(UUID sessionIndex, StopTransactionRequest request) {
// 
//                 System.out.println(request);
//                 // ... handle event
// 
//                 return null; // returning null means unsupported feature
//             }
//         };
//     }
// 
//     @Bean
//     public ServerCoreProfile createCore(ServerCoreEventHandler serverCoreEventHandler) {
//         return new ServerCoreProfile(serverCoreEventHandler);
//     }
// }
// 
// Path: ocpp-v1_6-example/json_server_example/src/test/java/eu/chargetime/ocpp/jsonserverimplementation/config/TestServerEventConfig.java
// @TestConfiguration
// @Getter
// @Slf4j
// public class TestServerEventConfig {
// 
//     @Bean
//     public ServerEvents createServerCoreImpl() {
//         return getNewServerEventsImpl();
//     }
// 
//     private ServerEvents getNewServerEventsImpl() {
//         return new ServerEvents() {
// 
//             @Override
//             public void newSession(UUID sessionIndex, SessionInformation information) {
// 
//                 // sessionIndex is used to send messages.
//                 System.out.println("New session " + sessionIndex + ": " + information.getIdentifier());
//             }
// 
//             @Override
//             public void lostSession(UUID sessionIndex) {
// 
//                 System.out.println("Session " + sessionIndex + " lost connection");
//             }
//         };
//     }
// }


// Path: ocpp-v1_6-example/json_server_example/src/test/java/eu/chargetime/ocpp/jsonserverimplementation/handler/AuthorizeHandlerTest.java
import eu.chargetime.ocpp.feature.profile.ServerCoreEventHandler;
import eu.chargetime.ocpp.jsonserverimplementation.config.TestServerCoreProfileConfig;
import eu.chargetime.ocpp.jsonserverimplementation.config.TestServerEventConfig;
import eu.chargetime.ocpp.model.core.AuthorizationStatus;
import eu.chargetime.ocpp.model.core.AuthorizeConfirmation;
import eu.chargetime.ocpp.model.core.AuthorizeRequest;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertEquals;

package eu.chargetime.ocpp.jsonserverimplementation.handler;




@RunWith(SpringRunner.class)
@Slf4j
@Import({TestServerCoreProfileConfig.class, TestServerEventConfig.class})