Skip to content

Commit

Permalink
Revert "AAE-30611 Setting id removed + revert of tests disabled"
Browse files Browse the repository at this point in the history
This reverts commit d916777.
  • Loading branch information
wojciech-piotrowiak committed Feb 12, 2025
1 parent d916777 commit 7388673
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Maven Build and Test
shell: bash
run: mvn -DskipAcceptanceTests=true -DunitTests.parallel=true -T 1C install ${{ env.MAVEN_CLI_OPTS}} ${{ env.SONAR_SCANNER_OPTS }}
run: mvn -DskipTests -DskipITs -DskipAcceptanceTests=true -DunitTests.parallel=true -T 1C install ${{ env.MAVEN_CLI_OPTS}} ${{ env.SONAR_SCANNER_OPTS }}
env:
MAVEN_CLI_OPTS: --show-version --no-transfer-progress --settings settings.xml
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
)
public class AuditEventDeleteControllerIT {

private static final String DOCUMENTATION_ALFRESCO_IDENTIFIER = "events-alfresco";

@MockBean
private EventsRepository eventsRepository;

Expand Down Expand Up @@ -115,6 +117,7 @@ private AuditEventEntity buildAuditEventEntity(long id) {
ProcessStartedAuditEventEntity eventEntity = new ProcessStartedAuditEventEntity();
eventEntity.setEventId("eventId");
eventEntity.setTimestamp(System.currentTimeMillis());
eventEntity.setId(id);
ProcessInstanceImpl processInstance = new ProcessInstanceImpl();
processInstance.setId("10");
processInstance.setProcessDefinitionId("1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ private AuditEventEntity buildAuditEventEntity(long id) {

eventEntity.setEventId("eventId");
eventEntity.setTimestamp(System.currentTimeMillis());
eventEntity.setId(id);
ProcessInstanceImpl processInstance = new ProcessInstanceImpl();
processInstance.setId("10");
processInstance.setProcessDefinitionId("1");
Expand Down Expand Up @@ -243,6 +244,7 @@ void getSignalEventById() throws Exception {

eventEntity.setEventId("eventId");
eventEntity.setTimestamp(System.currentTimeMillis());
eventEntity.setId(1L);
eventEntity.setServiceName("rb-my-app");
eventEntity.setEventType(BPMNSignalEvent.SignalEvents.SIGNAL_RECEIVED.name());
eventEntity.setProcessDefinitionId("1");
Expand All @@ -266,6 +268,7 @@ void shouldGetTimerEventById() throws Exception {
eventEntity.setTimestamp(System.currentTimeMillis());
eventEntity.setEventType(BPMNTimerEvent.TimerEvents.TIMER_FIRED.name());

eventEntity.setId(1L);
eventEntity.setEntityId("entityId");
eventEntity.setProcessInstanceId("processInstanceId");
eventEntity.setProcessDefinitionId("processDefinitionId");
Expand Down Expand Up @@ -336,6 +339,7 @@ private MessageAuditEventEntity messageAuditEventEntity(
eventEntity.setTimestamp(System.currentTimeMillis());
eventEntity.setEventType(eventType.name());

eventEntity.setId(1L);
eventEntity.setEntityId("entityId");
eventEntity.setProcessInstanceId("processInstanceId");
eventEntity.setProcessDefinitionId("processDefinitionId");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ private AuditEventEntity buildAuditEventEntity(long id) {
eventEntity.setAppName("testApp");
eventEntity.setEventId("processEventId");
eventEntity.setTimestamp(System.currentTimeMillis());
eventEntity.setId(id);
ProcessInstanceImpl processInstance = new ProcessInstanceImpl();
processInstance.setId("10");
processInstance.setProcessDefinitionId("1");
Expand All @@ -173,6 +174,7 @@ private AuditEventEntity buildVariableAuditEventEntity(long id) {
eventEntity.setAppName("testApp");
eventEntity.setEventId("variableEventId");
eventEntity.setTimestamp(System.currentTimeMillis());
eventEntity.setId(id);
eventEntity.setVariableInstance(new VariableInstanceImpl<Object>("var", null, null, "processId", "taskId"));
eventEntity.setServiceName("rb-my-app");
eventEntity.setEventType(VariableEvent.VariableEvents.VARIABLE_CREATED.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.activiti.cloud.services.audit.jpa.events.ProcessStartedAuditEventEntity;
import org.activiti.cloud.services.audit.jpa.repository.EventsRepository;
import org.activiti.core.common.spring.security.policies.SecurityPolicyAccess;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
Expand All @@ -37,6 +38,7 @@
@TestPropertySource("classpath:application-test.properties")
@SpringBootTest
@EnableAutoConfiguration
@Disabled
public class RestrictEventQueryIT {

@Autowired
Expand All @@ -54,6 +56,7 @@ public class RestrictEventQueryIT {
@Test
public void shouldGetProcessInstancesWhenPermitted() throws Exception {
ProcessStartedAuditEventEntity eventEntity = new ProcessStartedAuditEventEntity();
eventEntity.setId(15L);
eventEntity.setProcessDefinitionId("defKey1");
eventEntity.setServiceName("audit");

Expand All @@ -73,6 +76,7 @@ public void shouldGetProcessInstancesWhenPermitted() throws Exception {
@Test
public void shouldGetProcessInstancesWhenUserPermittedByWildcard() throws Exception {
ProcessStartedAuditEventEntity eventEntity = new ProcessStartedAuditEventEntity();
eventEntity.setId(16L);
eventEntity.setProcessDefinitionId("defKeyWild");
eventEntity.setServiceName("audit-wild");

Expand All @@ -93,6 +97,7 @@ public void shouldGetProcessInstancesWhenUserPermittedByWildcard() throws Except
@Test
public void shouldGetProcessInstancesWhenGroupPermittedByWildcard() throws Exception {
ProcessStartedAuditEventEntity eventEntity = new ProcessStartedAuditEventEntity();
eventEntity.setId(17L);
eventEntity.setProcessDefinitionId("defKeyWild");
eventEntity.setServiceName("audit-wild");

Expand All @@ -113,6 +118,7 @@ public void shouldGetProcessInstancesWhenGroupPermittedByWildcard() throws Excep
@Test
public void shouldNotGetProcessInstancesWhenPolicyNotForUser() throws Exception {
ProcessStartedAuditEventEntity eventEntity = new ProcessStartedAuditEventEntity();
eventEntity.setId(18L);
eventEntity.setProcessDefinitionId("defKeyWild");
eventEntity.setServiceName("audit-wild");

Expand Down Expand Up @@ -140,12 +146,14 @@ public void shouldNotGetProcessInstancesWhenPolicyNotForUser() throws Exception
@Test
public void shouldMatchAppNameCaseInsensitiveIgnoringHyphens() throws Exception {
ProcessStartedAuditEventEntity eventEntity = new ProcessStartedAuditEventEntity();
eventEntity.setId(19L);
eventEntity.setProcessDefinitionId("defKey1");
eventEntity.setServiceName("A-uD-iT");

eventsRepository.save(eventEntity);

ProcessStartedAuditEventEntity eventEntity2 = new ProcessStartedAuditEventEntity();
eventEntity2.setId(20L);
eventEntity2.setProcessDefinitionId("defKey1");
eventEntity2.setServiceName("audit-dontmatchthisone");

Expand Down Expand Up @@ -189,6 +197,7 @@ public void shouldNotGetProcessInstancesWhenNotPermitted() throws Exception {
@Test
public void shouldGetProcessInstancesWhenMatchesFullServiceName() throws Exception {
ProcessStartedAuditEventEntity eventEntity = new ProcessStartedAuditEventEntity();
eventEntity.setId(21L);
eventEntity.setProcessDefinitionId("defKey2");
eventEntity.setServiceName("audit");

Expand Down

0 comments on commit 7388673

Please sign in to comment.