|
|
|
@ -1,13 +1,12 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2018 - 2023 Entgra (Pvt) Ltd, Inc - All Rights Reserved.
|
|
|
|
|
* Copyright (c) 2023, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Unauthorised copying/redistribution of this file, via any medium is strictly prohibited.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Entgra Commercial License, Version 1.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
|
|
|
|
* Version 2.0 (the "License"); you may not use this file except
|
|
|
|
|
* in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* https://entgra.io/licenses/entgra-commercial/1.0
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
@ -30,23 +29,33 @@ import java.sql.Statement;
|
|
|
|
|
|
|
|
|
|
public class TestUtils {
|
|
|
|
|
private static final Log log = LogFactory.getLog(TestUtils.class);
|
|
|
|
|
public static Integer subtypeId = 3;
|
|
|
|
|
public static String subtypeId = "3";
|
|
|
|
|
public static String deviceType = "METER";
|
|
|
|
|
public static String operationCode = "BILLING_REGISTERS_RETRIEVE";
|
|
|
|
|
|
|
|
|
|
public static String getOperationDefinition(int subtypeId, String operationCode) {
|
|
|
|
|
String operationDefinition = "{\"" + subtypeId + "\":2,\"deviceType\":\"METER\",\"maxAttempts\":1,"
|
|
|
|
|
+ "\"registerTransaction\":{},\"registers\":[\"0.0.0_0\",\"0.9.0_0\",\"1.8.0_0\","
|
|
|
|
|
+ "\"1.8.1_0\",\"1.8.2_0\",\"1.8.3_0\",\"2.8.0_0\",\"2.8.1_0\",\"2.8.2_0\",\"2.8.3_0\","
|
|
|
|
|
+ "\"1.8.0*01_0\",\"1.8.1*01_0\",\"1.8.2*01_0\",\"1.8.3*01_0\",\"2.8.0*01_0\","
|
|
|
|
|
+ "\"2.8.1*01_0\",\"2.8.2*01_0\",\"2.8.3*01_0\",\"9.6.0*01_0\",\"9.6.0_0\","
|
|
|
|
|
+ "\"10.6.0*01_0\",\"10.6.0_0\",\"0.4.2_0\",\"0.4.3_0\",\"0.4.5_0\",\"0.4.6_0\","
|
|
|
|
|
+ "\"14.7.0_0\",\"31.7.0_0\",\"32.7.0_0\",\"51.7.0_0\",\"52.7.0_0\",\"71.7.0_0\","
|
|
|
|
|
+ "\"72.7.0_0\"],\"attemptCount\":1,\"transportMode\":\"NET_ONLY\","
|
|
|
|
|
+ "\"hasPermanentError\":false,\"tryToReachViaSMS\":false,\"waitingTime\":0,"
|
|
|
|
|
+ "\"code\":\"" + operationCode + "\",\"properties\":{\"RequireDateAdjust\":\"30000\","
|
|
|
|
|
+ "\"RequireAuthentication\":\"32\",\"RequireSerialValidation\":\"1.0.0.0.0.255\"},"
|
|
|
|
|
+ "\"type\":\"PROFILE\",\"id\":0,\"control\":\"NO_REPEAT\",\"isEnabled\":true}";
|
|
|
|
|
public static String getOperationDefinition(String subtypeId, String operationCode) {
|
|
|
|
|
String operationDefinition = "{ \"subTypeId\": "+subtypeId+", \"deviceType\": \"METER\", " +
|
|
|
|
|
" \"maxAttempts\": 1, \"registerTransaction\": { " +
|
|
|
|
|
" \"globalRegName\": \"CSRQ_RL\", \"register\": \"0.0.96.3.10.255\", " +
|
|
|
|
|
" \"attributeIndex\": 2, \"classId\": 70, " +
|
|
|
|
|
" \"status\": \"PENDING\", \"receivedTimeStamp\": 0, " +
|
|
|
|
|
" \"isWriteOut\": false, \"isProfileRegister\": false, " +
|
|
|
|
|
" \"remoteMethod\": { \"index\": 2, \"data\": 0.0, " +
|
|
|
|
|
" \"type\": \"INT8\" \t\t},\t\t\"registers\": [\"0.0.0_0\"," +
|
|
|
|
|
" \"0.9.0_0\", \"1.8.0_0\", \"1.8.1_0\", \"1.8.2_0\", \"1.8.3_0\"," +
|
|
|
|
|
" \"2.8.0_0\", \"2.8.1_0\", \"2.8.2_0\", \"2.8.3_0\", \"1.8.0*01_0\", \"1.8.1*01_0\"," +
|
|
|
|
|
" \"1.8.2*01_0\", \"1.8.3*01_0\", \"2.8.0*01_0\", \"2.8.1*01_0\", " +
|
|
|
|
|
"\"2.8.2*01_0\", \"2.8.3*01_0\", \"9.6.0*01_0\", \"9.6.0_0\", " +
|
|
|
|
|
"\"10.6.0*01_0\", \"10.6.0_0\", \"0.4.2_0\", \"0.4.3_0\", \"0.4.5_0\"," +
|
|
|
|
|
" \"0.4.6_0\", \"14.7.0_0\", \"31.7.0_0\", \"32.7.0_0\", " +
|
|
|
|
|
" \"51.7.0_0\", \"52.7.0_0\", \"71.7.0_0\", \"72.7.0_0\"], " +
|
|
|
|
|
" \"attemptCount\": 1, \"transportMode\": \"NET_ONLY\", " +
|
|
|
|
|
" \"hasPermanentError\": false, \"tryToReachViaSMS\": false, " +
|
|
|
|
|
" \"waitingTime\": 0, \"code\": \"BILLING_REGISTERS_RETRIEVE\", " +
|
|
|
|
|
" \"properties\": { \"RequireDateAdjust\": \"30000\", " +
|
|
|
|
|
" \"RequireAuthentication\": \"32\", \"RequireSerialValidation\": \"1.0.0.0.0.255\" }," +
|
|
|
|
|
" \"type\": \"PROFILE\", \"id\": 0, \"control\": \"NO_REPEAT\", " +
|
|
|
|
|
"\"isEnabled\": true}";
|
|
|
|
|
|
|
|
|
|
return operationDefinition;
|
|
|
|
|
}
|
|
|
|
|