Skip to content

Commit

Permalink
TRUNK-6028 BaseCustomizableMetadataTest on MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
dkayiwa committed Sep 22, 2022
1 parent 4ed26ff commit 660ee5b
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions api/src/test/java/org/openmrs/BaseCustomizableMetadataTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Set;
import java.util.TreeSet;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.openmrs.api.ProviderService;
Expand Down Expand Up @@ -49,7 +46,7 @@ public void setAttribute_shouldVoidTheAttributeIfAnAttributeWithSameAttributeTyp
Provider provider = new Provider();
provider.setIdentifier("test");

provider.setPerson(newPerson("name"));
provider.setPerson(new Person(2));

ProviderAttributeType place = service.getProviderAttributeType(3);
provider.setAttribute(buildProviderAttribute(place, "bangalore"));
Expand All @@ -74,7 +71,7 @@ public void setAttribute_shouldWorkForAttriubutesWithDatatypesWhoseValuesAreStor
Provider provider = new Provider();
provider.setIdentifier("test");

provider.setPerson(newPerson("name"));
provider.setPerson(new Person(2));

ProviderAttributeType cv = service.getProviderAttributeType(4);
provider.setAttribute(buildProviderAttribute(cv, "Worked lots of places..."));
Expand All @@ -98,14 +95,4 @@ private ProviderAttribute buildProviderAttribute(ProviderAttributeType providerA
providerAttribute.setValue(value.toString());
return providerAttribute;
}

private Person newPerson(String name) {
Person person = new Person();
Set<PersonName> personNames = new TreeSet<>();
PersonName personName = new PersonName();
personName.setFamilyName(name);
personNames.add(personName);
person.setNames(personNames);
return person;
}
}

0 comments on commit 660ee5b

Please sign in to comment.