Skip to content
Snippets Groups Projects
Commit 2f593bda authored by buczekp's avatar buczekp
Browse files

[LMS-1507] fixed bo test

SVN: 15684
parent 140bf425
No related branches found
No related tags found
No related merge requests found
...@@ -562,11 +562,10 @@ public final class ExternalDataTableTest extends AbstractBOTest ...@@ -562,11 +562,10 @@ public final class ExternalDataTableTest extends AbstractBOTest
{ {
prepareFindFullDatasets(allDataSets, false, true); prepareFindFullDatasets(allDataSets, false, true);
prepareUpdateDatasetStatus(d2Available1, ARCHIVE_PENDING); prepareUpdateDatasetStatuses(new ExternalDataPE[]
prepareUpdateDatasetStatus(d2Available2, ARCHIVE_PENDING); { d2Available1, d2Available2, d3Available }, ARCHIVE_PENDING);
prepareUpdateDatasetStatus(d3Available, ARCHIVE_PENDING);
prepareFlush(); // prepareFlush();
prepareArchiving(dataStoreService2, dss2, d2Available1, d2Available2); prepareArchiving(dataStoreService2, dss2, d2Available1, d2Available2);
prepareArchiving(dataStoreService3, dss3, d3Available); prepareArchiving(dataStoreService3, dss3, d3Available);
...@@ -601,11 +600,8 @@ public final class ExternalDataTableTest extends AbstractBOTest ...@@ -601,11 +600,8 @@ public final class ExternalDataTableTest extends AbstractBOTest
{ {
prepareFindFullDatasets(allDataSets, false, true); prepareFindFullDatasets(allDataSets, false, true);
prepareUpdateDatasetStatus(d2Archived1, UNARCHIVE_PENDING); prepareUpdateDatasetStatuses(new ExternalDataPE[]
prepareUpdateDatasetStatus(d2Archived2, UNARCHIVE_PENDING); { d2Archived1, d2Archived2, d3Archived }, UNARCHIVE_PENDING);
prepareUpdateDatasetStatus(d3Archived, UNARCHIVE_PENDING);
prepareFlush();
prepareUnarchiving(dataStoreService2, dss2, d2Archived1, d2Archived2); prepareUnarchiving(dataStoreService2, dss2, d2Archived1, d2Archived2);
prepareUnarchiving(dataStoreService3, dss3, d3Archived); prepareUnarchiving(dataStoreService3, dss3, d3Archived);
...@@ -621,34 +617,14 @@ public final class ExternalDataTableTest extends AbstractBOTest ...@@ -621,34 +617,14 @@ public final class ExternalDataTableTest extends AbstractBOTest
context.assertIsSatisfied(); context.assertIsSatisfied();
} }
private void prepareUpdateDatasetStatus(final ExternalDataPE dataSet, private void prepareUpdateDatasetStatuses(final ExternalDataPE[] dataSets,
final DataSetArchivingStatus newStatus) final DataSetArchivingStatus newStatus)
{ {
context.checking(new Expectations() context.checking(new Expectations()
{ {
{ {
one(externalDataDAO).updateDataSetStatuses(
one(externalDataDAO).validate(with(new BaseMatcher<ExternalDataPE>() Code.extractCodes(Arrays.asList(dataSets)), newStatus);
{
public boolean matches(Object item)
{
if (item instanceof ExternalDataPE)
{
ExternalDataPE actualDataSet = (ExternalDataPE) item;
return dataSet.equals(actualDataSet)
&& newStatus == actualDataSet.getStatus();
}
return false;
}
public void describeTo(Description description)
{
description.appendValue("Dataset " + dataSet.getCode()
+ " with status " + newStatus);
}
}));
} }
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment