Skip to content

Commit

Permalink
SHIBUI-2394
Browse files Browse the repository at this point in the history
test changes
  • Loading branch information
chasegawa committed Nov 7, 2022
1 parent b88e9e7 commit 7272a16
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,25 @@ class EntityDescriptorControllerTests extends AbstractBaseDataJpaTest {
entityDescriptorRepository.findAll().size() == 0
}

@WithMockUser(value = "someUser", roles = ["USER"])
def 'DELETE as non-admin'() {
given:
def entityDescriptor = new EntityDescriptor(resourceId: 'uuid-1', entityID: 'eid1', serviceProviderName: 'sp1', serviceEnabled: false)
entityDescriptorRepository.save(entityDescriptor)

when: 'pre-check'
entityManager.flush()

then:
entityDescriptorRepository.findAll().size() == 1
try {
result = mockMvc.perform(delete("/api/EntityDescriptor/uuid-1"))
}
catch (Exception e) {
e instanceof ForbiddenException
}
}

@WithMockAdmin
def 'GET /EntityDescriptors with empty repository as admin'() {
given:
Expand Down

0 comments on commit 7272a16

Please sign in to comment.