diff options
Diffstat (limited to 'juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java')
-rw-r--r-- | juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java index 47699dbc..f5701b0c 100644 --- a/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java +++ b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java @@ -22,11 +22,12 @@ import com.juick.Tag; import com.juick.User; import com.juick.configuration.RepositoryConfiguration; import com.juick.server.helpers.AnonymousUser; -import org.junit.Before; -import org.junit.Test; +import org.junit.*; +import org.junit.runner.RunWith; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import javax.inject.Inject; import java.util.Collections; @@ -38,6 +39,7 @@ import static org.hamcrest.Matchers.equalTo; /** * Created by aalexeev on 11/25/16. */ +@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = RepositoryConfiguration.class) public class MessageServiceTest extends AbstractJUnit4SpringContextTests { @Inject @@ -59,10 +61,15 @@ public class MessageServiceTest extends AbstractJUnit4SpringContextTests { int ugnichId, freefdId, mid; + private static boolean setUpIsDone = false; + @Before public void createUgniches() { - ugnichId = userService.createUser("ugnich", "secret"); - freefdId = userService.createUser("freefd", "secret"); + if (!setUpIsDone) { + ugnichId = userService.createUser("ugnich", "secret"); + freefdId = userService.createUser("freefd", "secret"); + setUpIsDone = true; + } } @Test |