Skip to content

Commit

Permalink
Fixes for some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhorridge committed May 11, 2024
1 parent d69df2a commit 17ca95f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package edu.stanford.protege.webprotege.dispatch.impl;

import edu.stanford.protege.webprotege.MongoTestExtension;
import edu.stanford.protege.webprotege.RabbitTestExtension;
import edu.stanford.protege.webprotege.WebprotegeBackendMonolithApplication;
import edu.stanford.protege.webprotege.authorization.ActionId;
import edu.stanford.protege.webprotege.app.ApplicationSettings;
Expand All @@ -26,8 +28,9 @@
import static org.hamcrest.Matchers.notNullValue;
import static org.mockito.Mockito.mock;

@SpringBootTest(classes = WebprotegeBackendMonolithApplication.class)
@SpringBootTest(classes = WebprotegeBackendMonolithApplication.class, properties = "webprotege.rabbitmq.commands-subscribe=false")
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
@ExtendWith({RabbitTestExtension.class, MongoTestExtension.class})
public class ApplicationActionHandlerRegistry_Test {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package edu.stanford.protege.webprotege.perspective;

import com.fasterxml.jackson.databind.ObjectMapper;
import edu.stanford.protege.webprotege.WebprotegeBackendMonolithApplication;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
Expand All @@ -15,12 +17,15 @@
* Stanford Center for Biomedical Informatics Research
* 2020-09-01
*/
@SpringBootTest(classes = WebprotegeBackendMonolithApplication.class)
public class BuiltInPerspective_TestCase {

@Autowired
private BuiltInPerspectiveLoader loader;

@BeforeEach
void setUp() {
loader = new BuiltInPerspectiveLoader(new ObjectMapper());
}

@Test
public void shouldLoadBuiltInClassesPerspective() throws IOException {
var perspective = loader.load("builtin-perspective-data/Classes.json");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.core.IsNull.notNullValue;

@SpringBootTest
@SpringBootTest(properties = "webprotege.rabbitmq.commands-subscribe=false")
@Import({WebprotegeBackendMonolithApplication.class, IndexUpdaterServiceTestConfiguration.class, WebProtegeIpcApplication.class})
@ExtendWith({MongoTestExtension.class})
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import edu.stanford.protege.webprotege.IndexUpdaterServiceTestConfiguration;
import edu.stanford.protege.webprotege.MongoTestExtension;
import edu.stanford.protege.webprotege.RabbitTestExtension;
import edu.stanford.protege.webprotege.WebprotegeBackendMonolithApplication;
import edu.stanford.protege.webprotege.common.ProjectId;
import edu.stanford.protege.webprotege.inject.ProjectComponent;
Expand All @@ -26,7 +27,7 @@
*/
@SpringBootTest
@Import({WebprotegeBackendMonolithApplication.class, IndexUpdaterServiceTestConfiguration.class})
@ExtendWith({MongoTestExtension.class})
@ExtendWith({MongoTestExtension.class, RabbitTestExtension.class})
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
public class WebProtegeProjectComponent_TestCase {

Expand Down

0 comments on commit 17ca95f

Please sign in to comment.