- @Test
- public void testGetPdpStatistics() throws PfModelException {
- assertThatThrownBy(() -> {
- new PdpProvider().getPdpStatistics(null, null);
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().getPdpStatistics(null, "name");
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertEquals(0, new PdpProvider().getPdpStatistics(pfDao, "name").size());
- }
-
- @Test
- public void testUpdatePdpStatistics() throws PfModelException {
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, null, null, null, null);
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, null, null, null, new PdpStatistics());
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, null, null, "inst", null);
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, null, null, "inst", new PdpStatistics());
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, null, "TYPE", null, null);
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, null, "TYPE", null, new PdpStatistics());
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, null, "TYPE", "inst", null);
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, null, "TYPE", "inst", new PdpStatistics());
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, "name", null, null, null);
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, "name", null, null, new PdpStatistics());
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, "name", null, "inst", null);
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, "name", null, "inst", new PdpStatistics());
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, "name", "TYPE", null, null);
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, "name", "TYPE", null, new PdpStatistics());
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, "name", "TYPE", "inst", null);
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(null, "name", "TYPE", "inst", new PdpStatistics());
- }).hasMessageMatching(DAO_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, null, null, null, null);
- }).hasMessageMatching(GROUP_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, null, null, null, new PdpStatistics());
- }).hasMessageMatching(GROUP_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, null, null, "inst", null);
- }).hasMessageMatching(GROUP_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, null, null, "inst", new PdpStatistics());
- }).hasMessageMatching(GROUP_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", null, null);
- }).hasMessageMatching(GROUP_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", null, new PdpStatistics());
- }).hasMessageMatching(GROUP_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", "inst", null);
- }).hasMessageMatching(GROUP_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, null, "TYPE", "inst", new PdpStatistics());
- }).hasMessageMatching(GROUP_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, null);
- }).hasMessageMatching(PDP_TYPE_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, "name", null, null, new PdpStatistics());
- }).hasMessageMatching(PDP_TYPE_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, "name", null, "inst", null);
- }).hasMessageMatching(PDP_TYPE_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, "name", null, "inst", new PdpStatistics());
- }).hasMessageMatching(PDP_TYPE_IS_NULL);
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", null, null);
- }).hasMessageMatching("pdpInstanceId is marked .*ull but is null");
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", null, new PdpStatistics());
- }).hasMessageMatching("pdpInstanceId is marked .*ull but is null");
-
- assertThatThrownBy(() -> {
- new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", "inst", null);
- }).hasMessageMatching("pdpStatistics is marked .*ull but is null");
-
- new PdpProvider().updatePdpStatistics(pfDao, "name", "TYPE", "inst", new PdpStatistics());
- }
-