Search in sources :

Example 41 with SMSCommand

use of org.hisp.dhis.sms.command.SMSCommand in project dhis2-core by dhis2.

the class SmsUtilsTest method setup.

@BeforeEach
void setup() {
    phoneNumber = "0123456789";
    email = "test@example.com";
    userA = new User();
    userA.setAutoFields();
    userA.setPhoneNumber(phoneNumber);
    userA.setEmail(email);
    organisationUnitA = new OrganisationUnit();
    organisationUnitA.setAutoFields();
    organisationUnitA.setId(1);
    organisationUnitA.setCode("TESTORGA");
    userA.addOrganisationUnit(organisationUnitA);
    userB = new User();
    organisationUnitB = new OrganisationUnit();
    organisationUnitB.setAutoFields();
    organisationUnitB.setId(2);
    organisationUnitB.setCode("TESTORGB");
    userB.addOrganisationUnit(organisationUnitB);
    organisationUnitC = new OrganisationUnit();
    organisationUnitC.setAutoFields();
    organisationUnitC.setId(3);
    organisationUnitC.setCode("TESTORGC");
    incomingSms = new IncomingSms();
    incomingSms.setCreatedBy(userA);
    keyValueCommand = new SMSCommand();
    keyValueCommand.setParserType(ParserType.KEY_VALUE_PARSER);
}
Also used : OrganisationUnit(org.hisp.dhis.organisationunit.OrganisationUnit) IncomingSms(org.hisp.dhis.sms.incoming.IncomingSms) User(org.hisp.dhis.user.User) SMSCommand(org.hisp.dhis.sms.command.SMSCommand) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

SMSCommand (org.hisp.dhis.sms.command.SMSCommand)41 Test (org.junit.jupiter.api.Test)17 DhisSpringTest (org.hisp.dhis.DhisSpringTest)14 SMSCode (org.hisp.dhis.sms.command.code.SMSCode)14 User (org.hisp.dhis.user.User)9 Transactional (org.springframework.transaction.annotation.Transactional)8 OrganisationUnit (org.hisp.dhis.organisationunit.OrganisationUnit)7 SMSParserException (org.hisp.dhis.sms.parse.SMSParserException)7 SMSSpecialCharacter (org.hisp.dhis.sms.command.SMSSpecialCharacter)6 UserGroup (org.hisp.dhis.user.UserGroup)6 List (java.util.List)5 Set (java.util.Set)5 DataSet (org.hisp.dhis.dataset.DataSet)5 Program (org.hisp.dhis.program.Program)5 ParserType (org.hisp.dhis.sms.parse.ParserType)5 HashSet (java.util.HashSet)4 Map (java.util.Map)4 ProgramService (org.hisp.dhis.program.ProgramService)4 SMSCommandService (org.hisp.dhis.sms.command.SMSCommandService)4 TrackedEntityAttribute (org.hisp.dhis.trackedentity.TrackedEntityAttribute)4