diff --git a/experiment/src/org/labkey/experiment/controllers/property/PropertyController.java b/experiment/src/org/labkey/experiment/controllers/property/PropertyController.java index 35eb30a598f..99f5d24db13 100644 --- a/experiment/src/org/labkey/experiment/controllers/property/PropertyController.java +++ b/experiment/src/org/labkey/experiment/controllers/property/PropertyController.java @@ -2200,10 +2200,7 @@ public void setPropertyURIs(List propertyURIs) public static class TestCase extends Assert { - private static Domain domain; - - @BeforeClass - public static void initialSetUp() throws ValidationException + Domain createVocabDomain() throws ValidationException { Container c = JunitUtil.getTestContainer(); User user = TestContext.get().getUser(); @@ -2229,14 +2226,7 @@ public static void initialSetUp() throws ValidationException gwtDomain.setFields(gwtProps); - domain = DomainUtil.createDomain(VocabularyDomainKind.KIND_NAME, gwtDomain, null, c, user, domainName, null, false); - } - - @AfterClass - public static void tearDown() throws DomainNotFoundException - { - User user = TestContext.get().getUser(); - domain.delete(user); + return DomainUtil.createDomain(VocabularyDomainKind.KIND_NAME, gwtDomain, null, c, user, domainName, null, false); } @Test @@ -2244,6 +2234,7 @@ public void testGetDomains() throws ValidationException { Container c = JunitUtil.getTestContainer(); User user = TestContext.get().getUser(); + Domain domain = createVocabDomain(); Set domainKinds = new HashSet<>(); domainKinds.add(VocabularyDomainKind.KIND_NAME); @@ -2259,6 +2250,7 @@ public void testGetProperties() throws ValidationException { Container c = JunitUtil.getTestContainer(); User user = TestContext.get().getUser(); + Domain domain = createVocabDomain(); var props = domain.getProperties().stream().map(DomainProperty::getPropertyDescriptor).collect(Collectors.toSet()); @@ -2307,6 +2299,7 @@ public void testPropertyUsages() throws Exception { Container c = JunitUtil.getTestContainer(); User user = TestContext.get().getUser(); + Domain domain = createVocabDomain(); var intProp = domain.getPropertyByName("testIntField"); var stringProp = domain.getPropertyByName("testStringField");