Skip to content

Commit

Permalink
refactor: rename methods with "Failure" in the name
Browse files Browse the repository at this point in the history
* Reserve "FAILURE" for JUnit test fail logs so we won't find these methods in the logs when looking for test failures.
  • Loading branch information
swalchemist committed Sep 30, 2023
1 parent 477ab2b commit f792b9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void testNonUAAZoneUaaActiveUaaAuthenticationSuccess() {
}

@Test
void testNonUAAZoneUaaActiveUaaAuthenticationFailure() {
void testNonUAAZoneUaaActiveUaaAuthenticationFail() {
IdentityZoneHolder.set(ZONE);
when(providerProvisioning.retrieveByOrigin(OriginKeys.UAA, ZONE.getId())).thenReturn(uaaActive);
when(providerProvisioning.retrieveByOrigin(OriginKeys.LDAP, ZONE.getId())).thenReturn(ldapActive);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ void testCreate_RestrictedClient_Succeeds() throws Exception {
}

@Test
void testCreateClientsTxFailure_Secret_Too_Long() throws Exception {
void testCreateClientsTxFail_Secret_Too_Long() throws Exception {
int count = 5;
BaseClientDetails[] details = createBaseClients(count, SECRET_TOO_LONG, null);
MockHttpServletRequestBuilder createClientPost = post("/oauth/clients/tx")
Expand Down Expand Up @@ -501,7 +501,7 @@ void testCreateClientsTxDuplicateId() throws Exception {
}

@Test
void test_InZone_ClientWrite_Failure_with_Min_Length_Secret() throws Exception {
void test_InZone_ClientWrite_Fail_with_Min_Length_Secret() throws Exception {
String subdomain = generator.generate();
MockMvcUtils.IdentityZoneCreationResult result = MockMvcUtils.createOtherIdentityZoneAndReturnResult(subdomain, mockMvc, webApplicationContext, null, IdentityZoneHolder.getCurrentZoneId());
result.getIdentityZone().getConfig().setClientSecretPolicy(new ClientSecretPolicy(7, 255, 0, 0, 0, 0, 6));
Expand All @@ -515,7 +515,7 @@ void test_InZone_ClientWrite_Failure_with_Min_Length_Secret() throws Exception {
}

@Test
void test_InZone_ClientWrite_Failure_with_Secret_Too_Long() throws Exception {
void test_InZone_ClientWrite_Fail_with_Secret_Too_Long() throws Exception {
String subdomain = generator.generate();
MockMvcUtils.IdentityZoneCreationResult result = MockMvcUtils.createOtherIdentityZoneAndReturnResult(subdomain, mockMvc, webApplicationContext, null, IdentityZoneHolder.getCurrentZoneId());
result.getIdentityZone().getConfig().setClientSecretPolicy(new ClientSecretPolicy(0, 5, 0, 0, 0, 0, 6));
Expand All @@ -529,7 +529,7 @@ void test_InZone_ClientWrite_Failure_with_Secret_Too_Long() throws Exception {
}

@Test
void test_InZone_ClientWrite_Failure_with_Secret_Requires_Uppercase_Character() throws Exception {
void test_InZone_ClientWrite_Fail_with_Secret_Requires_Uppercase_Character() throws Exception {
String subdomain = generator.generate();
MockMvcUtils.IdentityZoneCreationResult result = MockMvcUtils.createOtherIdentityZoneAndReturnResult(subdomain, mockMvc, webApplicationContext, null, IdentityZoneHolder.getCurrentZoneId());
result.getIdentityZone().getConfig().setClientSecretPolicy(new ClientSecretPolicy(0, 255, 1, 0, 0, 0, 6));
Expand All @@ -543,7 +543,7 @@ void test_InZone_ClientWrite_Failure_with_Secret_Requires_Uppercase_Character()
}

@Test
void test_InZone_ClientWrite_Failure_with_Secret_Requires_Lowercase_Character() throws Exception {
void test_InZone_ClientWrite_Fail_with_Secret_Requires_Lowercase_Character() throws Exception {
String subdomain = generator.generate();
MockMvcUtils.IdentityZoneCreationResult result = MockMvcUtils.createOtherIdentityZoneAndReturnResult(subdomain, mockMvc, webApplicationContext, null, IdentityZoneHolder.getCurrentZoneId());
result.getIdentityZone().getConfig().setClientSecretPolicy(new ClientSecretPolicy(0, 255, 0, 1, 0, 0, 6));
Expand Down Expand Up @@ -571,7 +571,7 @@ void test_InZone_ClientWrite_Success_with_Complex_Secret_Policy() throws Excepti
}

@Test
void test_InZone_ClientWrite_Failure_with_Secret_Requires_Special_Character() throws Exception {
void test_InZone_ClientWrite_Fail_with_Secret_Requires_Special_Character() throws Exception {
String subdomain = generator.generate();
MockMvcUtils.IdentityZoneCreationResult result = MockMvcUtils.createOtherIdentityZoneAndReturnResult(subdomain, mockMvc, webApplicationContext, null, IdentityZoneHolder.getCurrentZoneId());
result.getIdentityZone().getConfig().setClientSecretPolicy(new ClientSecretPolicy(0, 255, 0, 0, 0, 1, 6));
Expand All @@ -585,7 +585,7 @@ void test_InZone_ClientWrite_Failure_with_Secret_Requires_Special_Character() th
}

@Test
void test_InZone_ClientWrite_Failure_with_Secret_Requires_Digit() throws Exception {
void test_InZone_ClientWrite_Fail_with_Secret_Requires_Digit() throws Exception {
String subdomain = generator.generate();
MockMvcUtils.IdentityZoneCreationResult result = MockMvcUtils.createOtherIdentityZoneAndReturnResult(subdomain, mockMvc, webApplicationContext, null, IdentityZoneHolder.getCurrentZoneId());
result.getIdentityZone().getConfig().setClientSecretPolicy(new ClientSecretPolicy(0, 255, 0, 0, 1, 0, 6));
Expand Down

0 comments on commit f792b9d

Please sign in to comment.