-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MSEARCH-631: Make system user creation optional
- Loading branch information
1 parent
65c8eec
commit 14b56b0
Showing
12 changed files
with
109 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
src/main/java/org/folio/search/client/PermissionsClient.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
51
src/main/java/org/folio/search/service/TenantScopedExecutionService.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
src/test/java/org/folio/search/client/PermissionsClientTest.java
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
src/test/java/org/folio/search/controller/DisabledSystemUserIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.folio.search.controller; | ||
|
||
import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
import static org.folio.search.sample.SampleInstances.getSemanticWebAsMap; | ||
import static org.folio.search.sample.SampleInstances.getSemanticWebId; | ||
import static org.hamcrest.Matchers.is; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; | ||
|
||
import org.folio.search.domain.dto.Instance; | ||
import org.folio.search.support.base.BaseIntegrationTest; | ||
import org.folio.spring.client.AuthnClient; | ||
import org.folio.spring.client.PermissionsClient; | ||
import org.folio.spring.client.UsersClient; | ||
import org.folio.spring.test.type.IntegrationTest; | ||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.NoSuchBeanDefinitionException; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.test.context.TestPropertySource; | ||
|
||
@IntegrationTest | ||
@TestPropertySource(properties = "folio.system-user.enabled=false") | ||
class DisabledSystemUserIT extends BaseIntegrationTest { | ||
|
||
@BeforeAll | ||
static void prepare(@Autowired ApplicationContext ctx) { | ||
assertThatThrownBy(() -> ctx.getBean(AuthnClient.class)).isInstanceOf(NoSuchBeanDefinitionException.class); | ||
assertThatThrownBy(() -> ctx.getBean(UsersClient.class)).isInstanceOf(NoSuchBeanDefinitionException.class); | ||
assertThatThrownBy(() -> ctx.getBean(PermissionsClient.class)).isInstanceOf(NoSuchBeanDefinitionException.class); | ||
|
||
setUpTenant(Instance.class, getSemanticWebAsMap()); | ||
} | ||
|
||
@AfterAll | ||
static void cleanUp() { | ||
removeTenant(); | ||
} | ||
|
||
@Test | ||
void searchByInstances_parameterized_singleResult() throws Exception { | ||
doSearchByInstances(prepareQuery("cql.allRecords = 1", "")) | ||
.andExpect(jsonPath("$.totalRecords", is(1))) | ||
.andExpect(jsonPath("$.instances[0].id", is(getSemanticWebId()))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters