fix: updating database username to be in sync with the article (#11270)
This commit is contained in:
parent
a97ae48958
commit
b8a9ea2974
@ -2,6 +2,10 @@ FROM arangodb:3.8.0
|
||||
|
||||
COPY init-session.js /docker-entrypoint-initdb.d/
|
||||
|
||||
COPY arangodb-setup.js /setup/
|
||||
|
||||
EXPOSE 8529
|
||||
|
||||
ENV ARANGO_ROOT_PASSWORD=password
|
||||
|
||||
RUN chmod a+x /setup/arangodb-setup.js
|
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/arangosh --javascript.execute
|
||||
|
||||
print('creating database: baeldung-database & user: baeldung');
|
||||
db._createDatabase("baeldung-database", {}, [{ username: "baeldung", passwd: "password", active: true}]);
|
@ -3,3 +3,5 @@
|
||||
docker image build -t spring-data-arangodb:live-test .
|
||||
|
||||
docker run -p 8529:8529 -e ARANGO_ROOT_PASSWORD=password --name spring-data-arangodb-live-test spring-data-arangodb:live-test
|
||||
|
||||
docker exec spring-data-arangodb-live-test arangosh --server.password password --javascript.execute /setup/arangodb-setup.js
|
@ -13,7 +13,7 @@ public class ArangoDbConfiguration implements ArangoConfiguration {
|
||||
public ArangoDB.Builder arango() {
|
||||
return new ArangoDB.Builder()
|
||||
.host("127.0.0.1", 8529)
|
||||
.user("root")
|
||||
.user("baeldung")
|
||||
.password("password");
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
arangodb.hosts=127.0.0.1:8529
|
||||
arangodb.user=root
|
||||
arangodb.user=baeldung
|
||||
arangodb.password=password
|
@ -2,6 +2,7 @@ package com.baeldung.arangodb;
|
||||
|
||||
import com.baeldung.arangodb.model.Article;
|
||||
import com.baeldung.arangodb.repository.ArticleRepository;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
@ -25,6 +26,11 @@ public class ArticleRepositoryLiveTest {
|
||||
@Autowired
|
||||
ArticleRepository articleRepository;
|
||||
|
||||
@AfterEach
|
||||
public void tearDown(){
|
||||
articleRepository.deleteAll();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenNewArticle_whenSaveInArangoDb_thenDataIsCorrect() {
|
||||
Article newArticle = new Article(
|
||||
|
Loading…
x
Reference in New Issue
Block a user