Skip to content

Commit

Permalink
EPA-81: Test for unauthorized record
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrichner-oviva committed Mar 30, 2024
1 parent 5392abf commit c9c2264
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class KonnektorServiceAcceptanceTest {
// adapt according to what is authorized for your SMC-B testcard,
// when in doubt ask your provider (e.g. RISE)
private static final String KVNR = "X110467329";

private static final String FAKE_KVNR = "A123456780";
private static final String TI_KONNEKTOR_URI = "https://10.156.145.103:443";
private static final String PROXY_ADDRESS = "127.0.0.1";
private static final String KEYSTORE_FILE = "keys/vKon_Client_172.026.002.035.p12";
Expand Down Expand Up @@ -100,6 +102,22 @@ void getAuthorizationState() {
assertTrue(authorizedApplications.stream().anyMatch(a -> "ePA".equals(a.name())));
}

@Test
void getAuthorizationState_notAuthorized() {

// 1) get some valid home community
var hcid = konnektorService.getHomeCommunityID(KVNR);

// 2) create a record identifier we don't have access to
var recordIdentifier = new RecordIdentifier(FAKE_KVNR, hcid);

// 3) get the authorization state
var authorizedApplications = konnektorService.getAuthorizationState(recordIdentifier);

// 4) check whether we're authorized for the ePA
assertTrue(authorizedApplications.isEmpty());
}

@Test
void writeDocument() {

Expand Down

0 comments on commit c9c2264

Please sign in to comment.