Skip to content

Commit

Permalink
update RPAConfiguration unit tests with new blacklist properties
Browse files Browse the repository at this point in the history
  • Loading branch information
elmiomar committed Feb 16, 2024
1 parent 3b18419 commit 432b784
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/test/java/gov/nist/oar/distrib/web/RPAConfigurationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,16 @@ public void testLoadConfig() throws IOException {
assertEquals("local", config.getBagstoreMode());
assertNull(config.getBagstoreLocation());
assertEquals("1234567890 pdr.rpa.2023 1234567890", config.getJwtSecretKey());

// assertions for disallowed email strings and countries
assertNotNull(config.getDisallowedEmails());
assertEquals(2, config.getDisallowedEmails().size());
assertTrue(config.getDisallowedEmails().contains("@123\\."));
assertTrue(config.getDisallowedEmails().contains("@example\\.com$"));

assertNotNull(config.getDisallowedCountries());
assertEquals(2, config.getDisallowedCountries().size());
assertTrue(config.getDisallowedCountries().contains("Cuba"));
assertTrue(config.getDisallowedCountries().contains("North Korea"));
}
}
10 changes: 9 additions & 1 deletion src/test/resources/rpaconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@
"datacartUrl": "https://localhost/datacart/rpa",
"headbagCacheSize": 50000000,
"bagstoreMode": "local",
"jwtSecretKey": "1234567890 pdr.rpa.2023 1234567890"
"jwtSecretKey": "1234567890 pdr.rpa.2023 1234567890",
"disallowedEmails": [
"@123\\.",
"@example\\.com$"
],
"disallowedCountries": [
"Cuba",
"North Korea"
]
}

0 comments on commit 432b784

Please sign in to comment.