diff --git a/hawkbit-repository/hawkbit-repository-core/src/test/java/org/eclipse/hawkbit/event/BusProtoStuffMessageConverterTest.java b/hawkbit-repository/hawkbit-repository-core/src/test/java/org/eclipse/hawkbit/event/BusProtoStuffMessageConverterTest.java index b0cba6c255..73573f99a0 100644 --- a/hawkbit-repository/hawkbit-repository-core/src/test/java/org/eclipse/hawkbit/event/BusProtoStuffMessageConverterTest.java +++ b/hawkbit-repository/hawkbit-repository-core/src/test/java/org/eclipse/hawkbit/event/BusProtoStuffMessageConverterTest.java @@ -57,8 +57,9 @@ void successfullySerializeAndDeserializeEvent() { // deserialize when(messageMock.getPayload()).thenReturn(serializedEvent); final Object deserializedEvent = underTest.convertFromInternal(messageMock, RemoteApplicationEvent.class, null); - assertThat(deserializedEvent).isInstanceOf(TargetCreatedEvent.class); - assertThat(deserializedEvent).isEqualTo(targetCreatedEvent); + assertThat(deserializedEvent) + .isInstanceOf(TargetCreatedEvent.class) + .isEqualTo(targetCreatedEvent); } @Test diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/AbstractDsAssignmentStrategy.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/AbstractDsAssignmentStrategy.java index 9099bb8f3a..ed51640262 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/AbstractDsAssignmentStrategy.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/AbstractDsAssignmentStrategy.java @@ -26,6 +26,7 @@ import org.eclipse.hawkbit.repository.event.remote.entity.TargetUpdatedEvent; import org.eclipse.hawkbit.repository.jpa.configuration.Constants; import org.eclipse.hawkbit.repository.jpa.executor.AfterTransactionCommitExecutor; +import org.eclipse.hawkbit.repository.jpa.model.AbstractJpaBaseEntity_; import org.eclipse.hawkbit.repository.jpa.model.JpaAction; import org.eclipse.hawkbit.repository.jpa.model.JpaActionStatus; import org.eclipse.hawkbit.repository.jpa.model.JpaAction_; @@ -60,12 +61,14 @@ public abstract class AbstractDsAssignmentStrategy { protected final AfterTransactionCommitExecutor afterCommit; protected final EventPublisherHolder eventPublisherHolder; protected final ActionRepository actionRepository; + private final ActionStatusRepository actionStatusRepository; private final QuotaManagement quotaManagement; private final BooleanSupplier multiAssignmentsConfig; private final BooleanSupplier confirmationFlowConfig; private final RepositoryProperties repositoryProperties; + @SuppressWarnings("java:S107") AbstractDsAssignmentStrategy( final TargetRepository targetRepository, final AfterTransactionCommitExecutor afterCommit, final EventPublisherHolder eventPublisherHolder, @@ -149,7 +152,7 @@ protected List overrideObsoleteUpdateActions(final Collection target cb.equal(root.get(JpaAction_.active), true), cb.equal(root.get(JpaAction_.distributionSet).get(JpaDistributionSet_.requiredMigrationStep), false), cb.notEqual(root.get(JpaAction_.status), Action.Status.CANCELING), - root.get(JpaAction_.target).get(JpaTarget_.id).in(targetsIds) + root.get(JpaAction_.target).get(AbstractJpaBaseEntity_.id).in(targetsIds) ); }); @@ -187,7 +190,7 @@ protected List closeObsoleteUpdateActions(final Collection targetsId return cb.and( cb.equal(root.get(JpaAction_.active), true), cb.equal(root.get(JpaAction_.distributionSet).get(JpaDistributionSet_.requiredMigrationStep), false), - root.get(JpaAction_.target).get(JpaTarget_.id).in(targetsIds) + root.get(JpaAction_.target).get(AbstractJpaBaseEntity_.id).in(targetsIds) ); }); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/AbstractRemoteEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/AbstractRemoteEventTest.java index 84c652c868..d8d5f14bf0 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/AbstractRemoteEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/AbstractRemoteEventTest.java @@ -37,6 +37,7 @@ /** * Test the remote entity events. */ +@SuppressWarnings("java:S6813") // constructor injects are not possible for test classes public abstract class AbstractRemoteEventTest extends AbstractJpaIntegrationTest { @Autowired diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/AbstractJpaIntegrationTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/AbstractJpaIntegrationTest.java index 072e63af4a..ddaa6e6d59 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/AbstractJpaIntegrationTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/AbstractJpaIntegrationTest.java @@ -78,6 +78,7 @@ @ContextConfiguration(classes = { RepositoryApplicationConfiguration.class, TestConfiguration.class }) @Import(TestChannelBinderConfiguration.class) @TestPropertySource(locations = "classpath:/jpa-test.properties") +@SuppressWarnings("java:S6813") // constructor injects are not possible for test classes public abstract class AbstractJpaIntegrationTest extends AbstractIntegrationTest { protected static final String INVALID_TEXT_HTML = "