-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #76] Add InstanceUser and ACL interfaces #77
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7f9c83f
feat: add service user and acl
318228han 7ad307d
feat: add service user and acl
318228han 865100c
feat: add service user and acl
318228han d20d8a1
feat: add service user and acl
318228han 09691fa
feat: replace serviceuser with instanceuser
318228han 5b74f4e
feat: replace serviceuser with instanceuser #2
318228han 25789f4
feat: commit deletion serviceusermapperTest
318228han 31d120a
feat: 提交 application-test.yml 改回密码password的
318228han fe4cedf
feat: 最终更改
318228han fba6e83
feat: 最终更改-2
318228han 528d6f2
feat: 最终更改-3
318228han 02bacaf
Revert "feat: 最终更改-3"
318228han b14bce6
feat: 最终更改-4
318228han 2a96796
feat: 最终更改-5
318228han File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ bin/ | |
*.iws | ||
*.iml | ||
*.ipr | ||
*.http | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
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
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
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
67 changes: 67 additions & 0 deletions
67
...java/org/apache/eventmesh/dashboard/console/mapper/serviceuser/ServiceUserMapperTest.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,67 @@ | ||
package org.apache.eventmesh.dashboard.console.mapper.serviceuser; | ||
|
||
import org.apache.eventmesh.dashboard.console.EventMeshDashboardApplication; | ||
import org.apache.eventmesh.dashboard.console.entity.serviceuser.ServiceUserEntity; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.context.jdbc.Sql; | ||
import org.springframework.test.context.junit.jupiter.SpringExtension; | ||
|
||
import java.util.List; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
@ExtendWith(SpringExtension.class) | ||
@SpringBootTest(classes = EventMeshDashboardApplication.class) | ||
@ActiveProfiles("test") | ||
@Sql(executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, scripts = {"classpath:use-test-schema.sql", "classpath:eventmesh-dashboard.sql"}) | ||
@Sql(executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:serviceuser-test.sql") | ||
class ServiceUserMapperTest { | ||
|
||
@Autowired | ||
private ServiceUserMapper serviceUserMapper; | ||
|
||
@Test | ||
public void testSelectAll() { | ||
List<ServiceUserEntity> serviceUserEntities = serviceUserMapper.selectAll(); | ||
assertEquals(3, serviceUserEntities.size()); | ||
} | ||
|
||
@Test | ||
public void testSelectById() { | ||
ServiceUserEntity serviceUserEntity1 = new ServiceUserEntity(); | ||
serviceUserEntity1.setId(3L); | ||
ServiceUserEntity serviceUserEntity = serviceUserMapper.selectById(serviceUserEntity1); | ||
assertEquals(3, serviceUserEntity.getId()); | ||
} | ||
|
||
@Test | ||
public void testSelectByName() { | ||
ServiceUserEntity serviceUserEntity1 = new ServiceUserEntity(); | ||
serviceUserEntity1.setName("name1"); | ||
List<ServiceUserEntity> serviceUserEntities = serviceUserMapper.selectByName(serviceUserEntity1); | ||
assertEquals(1, serviceUserEntities.size()); | ||
} | ||
|
||
@Test | ||
public void testInsert() { | ||
ServiceUserEntity serviceUserEntity = new ServiceUserEntity(0, "pwd", 13L, "name4", "11", 1); | ||
serviceUserMapper.insert(serviceUserEntity); | ||
assertNotNull(serviceUserEntity); | ||
assertEquals(6, serviceUserEntity.getId()); | ||
} | ||
|
||
@Test | ||
public void testUpdateNameById() { | ||
ServiceUserEntity serviceUserEntity = new ServiceUserEntity(); | ||
serviceUserEntity.setId(3L); | ||
serviceUserEntity.setPassword("123"); | ||
serviceUserMapper.updatePasswordById(serviceUserEntity); | ||
serviceUserEntity = serviceUserMapper.selectById(serviceUserEntity); | ||
assertEquals("123", serviceUserEntity.getPassword()); | ||
} | ||
|
||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to add these indents?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will delete them.