public class AuditMatchers extends Object
AuditEvent
and associated objects
This is initial version, please feel free to add new matchers when needed.
Please ensure you are using hamcrest MatcherAssert.assertThat(T, org.hamcrest.Matcher<? super T>)
method
(no JUnit one).
assertThat(auditEvent, hasAffectedObject(allOf(hasName("name"), hasId("id"), isType("SCHEME")))); assertThat(auditEvent, hasExtraAttribute("description", equalTo("test"))); assertThat(auditEvent, hasChangedValue(changedValue("common.concepts.issuetype", "to value"))); assertThat(auditEvent, hasChangedValue(changedValue("admin.projects.screen.scheme", "from", "to")));
Constructor and Description |
---|
AuditMatchers() |
Modifier and Type | Method and Description |
---|---|
static <T extends Iterable<?>> |
affectedObjects(org.hamcrest.Matcher<T> collectionMatcher) |
static <T extends Iterable<?>> |
changedValues(org.hamcrest.Matcher<T> collectionMatcher) |
static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditType> |
hasActionI18nKey(org.hamcrest.Matcher<String> actionMatcher) |
static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditType> |
hasActionI18nKey(String actionI18nKey) |
static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditEvent> |
hasAffectedObject(org.hamcrest.Matcher<com.atlassian.audit.entity.AuditResource> itemMatcher) |
static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditEvent> |
hasAuditType(org.hamcrest.Matcher<com.atlassian.audit.entity.AuditType> auditTypeMatcher) |
static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditEvent> |
hasChangedValue(org.hamcrest.Matcher<com.atlassian.audit.entity.ChangedValue> itemMatcher) |
static org.hamcrest.Matcher<com.atlassian.audit.entity.AuditType> |
hasCoverageLevel(com.atlassian.audit.entity.CoverageLevel level) |
static org.hamcrest.Matcher<com.atlassian.audit.entity.AuditType> |
hasCoverageLevel(org.hamcrest.Matcher<com.atlassian.audit.entity.CoverageLevel> actionMatcher) |
static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditEvent> |
hasExtraAttribute(String name,
org.hamcrest.Matcher<String> itemMatcher) |
static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditEvent> |
hasExtraAttribute(String name,
String value) |
public static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditEvent> hasAffectedObject(@Nonnull org.hamcrest.Matcher<com.atlassian.audit.entity.AuditResource> itemMatcher)
public static <T extends Iterable<?>> org.hamcrest.Matcher<com.atlassian.audit.entity.AuditEvent> affectedObjects(org.hamcrest.Matcher<T> collectionMatcher)
public static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditEvent> hasExtraAttribute(@Nonnull String name, @Nullable String value)
public static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditEvent> hasExtraAttribute(@Nonnull String name, @Nonnull org.hamcrest.Matcher<String> itemMatcher)
public static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditEvent> hasChangedValue(@Nonnull org.hamcrest.Matcher<com.atlassian.audit.entity.ChangedValue> itemMatcher)
public static <T extends Iterable<?>> org.hamcrest.Matcher<com.atlassian.audit.entity.AuditEvent> changedValues(org.hamcrest.Matcher<T> collectionMatcher)
public static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditEvent> hasAuditType(@Nonnull org.hamcrest.Matcher<com.atlassian.audit.entity.AuditType> auditTypeMatcher)
public static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditType> hasActionI18nKey(@Nullable String actionI18nKey)
public static org.hamcrest.BaseMatcher<com.atlassian.audit.entity.AuditType> hasActionI18nKey(@Nonnull org.hamcrest.Matcher<String> actionMatcher)
public static org.hamcrest.Matcher<com.atlassian.audit.entity.AuditType> hasCoverageLevel(com.atlassian.audit.entity.CoverageLevel level)
public static org.hamcrest.Matcher<com.atlassian.audit.entity.AuditType> hasCoverageLevel(@Nonnull org.hamcrest.Matcher<com.atlassian.audit.entity.CoverageLevel> actionMatcher)
Copyright © 2002-2024 Atlassian. All Rights Reserved.