Skip to content

Commit

Permalink
replace zone references with tenant and app_tid (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
liga-oz authored Aug 21, 2023
1 parent a8f2ef4 commit bd65785
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class DataService {
*
*/
String readSensitiveData() {
String zoneId = SpringSecurityContext.getToken().getZoneId();
return "You got the sensitive data for zone '" + zoneId + "'.";
String appTid = SpringSecurityContext.getToken().getAppTid();
return "You got the sensitive data for tenant '" + appTid + "'.";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void sayHello() throws Exception {
.andReturn().getResponse().getContentAsString();

assertTrue(response.contains("sb-clientId!t0815"));
assertTrue(response.contains("the-zone-id"));
assertTrue(response.contains("the-app-tid"));
}

@Test
Expand All @@ -74,13 +74,13 @@ public void readData_OK() throws Exception {
.perform(get("/method").with(bearerToken(jwtXsuaa)))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertTrue(response.contains("You got the sensitive data for zone 'the-zone-id'."));
assertTrue(response.contains("You got the sensitive data for tenant 'the-zone-id'."));

response = mvc
.perform(get("/method").with(bearerToken(jwtIas)))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertTrue(response.contains("You got the sensitive data for zone 'the-zone-id'."));
assertTrue(response.contains("You got the sensitive data for tenant 'the-app-tid'."));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void readData_OK() throws Exception {
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();

assertTrue(response.contains("You got the sensitive data for zone 'the-app-tid'."));
assertTrue(response.contains("You got the sensitive data for tenant 'the-app-tid'."));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void readData_OK() throws Exception {
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();

assertTrue(response.contains("You got the sensitive data for zone 'the-zone-id'."));
assertTrue(response.contains("You got the sensitive data for tenant 'the-zone-id'."));
}

@Test
Expand Down

0 comments on commit bd65785

Please sign in to comment.