use of org.hisp.dhis.sms.command.SMSSpecialCharacter in project dhis2-core by dhis2.
the class SMSCommandServiceTest method createKeyValueCommands.
// -------------------------------------------------------------------------
// Supportive Methods
// -------------------------------------------------------------------------
private void createKeyValueCommands() {
dataElementA = createDataElement('A');
dataElementB = createDataElement('B');
dataElementC = createDataElement('C');
dataElementService.addDataElement(dataElementA);
dataElementService.addDataElement(dataElementB);
dataElementService.addDataElement(dataElementC);
dataSetA = createDataSet('A');
dataSetA.addDataSetElement(dataElementA);
dataSetA.addDataSetElement(dataElementB);
dataSetService.addDataSet(dataSetA);
smsCodeA1 = new SMSCode();
smsCodeA1.setCode("a1");
smsCodeA1.setDataElement(dataElementA);
smsCodeA2 = new SMSCode();
smsCodeA2.setCode("a2");
smsCodeA2.setDataElement(dataElementB);
smsCodeB1 = new SMSCode();
smsCodeB1.setCode("b1");
smsCodeB1.setDataElement(dataElementA);
smsCodeB2 = new SMSCode();
smsCodeB2.setCode("b2");
smsCodeB2.setDataElement(dataElementB);
smsCodeC = new SMSCode();
smsCodeC.setCode("c");
smsCodeC.setDataElement(dataElementC);
characterA = new SMSSpecialCharacter();
characterA.setName("charA");
characterA.setValue("vCharA");
characterB = new SMSSpecialCharacter();
characterB.setName("charB");
characterB.setValue("vCharB");
keyValueCommandA = new SMSCommand();
keyValueCommandA.setName(keyValueCommandName);
keyValueCommandA.setParserType(ParserType.KEY_VALUE_PARSER);
keyValueCommandA.setDataset(dataSetA);
keyValueCommandA.setCodes(Sets.newHashSet(smsCodeA1, smsCodeA2));
keyValueCommandA.setSpecialCharacters(Sets.newHashSet(characterA));
keyValueCommandA.setSuccessMessage(success);
defaultMessagesA.put(SUCCESS_MESSAGE, success);
keyValueCommandB = new SMSCommand();
keyValueCommandB.setName(keyValueCommandNameB);
keyValueCommandB.setParserType(ParserType.KEY_VALUE_PARSER);
keyValueCommandB.setDataset(dataSetA);
keyValueCommandB.setCodes(Sets.newHashSet(smsCodeB1, smsCodeB2));
}
Aggregations