diff options
author | vasraz <vasyl.razinkov@est.tech> | 2021-06-24 14:09:30 +0100 |
---|---|---|
committer | Christophe Closset <christophe.closset@intl.att.com> | 2021-07-05 09:20:43 +0000 |
commit | 47f2be812ff98c6d9d3862deb55638330e8db4f3 (patch) | |
tree | d0c86a1db92532c80b130ce205d896854c18f414 /openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test | |
parent | f9f5f68caee795d97221071fb26ebe0f572bae0d (diff) |
Remove usage of outdated library JMockit (openecomp-be)
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Issue-ID: SDC-3379
Change-Id: I7430deaa5993e67293e0f290700274dc2fff2db1
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test/java/org/openecomp/core/enrichment/types/ComponentMonitoringUploadInfoTest.java | 56 |
1 files changed, 20 insertions, 36 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test/java/org/openecomp/core/enrichment/types/ComponentMonitoringUploadInfoTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test/java/org/openecomp/core/enrichment/types/ComponentMonitoringUploadInfoTest.java index b857d0cc04..977f691c31 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test/java/org/openecomp/core/enrichment/types/ComponentMonitoringUploadInfoTest.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/test/java/org/openecomp/core/enrichment/types/ComponentMonitoringUploadInfoTest.java @@ -16,59 +16,43 @@ package org.openecomp.core.enrichment.types; -import static org.hamcrest.CoreMatchers.isA; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; -import java.util.HashMap; -import java.util.Map; -import mockit.Deencapsulation; -import org.junit.Test; - -public class ComponentMonitoringUploadInfoTest { +class ComponentMonitoringUploadInfoTest { @Test - public void testGetSnmpTrap() { - ComponentMonitoringUploadInfo uploadInfo = new ComponentMonitoringUploadInfo(); + void testGetSnmpTrap() { + final ComponentMonitoringUploadInfo uploadInfo = new ComponentMonitoringUploadInfo(); setInternals(uploadInfo); - - assertThat(uploadInfo.getSnmpTrap(), isA(MonitoringArtifactInfo.class)); + Assertions.assertTrue(uploadInfo.getSnmpTrap() instanceof MonitoringArtifactInfo); } @Test - public void testGetSnmpPoll() { - ComponentMonitoringUploadInfo uploadInfo = new ComponentMonitoringUploadInfo(); + void testGetSnmpPoll() { + final ComponentMonitoringUploadInfo uploadInfo = new ComponentMonitoringUploadInfo(); setInternals(uploadInfo); - - assertThat(uploadInfo.getSnmpPoll(), isA(MonitoringArtifactInfo.class)); + Assertions.assertTrue(uploadInfo.getSnmpPoll() instanceof MonitoringArtifactInfo); } @Test - public void testGetVesEvent() { - ComponentMonitoringUploadInfo uploadInfo = new ComponentMonitoringUploadInfo(); + void testGetVesEvent() { + final ComponentMonitoringUploadInfo uploadInfo = new ComponentMonitoringUploadInfo(); setInternals(uploadInfo); - - assertThat(uploadInfo.getVesEvent(), isA(MonitoringArtifactInfo.class)); + Assertions.assertTrue(uploadInfo.getVesEvent() instanceof MonitoringArtifactInfo); } @Test - public void testSetMonitoringArtifactFile() { - ComponentMonitoringUploadInfo uploadInfo = new ComponentMonitoringUploadInfo(); + void testSetMonitoringArtifactFile() { + final ComponentMonitoringUploadInfo uploadInfo = new ComponentMonitoringUploadInfo(); uploadInfo.setMonitoringArtifactFile(MonitoringUploadType.SNMP_POLL, new MonitoringArtifactInfo()); - - assertThat(getInternal(uploadInfo).containsKey(MonitoringUploadType.SNMP_POLL), is(true)); - } - - private Map<MonitoringUploadType, MonitoringArtifactInfo> getInternal(ComponentMonitoringUploadInfo componentMonitoringUploadInfo) { - return Deencapsulation.getField(componentMonitoringUploadInfo, "infoByType"); + Assertions.assertTrue(uploadInfo.getSnmpPoll() instanceof MonitoringArtifactInfo); } - private void setInternals(ComponentMonitoringUploadInfo componentMonitoringUploadInfo) { - Map<MonitoringUploadType, MonitoringArtifactInfo> infoMap = new HashMap<>(); - infoMap.put(MonitoringUploadType.SNMP_POLL, new MonitoringArtifactInfo()); - infoMap.put(MonitoringUploadType.SNMP_TRAP, new MonitoringArtifactInfo()); - infoMap.put(MonitoringUploadType.VES_EVENTS, new MonitoringArtifactInfo()); - Deencapsulation.setField(componentMonitoringUploadInfo, "infoByType", infoMap); + private void setInternals(final ComponentMonitoringUploadInfo componentMonitoringUploadInfo) { + componentMonitoringUploadInfo.setMonitoringArtifactFile(MonitoringUploadType.SNMP_POLL, new MonitoringArtifactInfo()); + componentMonitoringUploadInfo.setMonitoringArtifactFile(MonitoringUploadType.SNMP_TRAP, new MonitoringArtifactInfo()); + componentMonitoringUploadInfo.setMonitoringArtifactFile(MonitoringUploadType.VES_EVENTS, new MonitoringArtifactInfo()); } -}
\ No newline at end of file +} |