diff options
Diffstat (limited to 'src/test/java/org/onap/dcae/inventory/dbthings')
6 files changed, 40 insertions, 38 deletions
diff --git a/src/test/java/org/onap/dcae/inventory/dbthings/daos/DCAEServiceTransactionDAOTests.java b/src/test/java/org/onap/dcae/inventory/dbthings/daos/DCAEServiceTransactionDAOTests.java index c0ad9b8..309560d 100644 --- a/src/test/java/org/onap/dcae/inventory/dbthings/daos/DCAEServiceTransactionDAOTests.java +++ b/src/test/java/org/onap/dcae/inventory/dbthings/daos/DCAEServiceTransactionDAOTests.java @@ -20,6 +20,11 @@ package org.onap.dcae.inventory.dbthings.daos; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; + import org.joda.time.DateTime; import org.junit.Test; import org.onap.dcae.inventory.daos.DCAEServiceComponentsDAO; @@ -27,11 +32,6 @@ import org.onap.dcae.inventory.daos.DCAEServiceTransactionDAO; import org.onap.dcae.inventory.daos.DCAEServicesComponentsMapsDAO; import org.onap.dcae.inventory.daos.DCAEServicesDAO; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.mockito.Mockito.mock; - /** * Created by mhwang on 10/2/17. */ @@ -55,29 +55,29 @@ public class DCAEServiceTransactionDAOTests { DCAEServiceTransactionDAO.DCAEServiceTransactionContext context = new DCAEServiceTransactionDAO.DCAEServiceTransactionContext(serviceId, modifiedTime); - DCAEServicesDAO servicesDAO = mock(DCAEServicesDAO.class); - DCAEServicesComponentsMapsDAO componentsMapsDAO = mock(DCAEServicesComponentsMapsDAO.class); - DCAEServiceComponentsDAO componentsDAO = mock(DCAEServiceComponentsDAO.class); + DCAEServicesDAO servicesDao = mock(DCAEServicesDAO.class); + DCAEServicesComponentsMapsDAO componentsMapsDao = mock(DCAEServicesComponentsMapsDAO.class); + DCAEServiceComponentsDAO componentsDao = mock(DCAEServiceComponentsDAO.class); - DCAEServiceTransactionDAO transactionDAO = new DCAEServiceTransactionDAO() { + DCAEServiceTransactionDAO transactionDao = new DCAEServiceTransactionDAO() { public DCAEServicesDAO getServicesDAO() { - return servicesDAO; + return servicesDao; } public DCAEServicesComponentsMapsDAO getServicesComponentsMappingDAO() { - return componentsMapsDAO; + return componentsMapsDao; } public DCAEServiceComponentsDAO getComponentsDAO() { - return componentsDAO; + return componentsDao; } }; try { - transactionDAO.insert(context); + transactionDao.insert(context); assertTrue(true); - } catch(Exception e) { + } catch (Exception e) { fail("Unexpected error"); } diff --git a/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceComponentObjectMapperTests.java b/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceComponentObjectMapperTests.java index bb511e2..65ad2b0 100644 --- a/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceComponentObjectMapperTests.java +++ b/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceComponentObjectMapperTests.java @@ -20,14 +20,14 @@ package org.onap.dcae.inventory.dbthings.mappers; -import org.junit.Test; - -import java.sql.ResultSet; - import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; +import java.sql.ResultSet; + +import org.junit.Test; + /** * Created by mhwang on 10/2/17. */ @@ -40,7 +40,7 @@ public class DCAEServiceComponentObjectMapperTests { try { assertNotNull(mapper.map(0, resultSet, null)); - } catch(Exception e) { + } catch (Exception e) { fail("Unexpected exception"); } } diff --git a/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceObjectMapperTests.java b/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceObjectMapperTests.java index ab150bb..a0dec3d 100644 --- a/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceObjectMapperTests.java +++ b/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceObjectMapperTests.java @@ -20,15 +20,15 @@ package org.onap.dcae.inventory.dbthings.mappers; -import org.junit.Test; - -import java.sql.ResultSet; - import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import java.sql.ResultSet; + +import org.junit.Test; + /** * Created by mhwang on 10/2/17. */ @@ -42,7 +42,7 @@ public class DCAEServiceObjectMapperTests { try { when(resultSet.getString("status")).thenReturn("RUNNING"); assertNotNull(mapper.map(0, resultSet, null)); - } catch(Exception e) { + } catch (Exception e) { fail("Unexpected exception"); } } diff --git a/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceTypeObjectMapperTests.java b/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceTypeObjectMapperTests.java index c1caa29..bdac01d 100644 --- a/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceTypeObjectMapperTests.java +++ b/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceTypeObjectMapperTests.java @@ -20,19 +20,19 @@ package org.onap.dcae.inventory.dbthings.mappers; -import junit.framework.TestCase; -import org.junit.Test; +import static org.junit.Assert.fail; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.mock; +import static org.powermock.api.mockito.PowerMockito.when; import java.sql.Array; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Map; -import static junit.framework.TestCase.assertNotNull; -import static org.junit.Assert.fail; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; +import org.junit.Test; + +import junit.framework.TestCase; /** * Created by mhwang on 10/2/17. @@ -102,7 +102,7 @@ public class DCAEServiceTypeObjectMapperTests { } }); TestCase.assertNotNull(mapper.map(0, resultSet, null)); - } catch(Exception e) { + } catch (Exception e) { fail("Unexpected exception"); } } diff --git a/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceComponentObjectTests.java b/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceComponentObjectTests.java index cb81131..1d80059 100644 --- a/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceComponentObjectTests.java +++ b/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceComponentObjectTests.java @@ -20,13 +20,14 @@ package org.onap.dcae.inventory.dbthings.models; -import io.swagger.model.DCAEServiceComponentRequest; -import org.junit.Test; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotSame; +import org.junit.Test; + +import io.swagger.model.DCAEServiceComponentRequest; + /** * Created by mhwang on 9/27/17. */ diff --git a/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceObjectTests.java b/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceObjectTests.java index 7a39883..5d3c272 100644 --- a/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceObjectTests.java +++ b/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceObjectTests.java @@ -20,12 +20,13 @@ package org.onap.dcae.inventory.dbthings.models; -import io.swagger.model.DCAEServiceRequest; -import org.junit.Test; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import org.junit.Test; + +import io.swagger.model.DCAEServiceRequest; + /** * Created by mhwang on 9/27/17. */ |