From f4791743ce51d6684c9326e39f57310d217848db Mon Sep 17 00:00:00 2001 From: SirWayne Date: Mon, 7 Mar 2016 12:18:18 +0100 Subject: [PATCH 1/2] Add test case description Signed-off-by: SirWayne --- .../eclipse/hawkbit/amqp/BaseAmqpService.java | 1 + .../repository/DeploymentManagementTest.java | 14 +- .../hawkbit/repository/TagManagementTest.java | 124 ++++++++++-------- .../rsql/RSQLDistributionSetFieldTest.java | 2 +- .../resource/SoftwareModuleResourceTest.java | 2 +- .../hawkbit/ui/components/ProxyTarget.java | 22 +--- 6 files changed, 79 insertions(+), 86 deletions(-) diff --git a/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/BaseAmqpService.java b/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/BaseAmqpService.java index f418937e3..897f1ae62 100644 --- a/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/BaseAmqpService.java +++ b/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/BaseAmqpService.java @@ -99,6 +99,7 @@ public class BaseAmqpService { final Object value = header.get(key); if (value == null) { logAndThrowMessageError(message, errorMessageIfNull); + return null; } return value.toString(); } diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/DeploymentManagementTest.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/DeploymentManagementTest.java index 6427ca8a2..9530a61c3 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/DeploymentManagementTest.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/DeploymentManagementTest.java @@ -50,7 +50,6 @@ import com.google.common.eventbus.Subscribe; import ru.yandex.qatools.allure.annotations.Description; import ru.yandex.qatools.allure.annotations.Features; -import ru.yandex.qatools.allure.annotations.Issue; import ru.yandex.qatools.allure.annotations.Stories; /** @@ -781,12 +780,13 @@ public class DeploymentManagementTest extends AbstractIntegrationTest { targ = targetManagement.findTargetByControllerID(targ.getControllerId()); - assertEquals(0, deploymentManagement.findActiveActionsByTarget(targ).size()); - assertEquals(1, deploymentManagement.findInActiveActionsByTarget(targ).size()); + assertEquals("active target actions are wrong", 0, deploymentManagement.findActiveActionsByTarget(targ).size()); + assertEquals("active actions are wrong", 1, deploymentManagement.findInActiveActionsByTarget(targ).size()); - assertEquals(TargetUpdateStatus.IN_SYNC, targ.getTargetInfo().getUpdateStatus()); - assertEquals(dsA, targ.getAssignedDistributionSet()); - assertEquals(dsA, targ.getTargetInfo().getInstalledDistributionSet()); + assertEquals("tagret update status is not correct", TargetUpdateStatus.IN_SYNC, + targ.getTargetInfo().getUpdateStatus()); + assertEquals("wrong assigned ds", dsA, targ.getAssignedDistributionSet()); + assertEquals("wrong installed ds", dsA, targ.getTargetInfo().getInstalledDistributionSet()); targs = deploymentManagement.assignDistributionSet(dsB.getId(), new String[] { "target-id-A" }) .getAssignedTargets(); @@ -796,7 +796,7 @@ public class DeploymentManagementTest extends AbstractIntegrationTest { assertEquals("active actions are wrong", 1, deploymentManagement.findActiveActionsByTarget(targ).size()); assertEquals("target status is wrong", TargetUpdateStatus.PENDING, targetManagement.findTargetByControllerID(targ.getControllerId()).getTargetInfo().getUpdateStatus()); - assertEquals(dsB, targ.getAssignedDistributionSet()); + assertEquals("wrong assigned ds", dsB, targ.getAssignedDistributionSet()); assertEquals("Installed ds is wrong", dsA.getId(), targetManagement.findTargetByControllerIDWithDetails(targ.getControllerId()).getTargetInfo() .getInstalledDistributionSet().getId()); diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TagManagementTest.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TagManagementTest.java index b8a4db598..b1c2cf3e3 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TagManagementTest.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TagManagementTest.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.repository; import static org.fest.assertions.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; import java.util.List; @@ -22,6 +23,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSetTag; import org.eclipse.hawkbit.repository.model.Tag; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetTag; +import org.junit.Before; import org.junit.Test; import org.slf4j.LoggerFactory; @@ -42,6 +44,11 @@ public class TagManagementTest extends AbstractIntegrationTest { LOG = LoggerFactory.getLogger(TagManagementTest.class); } + @Before + public void setup() { + assertThat(targetTagRepository.findAll()).as("Not tags should be available").isEmpty(); + } + @Test @Description("Full DS tag lifecycle tested. Create tags, assign them to sets and delete the tags.") public void createAndAssignAndDeleteDistributionSetTags() { @@ -88,7 +95,7 @@ public class TagManagementTest extends AbstractIntegrationTest { // search for not deleted distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true) .setTagNames(Lists.newArrayList(tagA.getName())); - assertEquals( + assertEquals("filter works not correct", dsAs.spliterator().getExactSizeIfKnown() + dsABs.spliterator().getExactSizeIfKnown() + dsACs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(), distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build()) @@ -96,7 +103,7 @@ public class TagManagementTest extends AbstractIntegrationTest { distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true) .setTagNames(Lists.newArrayList(tagB.getName())); - assertEquals( + assertEquals("filter works not correct", dsBs.spliterator().getExactSizeIfKnown() + dsABs.spliterator().getExactSizeIfKnown() + dsBCs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(), distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build()) @@ -104,7 +111,7 @@ public class TagManagementTest extends AbstractIntegrationTest { distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true) .setTagNames(Lists.newArrayList(tagC.getName())); - assertEquals( + assertEquals("filter works not correct", dsCs.spliterator().getExactSizeIfKnown() + dsACs.spliterator().getExactSizeIfKnown() + dsBCs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(), distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build()) @@ -112,22 +119,22 @@ public class TagManagementTest extends AbstractIntegrationTest { distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true) .setTagNames(Lists.newArrayList(tagX.getName())); - assertEquals(0, distributionSetManagement + assertEquals("filter works not correct", 0, distributionSetManagement .findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build()).getTotalElements()); - assertEquals(5, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown()); + assertEquals("wrong tag size", 5, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown()); tagManagement.deleteDistributionSetTag(tagY.getName()); - assertEquals(4, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown()); + assertEquals("wrong tag size", 4, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown()); tagManagement.deleteDistributionSetTag(tagX.getName()); - assertEquals(3, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown()); + assertEquals("wrong tag size", 3, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown()); tagManagement.deleteDistributionSetTag(tagB.getName()); - assertEquals(2, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown()); + assertEquals("wrong tag size", 2, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown()); distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(Boolean.TRUE) .setTagNames(Lists.newArrayList(tagA.getName())); - assertEquals( + assertEquals("filter works not correct", dsAs.spliterator().getExactSizeIfKnown() + dsABs.spliterator().getExactSizeIfKnown() + dsACs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(), distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build()) @@ -135,12 +142,12 @@ public class TagManagementTest extends AbstractIntegrationTest { distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(Boolean.TRUE) .setTagNames(Lists.newArrayList(tagB.getName())); - assertEquals(0, distributionSetManagement + assertEquals("filter works not correct", 0, distributionSetManagement .findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build()).getTotalElements()); distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(Boolean.TRUE) .setTagNames(Lists.newArrayList(tagC.getName())); - assertEquals( + assertEquals("filter works not correct", dsCs.spliterator().getExactSizeIfKnown() + dsACs.spliterator().getExactSizeIfKnown() + dsBCs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(), distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build()) @@ -154,30 +161,27 @@ public class TagManagementTest extends AbstractIntegrationTest { @Test @Description("Ensures that all tags are retrieved through repository.") public void findAllTargetTags() { - assertThat(targetTagRepository.findAll()).isEmpty(); - final List tags = createTargetsWithTags(); assertThat(targetTagRepository.findAll()).isEqualTo(tagManagement.findAllTargetTags()).isEqualTo(tags) - .hasSize(20); + .as("Wrong tag size").hasSize(20); } @Test @Description("Ensures that a created tag is persisted in the repository as defined.") public void createTargetTag() { - assertThat(targetTagRepository.findAll()).isEmpty(); - final Tag tag = tagManagement.createTargetTag(new TargetTag("kai1", "kai2", "colour")); - assertThat(targetTagRepository.findByNameEquals("kai1").getDescription()).isEqualTo("kai2"); - assertThat(tagManagement.findTargetTag("kai1").getColour()).isEqualTo("colour"); - assertThat(tagManagement.findTargetTagById(tag.getId()).getColour()).isEqualTo("colour"); + assertThat(targetTagRepository.findByNameEquals("kai1").getDescription()).as("wrong tag founded") + .isEqualTo("kai2"); + assertThat(tagManagement.findTargetTag("kai1").getColour()).as("wrong tag founded").isEqualTo("colour"); + assertThat(tagManagement.findTargetTagById(tag.getId()).getColour()).as("wrong tag founded") + .isEqualTo("colour"); } @Test @Description("Ensures that a deleted tag is removed from the repository as defined.") public void deleteTargetTas() { - assertThat(targetTagRepository.findAll()).isEmpty(); // create test data final Iterable tags = createTargetsWithTags(); @@ -196,16 +200,13 @@ public class TagManagementTest extends AbstractIntegrationTest { assertThat(targetManagement.findTargetByControllerID(target.getControllerId()).getTags()) .doesNotContain(toDelete); } - assertThat(targetTagRepository.findOne(toDelete.getId())).isNull(); - assertThat(tagManagement.findAllTargetTags()).hasSize(19); + assertThat(targetTagRepository.findOne(toDelete.getId())).as("No tag should be founded").isNull(); + assertThat(tagManagement.findAllTargetTags()).as("Wrong target tag size").hasSize(19); } @Test @Description("Tests the name update of a target tag.") public void updateTargetTag() { - assertThat(targetTagRepository.findAll()).isEmpty(); - - // create test data final List tags = createTargetsWithTags(); // change data @@ -216,95 +217,105 @@ public class TagManagementTest extends AbstractIntegrationTest { tagManagement.updateTargetTag(savedAssigned); // check data - assertThat(tagManagement.findAllTargetTags()).hasSize(tags.size()); - assertThat(targetTagRepository.findOne(savedAssigned.getId()).getName()).isEqualTo("test123"); - assertThat(targetTagRepository.findOne(savedAssigned.getId()).getOptLockRevision()).isEqualTo(2); + assertThat(tagManagement.findAllTargetTags()).as("Wrong target tag size").hasSize(tags.size()); + assertThat(targetTagRepository.findOne(savedAssigned.getId()).getName()).as("wrong target tag is saved") + .isEqualTo("test123"); + assertThat(targetTagRepository.findOne(savedAssigned.getId()).getOptLockRevision()) + .as("wrong target tag is saved").isEqualTo(2); } @Test @Description("Ensures that a created tag is persisted in the repository as defined.") public void createDistributionSetTag() { - assertThat(distributionSetTagRepository.findAll()).isEmpty(); - final Tag tag = tagManagement.createDistributionSetTag(new DistributionSetTag("kai1", "kai2", "colour")); - assertThat(distributionSetTagRepository.findByNameEquals("kai1").getDescription()).isEqualTo("kai2"); - assertThat(tagManagement.findDistributionSetTag("kai1").getColour()).isEqualTo("colour"); - assertThat(tagManagement.findDistributionSetTagById(tag.getId()).getColour()).isEqualTo("colour"); + assertThat(distributionSetTagRepository.findByNameEquals("kai1").getDescription()).as("wrong tag founded") + .isEqualTo("kai2"); + assertThat(tagManagement.findDistributionSetTag("kai1").getColour()).as("wrong tag founded") + .isEqualTo("colour"); + assertThat(tagManagement.findDistributionSetTagById(tag.getId()).getColour()).as("wrong tag founded") + .isEqualTo("colour"); } @Test @Description("Ensures that a created tags are persisted in the repository as defined.") public void createDistributionSetTags() { - assertThat(distributionSetTagRepository.findAll()).isEmpty(); - final List tags = createDsSetsWithTags(); - assertThat(distributionSetTagRepository.findAll()).hasSize(tags.size()); + assertThat(distributionSetTagRepository.findAll()).as("Wrong size of tags created").hasSize(tags.size()); } @Test @Description("Ensures that a deleted tag is removed from the repository as defined.") public void deleteDistributionSetTag() { - assertThat(distributionSetTagRepository.findAll()).isEmpty(); - // create test data final Iterable tags = createDsSetsWithTags(); final DistributionSetTag toDelete = tags.iterator().next(); for (final DistributionSet set : distributionSetRepository.findAll()) { assertThat(distributionSetManagement.findDistributionSetByIdWithDetails(set.getId()).getTags()) - .contains(toDelete); + .as("Wrong tag founded").contains(toDelete); } // delete tagManagement.deleteDistributionSetTag(tags.iterator().next().getName()); // check - assertThat(distributionSetTagRepository.findOne(toDelete.getId())).isNull(); - assertThat(tagManagement.findAllDistributionSetTags()).hasSize(19); + assertThat(distributionSetTagRepository.findOne(toDelete.getId())).as("Deleted tag should be null").isNull(); + assertThat(tagManagement.findAllDistributionSetTags()).as("Wrong size of tags after deletion").hasSize(19); for (final DistributionSet set : distributionSetRepository.findAll()) { assertThat(distributionSetManagement.findDistributionSetByIdWithDetails(set.getId()).getTags()) - .doesNotContain(toDelete); + .as("Wrong founded tags").doesNotContain(toDelete); } } - @Test(expected = EntityAlreadyExistsException.class) @Description("Ensures that a tag cannot be created if one exists already with that name (ecpects EntityAlreadyExistsException).") public void failedDuplicateTargetTagNameException() { tagManagement.createTargetTag(new TargetTag("A")); - tagManagement.createTargetTag(new TargetTag("A")); + try { + tagManagement.createTargetTag(new TargetTag("A")); + fail("Excpeted EntityAlreadyExistsException"); + } catch (final EntityAlreadyExistsException e) { + } } - @Test(expected = EntityAlreadyExistsException.class) @Description("Ensures that a tag cannot be updated to a name that already exists on another tag (ecpects EntityAlreadyExistsException).") public void failedDuplicateTargetTagNameExceptionAfterUpdate() { tagManagement.createTargetTag(new TargetTag("A")); final TargetTag tag = tagManagement.createTargetTag(new TargetTag("B")); tag.setName("A"); - tagManagement.updateTargetTag(tag); + try { + tagManagement.updateTargetTag(tag); + fail("Excpeted EntityAlreadyExistsException"); + } catch (final EntityAlreadyExistsException e) { + } } - @Test(expected = EntityAlreadyExistsException.class) @Description("Ensures that a tag cannot be created if one exists already with that name (ecpects EntityAlreadyExistsException).") public void failedDuplicateDsTagNameException() { tagManagement.createDistributionSetTag(new DistributionSetTag("A")); - tagManagement.createDistributionSetTag(new DistributionSetTag("A")); + try { + tagManagement.createDistributionSetTag(new DistributionSetTag("A")); + fail("Excpeted EntityAlreadyExistsException"); + } catch (final EntityAlreadyExistsException e) { + } } - @Test(expected = EntityAlreadyExistsException.class) @Description("Ensures that a tag cannot be updated to a name that already exists on another tag (ecpects EntityAlreadyExistsException).") public void failedDuplicateDsTagNameExceptionAfterUpdate() { tagManagement.createDistributionSetTag(new DistributionSetTag("A")); final DistributionSetTag tag = tagManagement.createDistributionSetTag(new DistributionSetTag("B")); tag.setName("A"); - tagManagement.updateDistributionSetTag(tag); + try { + tagManagement.updateDistributionSetTag(tag); + fail("Excpeted EntityAlreadyExistsException"); + } catch (final EntityAlreadyExistsException e) { + } } @Test @Description("Tests the name update of a target tag.") public void updateDistributionSetTag() { - assertThat(distributionSetTagRepository.findAll()).isEmpty(); // create test data final List tags = createDsSetsWithTags(); @@ -317,20 +328,19 @@ public class TagManagementTest extends AbstractIntegrationTest { tagManagement.updateDistributionSetTag(savedAssigned); // check data - assertThat(tagManagement.findAllDistributionSetTags()).hasSize(tags.size()); - assertThat(distributionSetTagRepository.findOne(savedAssigned.getId()).getName()).isEqualTo("test123"); + assertThat(tagManagement.findAllDistributionSetTags()).as("Wrong size of ds tags").hasSize(tags.size()); + assertThat(distributionSetTagRepository.findOne(savedAssigned.getId()).getName()).as("Wrong ds tag founded") + .isEqualTo("test123"); } @Test @Description("Ensures that all tags are retrieved through repository.") public void findDistributionSetTagsAll() { - assertThat(distributionSetTagRepository.findAll()).isEmpty(); - final List tags = createDsSetsWithTags(); // test - assertThat(tagManagement.findAllDistributionSetTags()).hasSize(tags.size()); - assertThat(distributionSetTagRepository.findAll()).hasSize(20); + assertThat(tagManagement.findAllDistributionSetTags()).as("Wrong size of tags").hasSize(tags.size()); + assertThat(distributionSetTagRepository.findAll()).as("Wrong size of tags").hasSize(20); } private List createTargetsWithTags() { diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/rsql/RSQLDistributionSetFieldTest.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/rsql/RSQLDistributionSetFieldTest.java index 40d757d15..add5419ee 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/rsql/RSQLDistributionSetFieldTest.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/rsql/RSQLDistributionSetFieldTest.java @@ -98,7 +98,7 @@ public class RSQLDistributionSetFieldTest extends AbstractIntegrationTest { assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "==true", 4); try { assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "==noExist*", 0); - fail(); + fail("Excepted RSQLParameterSyntaxException"); } catch (final RSQLParameterSyntaxException e) { } assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "=in=(true)", 4); diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResourceTest.java b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResourceTest.java index cf93fcba7..0b8503d6b 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResourceTest.java +++ b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResourceTest.java @@ -311,7 +311,7 @@ public class SoftwareModuleResourceTest extends AbstractIntegrationTestWithMongo .andExpect(header().string("ETag", artifact.getSha1Hash())) .andExpect(content().contentType(MediaType.APPLICATION_OCTET_STREAM)).andReturn(); - assertTrue(Arrays.equals(result.getResponse().getContentAsByteArray(), random)); + assertTrue("Wrong response content", Arrays.equals(result.getResponse().getContentAsByteArray(), random)); final MvcResult result2 = mvc .perform(get("/rest/v1/softwaremodules/{smId}/artifacts/{artId}/download", sm.getId(), diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java index 9a374f980..d85b2bc71 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java @@ -38,11 +38,9 @@ public class ProxyTarget extends Target { private TargetIdName targetIdName; - private Long createdAt; + private String assignedDistNameVersion; - private String assignedDistNameVersion = null; - - private String installedDistNameVersion = null; + private String installedDistNameVersion; private String pollStatusToolTip; @@ -251,22 +249,6 @@ public class ProxyTarget extends Target { this.installedDistributionSet = installedDistributionSet; } - /** - * @return the createdAt - */ - @Override - public Long getCreatedAt() { - return createdAt; - } - - /** - * @param createdAt - * the createdAt to set - */ - public void setCreatedAt(final Long createdAt) { - this.createdAt = createdAt; - } - /** * @return the targetIdName */ From 43d01da309f2d81b62fc29a46cb7ccfa00e3317d Mon Sep 17 00:00:00 2001 From: SirWayne Date: Mon, 7 Mar 2016 13:35:26 +0100 Subject: [PATCH 2/2] Fix typo after pull request review Signed-off-by: SirWayne --- .../hawkbit/repository/TagManagementTest.java | 31 +++++++++---------- .../rsql/RSQLDistributionSetFieldTest.java | 2 +- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TagManagementTest.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TagManagementTest.java index b1c2cf3e3..eb263b242 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TagManagementTest.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TagManagementTest.java @@ -172,11 +172,9 @@ public class TagManagementTest extends AbstractIntegrationTest { public void createTargetTag() { final Tag tag = tagManagement.createTargetTag(new TargetTag("kai1", "kai2", "colour")); - assertThat(targetTagRepository.findByNameEquals("kai1").getDescription()).as("wrong tag founded") - .isEqualTo("kai2"); - assertThat(tagManagement.findTargetTag("kai1").getColour()).as("wrong tag founded").isEqualTo("colour"); - assertThat(tagManagement.findTargetTagById(tag.getId()).getColour()).as("wrong tag founded") - .isEqualTo("colour"); + assertThat(targetTagRepository.findByNameEquals("kai1").getDescription()).as("wrong tag ed").isEqualTo("kai2"); + assertThat(tagManagement.findTargetTag("kai1").getColour()).as("wrong tag found").isEqualTo("colour"); + assertThat(tagManagement.findTargetTagById(tag.getId()).getColour()).as("wrong tag found").isEqualTo("colour"); } @Test @@ -200,7 +198,7 @@ public class TagManagementTest extends AbstractIntegrationTest { assertThat(targetManagement.findTargetByControllerID(target.getControllerId()).getTags()) .doesNotContain(toDelete); } - assertThat(targetTagRepository.findOne(toDelete.getId())).as("No tag should be founded").isNull(); + assertThat(targetTagRepository.findOne(toDelete.getId())).as("No tag should be found").isNull(); assertThat(tagManagement.findAllTargetTags()).as("Wrong target tag size").hasSize(19); } @@ -229,11 +227,10 @@ public class TagManagementTest extends AbstractIntegrationTest { public void createDistributionSetTag() { final Tag tag = tagManagement.createDistributionSetTag(new DistributionSetTag("kai1", "kai2", "colour")); - assertThat(distributionSetTagRepository.findByNameEquals("kai1").getDescription()).as("wrong tag founded") + assertThat(distributionSetTagRepository.findByNameEquals("kai1").getDescription()).as("wrong tag found") .isEqualTo("kai2"); - assertThat(tagManagement.findDistributionSetTag("kai1").getColour()).as("wrong tag founded") - .isEqualTo("colour"); - assertThat(tagManagement.findDistributionSetTagById(tag.getId()).getColour()).as("wrong tag founded") + assertThat(tagManagement.findDistributionSetTag("kai1").getColour()).as("wrong tag found").isEqualTo("colour"); + assertThat(tagManagement.findDistributionSetTagById(tag.getId()).getColour()).as("wrong tag found") .isEqualTo("colour"); } @@ -254,7 +251,7 @@ public class TagManagementTest extends AbstractIntegrationTest { for (final DistributionSet set : distributionSetRepository.findAll()) { assertThat(distributionSetManagement.findDistributionSetByIdWithDetails(set.getId()).getTags()) - .as("Wrong tag founded").contains(toDelete); + .as("Wrong tag found").contains(toDelete); } // delete @@ -265,7 +262,7 @@ public class TagManagementTest extends AbstractIntegrationTest { assertThat(tagManagement.findAllDistributionSetTags()).as("Wrong size of tags after deletion").hasSize(19); for (final DistributionSet set : distributionSetRepository.findAll()) { assertThat(distributionSetManagement.findDistributionSetByIdWithDetails(set.getId()).getTags()) - .as("Wrong founded tags").doesNotContain(toDelete); + .as("Wrong found tags").doesNotContain(toDelete); } } @@ -274,7 +271,7 @@ public class TagManagementTest extends AbstractIntegrationTest { tagManagement.createTargetTag(new TargetTag("A")); try { tagManagement.createTargetTag(new TargetTag("A")); - fail("Excpeted EntityAlreadyExistsException"); + fail("Expected EntityAlreadyExistsException"); } catch (final EntityAlreadyExistsException e) { } } @@ -286,7 +283,7 @@ public class TagManagementTest extends AbstractIntegrationTest { tag.setName("A"); try { tagManagement.updateTargetTag(tag); - fail("Excpeted EntityAlreadyExistsException"); + fail("Expected EntityAlreadyExistsException"); } catch (final EntityAlreadyExistsException e) { } } @@ -296,7 +293,7 @@ public class TagManagementTest extends AbstractIntegrationTest { tagManagement.createDistributionSetTag(new DistributionSetTag("A")); try { tagManagement.createDistributionSetTag(new DistributionSetTag("A")); - fail("Excpeted EntityAlreadyExistsException"); + fail("Expected EntityAlreadyExistsException"); } catch (final EntityAlreadyExistsException e) { } } @@ -308,7 +305,7 @@ public class TagManagementTest extends AbstractIntegrationTest { tag.setName("A"); try { tagManagement.updateDistributionSetTag(tag); - fail("Excpeted EntityAlreadyExistsException"); + fail("Expected EntityAlreadyExistsException"); } catch (final EntityAlreadyExistsException e) { } } @@ -329,7 +326,7 @@ public class TagManagementTest extends AbstractIntegrationTest { // check data assertThat(tagManagement.findAllDistributionSetTags()).as("Wrong size of ds tags").hasSize(tags.size()); - assertThat(distributionSetTagRepository.findOne(savedAssigned.getId()).getName()).as("Wrong ds tag founded") + assertThat(distributionSetTagRepository.findOne(savedAssigned.getId()).getName()).as("Wrong ds tag found") .isEqualTo("test123"); } diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/rsql/RSQLDistributionSetFieldTest.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/rsql/RSQLDistributionSetFieldTest.java index add5419ee..ea1db0ed8 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/rsql/RSQLDistributionSetFieldTest.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/rsql/RSQLDistributionSetFieldTest.java @@ -98,7 +98,7 @@ public class RSQLDistributionSetFieldTest extends AbstractIntegrationTest { assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "==true", 4); try { assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "==noExist*", 0); - fail("Excepted RSQLParameterSyntaxException"); + fail("Expected RSQLParameterSyntaxException"); } catch (final RSQLParameterSyntaxException e) { } assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "=in=(true)", 4);