public static AclOperation getDeniedOperation(final String errorMessage) {
    final Matcher matcher = DENIED_OPERATION_STRING_PATTERN.matcher(errorMessage);
    if (matcher.matches()) {
      return AclOperation.fromString(matcher.group(1));
    } else {
      return AclOperation.UNKNOWN;
    }
  }
@Test
  public void shouldReturnUnknownDeniedOperationFromNoValidAuthorizationMessage() {
    // When:
    final AclOperation operation = SchemaRegistryUtil.getDeniedOperation(
        "INVALID is denied operation Write on Subject: t2-value; error code: 40301");

    // Then:
    assertThat(operation, is(AclOperation.UNKNOWN));
  }