Remove TargetInfo entity (#453)

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
Kai Zimmermann
2017-03-17 12:18:43 +01:00
committed by GitHub
parent 67d17fe661
commit 602fb78168
89 changed files with 1166 additions and 1462 deletions

View File

@@ -118,7 +118,7 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
void sendUpdateMessageToTarget(final String tenant, final Target target, final Long actionId,
final Collection<org.eclipse.hawkbit.repository.model.SoftwareModule> modules) {
final URI targetAdress = target.getTargetInfo().getAddress();
final URI targetAdress = target.getAddress();
if (!IpUtil.isAmqpUri(targetAdress)) {
return;
}
@@ -153,7 +153,7 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
}
sendCancelMessageToTarget(cancelEvent.getTenant(), cancelEvent.getEntity().getControllerId(),
cancelEvent.getActionId(), cancelEvent.getEntity().getTargetInfo().getAddress());
cancelEvent.getActionId(), cancelEvent.getEntity().getAddress());
}
private boolean isFromSelf(final RemoteApplicationEvent event) {

View File

@@ -189,7 +189,7 @@ public class AmqpMessageHandlerService extends BaseAmqpService {
final Action action = actionOptional.get();
if (action.isCancelingOrCanceled()) {
amqpMessageDispatcherService.sendCancelMessageToTarget(target.getTenant(), target.getControllerId(),
action.getId(), target.getTargetInfo().getAddress());
action.getId(), target.getAddress());
return;
}

View File

@@ -127,7 +127,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
private Message getCaptureAdressEvent(final TargetAssignDistributionSetEvent targetAssignDistributionSetEvent) {
final Target target = targetManagement
.findTargetByControllerID(targetAssignDistributionSetEvent.getControllerId()).get();
final Message sendMessage = createArgumentCapture(target.getTargetInfo().getAddress());
final Message sendMessage = createArgumentCapture(target.getAddress());
return sendMessage;
}
@@ -207,7 +207,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
.stream().filter(dmfartifact -> dmfartifact.getFilename().equals(dbArtifact.getFilename()))
.findAny();
assertTrue("The artifact should exist in message", found.isPresent());
assertThat(found).as("The artifact should exist in message").isPresent();
assertThat(found.get().getSize()).isEqualTo(dbArtifact.getSize());
assertThat(found.get().getHashes().getMd5()).isEqualTo(dbArtifact.getMd5Hash());
assertThat(found.get().getHashes().getSha1()).isEqualTo(dbArtifact.getSha1Hash());
@@ -223,7 +223,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
amqpMessageDispatcherService
.targetCancelAssignmentToDistributionSet(cancelTargetAssignmentDistributionSetEvent);
final Message sendMessage = createArgumentCapture(
cancelTargetAssignmentDistributionSetEvent.getEntity().getTargetInfo().getAddress());
cancelTargetAssignmentDistributionSetEvent.getEntity().getAddress());
assertCancelMessage(sendMessage);
}

View File

@@ -52,7 +52,6 @@ import org.eclipse.hawkbit.repository.model.Action.Status;
import org.eclipse.hawkbit.repository.model.Artifact;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.repository.model.TargetInfo;
import org.eclipse.hawkbit.security.SecurityTokenGenerator;
import org.junit.Before;
import org.junit.Test;
@@ -472,7 +471,6 @@ public class AmqpMessageHandlerServiceTest {
// Mock
final Action actionMock = mock(Action.class);
final Target targetMock = mock(Target.class);
final TargetInfo targetInfoMock = mock(TargetInfo.class);
final DistributionSet distributionSetMock = mock(DistributionSet.class);
when(distributionSetMock.getId()).thenReturn(1L);
@@ -483,8 +481,7 @@ public class AmqpMessageHandlerServiceTest {
when(actionMock.getTarget()).thenReturn(targetMock);
when(targetMock.getControllerId()).thenReturn("target1");
when(targetMock.getSecurityToken()).thenReturn("securityToken");
when(targetMock.getTargetInfo()).thenReturn(targetInfoMock);
when(targetInfoMock.getAddress()).thenReturn(null);
when(targetMock.getAddress()).thenReturn(null);
return actionMock;
}