diff options
author | Yulian Han <elaine.hanyulian@huawei.com> | 2018-04-19 11:11:35 +0800 |
---|---|---|
committer | Yulian Han <elaine.hanyulian@huawei.com> | 2018-04-19 06:08:38 +0000 |
commit | f26e7748ceab6de3c47959798e545c7a71e49433 (patch) | |
tree | 2f69813915e0f4ab732a048949187aa63e4b7752 /mso-api-handlers/mso-requests-db/src/test | |
parent | 45ec1c516b5f5217dbfb8bdcf9f04d187e013d21 (diff) |
getOperationStatusByServiceId db result is list
Change-Id: Idaa55084f5ecb0dd3636c232cebc14fa5f064302
Issue-ID: SO-578
Signed-off-by: Yulian Han <elaine.hanyulian@huawei.com>
Diffstat (limited to 'mso-api-handlers/mso-requests-db/src/test')
-rw-r--r-- | mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseTest.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseTest.java index 005a28ec52..aacdd96420 100644 --- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseTest.java +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseTest.java @@ -33,6 +33,7 @@ import org.junit.runner.RunWith; import org.openecomp.mso.db.AbstractSessionFactoryManager; import java.util.Arrays; +import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -237,8 +238,8 @@ public class RequestsDatabaseTest { @Mocked Query query) throws Exception { new Expectations() {{ sessionFactoryManager.getSessionFactory().openSession(); result = session; - session.createQuery("FROM OperationStatus WHERE SERVICE_ID = :service_id"); result = query; - query.uniqueResult(); result = new OperationStatus(); + session.createQuery("FROM OperationStatus WHERE SERVICE_ID = :service_id order by OPERATE_AT desc"); result = query; + List<Object>list = query.list(); result = new OperationStatus(); }}; assertEquals(OperationStatus.class, requestsDatabase.getOperationStatusByServiceId("123").getClass()); |