src_fm_fc_ms_ff
stringlengths
43
86.8k
target
stringlengths
20
276k
SubtenantIdentityProviderDao extends AbstractSubtenantIdentityProviderDao { @Override @SuppressWarnings({ "resource", "unused" }) public SubtenantIdentityProviderDao clone() { try { return new SubtenantIdentityProviderDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCl...
@SuppressWarnings("resource") @Test public void testClone() { try { SubtenantIdentityProviderDao subtenantidentityproviderdao1 = new SubtenantIdentityProviderDao(); SubtenantIdentityProviderDao subtenantidentityproviderdao2 = subtenantidentityproviderdao1.clone(); assertNotNull(subtenantidentityproviderdao1); assertNot...
UserDao extends AbstractModelDao<User> implements CrudDao<User> { @Override @SuppressWarnings({ "resource", "unused" }) public UserDao clone() { try { return new UserDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCloudException exception) { return null; } } UserDao()...
@SuppressWarnings("resource") @Test public void testClone() { try { UserDao userdao1 = new UserDao(); UserDao userdao2 = userdao1.clone(); assertNotNull(userdao1); assertNotNull(userdao2); assertNotSame(userdao2, userdao1); assertEquals(userdao2, userdao1); } catch (Exception exception) { fail(exception.getMessage()); ...
DaoFactory implements Cloneable { @Override public DaoFactory clone() { return new DaoFactory(this); } DaoFactory(SdkContext context); DaoFactory(); DaoFactory(DaoFactory daoFactory); @Override DaoFactory clone(); @Override boolean equals(Object obj); @SuppressWarnings("resource") AccountDao getAccountDao(); @Suppres...
@SuppressWarnings("resource") @Test public void testClone() { try { DaoFactory daofactory1 = new DaoFactory((DaoFactory) null); DaoFactory daofactory2 = daofactory1.clone(); assertNotNull(daofactory1); assertNotNull(daofactory2); assertNotSame(daofactory2, daofactory1); assertEquals(daofactory2, daofactory1); } catch (...
DaoFactory implements Cloneable { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((context == null) ? 0 : context.hashCode()); return result; } DaoFactory(SdkContext context); DaoFactory(); DaoFactory(DaoFactory daoFactory); @Override DaoFactory clone(); @Override bo...
@SuppressWarnings("resource") @Test public void testHashCode() { try { DaoFactory daofactory1 = new DaoFactory((DaoFactory) null); DaoFactory daofactory2 = new DaoFactory((DaoFactory) null); assertNotNull(daofactory1); assertNotNull(daofactory2); assertNotSame(daofactory2, daofactory1); assertEquals(daofactory2, daofac...
TranslationUtils { public static List<String> parseList(String string, String separator) { if (string == null || separator == null) { return null; } return Arrays.asList(string.split(separator)); } private TranslationUtils(); static Date toDate(DateTime date); static Date toDate(LocalDate ldate); static Date toDate(Ca...
@Test public void testParseList() { String entry = "/3/0/13\n/3/0/18\n/3/0/21"; List<String> list = TranslationUtils.parseList(entry, "\n"); assertNotNull(list); assertEquals(3, list.size()); assertEquals("/3/0/13", list.get(0)); assertEquals("/3/0/18", list.get(1)); assertEquals("/3/0/21", list.get(2)); entry = "/3/0/...
DaoFactory implements Cloneable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DaoFactory)) { return false; } final DaoFactory other = (DaoFactory) obj; if (!other.canEqual(this)) { return false; } if (context == null) { if (othe...
@SuppressWarnings("resource") @Test public void testEquals() { try { DaoFactory daofactory1 = new DaoFactory((DaoFactory) null); DaoFactory daofactory2 = new DaoFactory((DaoFactory) null); assertNotNull(daofactory1); assertNotNull(daofactory2); assertNotSame(daofactory2, daofactory1); assertEquals(daofactory2, daofacto...
FirmwareManifestListOptions extends ListOptions { @Override public FirmwareManifestListOptions clone() { final FirmwareManifestListOptions opt = new FirmwareManifestListOptions(); opt.setOptions(this); return opt; } @Internal FirmwareManifestListOptions(Integer pageSize, Long maxResults, Order order, String after, ...
@SuppressWarnings("resource") @Test public void testClone() { try { FirmwareManifestListOptions firmwaremanifestlistoptions1 = new FirmwareManifestListOptions(Integer.valueOf(-74), Long.valueOf(-24), Order.getDefault(), "b8625a0a-a54f-44d3-a48d-942e761f8050", null, null); FirmwareManifestListOptions firmwaremanifestlis...
FirmwareManifestListOptions extends ListOptions { @Override @SuppressWarnings("PMD.UselessOverridingMethod") public int hashCode() { return super.hashCode(); } @Internal FirmwareManifestListOptions(Integer pageSize, Long maxResults, Order order, String after, List<IncludeField> i...
@SuppressWarnings("resource") @Test public void testHashCode() { try { FirmwareManifestListOptions firmwaremanifestlistoptions1 = new FirmwareManifestListOptions(Integer.valueOf(106), Long.valueOf(-90), Order.getDefault(), "38790e53-f34b-4b2b-a442-5d23345760d1", null, null); FirmwareManifestListOptions firmwaremanifest...
FirmwareManifestListOptions extends ListOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!super.equals(obj)) { return false; } if (!(obj instanceof FirmwareManifestListOptions)) { return false; } final FirmwareManifestListOptions other = (F...
@SuppressWarnings("resource") @Test public void testEquals() { try { FirmwareManifestListOptions firmwaremanifestlistoptions1 = new FirmwareManifestListOptions(Integer.valueOf(-3), Long.valueOf(-39), Order.getDefault(), "ede6f275-5690-47ed-bc3e-0a4b9f11e89d", null, null); FirmwareManifestListOptions firmwaremanifestlis...
CampaignStatisticsListDao extends AbstractCampaignStatisticsListDao { @Override @SuppressWarnings({ "resource", "unused" }) public CampaignStatisticsListDao clone() { try { return new CampaignStatisticsListDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCloudException...
@SuppressWarnings("resource") @Test public void testClone() { try { CampaignStatisticsListDao campaignstatisticslistdao1 = new CampaignStatisticsListDao(); CampaignStatisticsListDao campaignstatisticslistdao2 = campaignstatisticslistdao1.clone(); assertNotNull(campaignstatisticslistdao1); assertNotNull(campaignstatisti...
CampaignStatisticsEventsListOptions extends ListOptions { @Override public CampaignStatisticsEventsListOptions clone() { final CampaignStatisticsEventsListOptions opt = new CampaignStatisticsEventsListOptions(); opt.setOptions(this); return opt; } @Internal CampaignStatisticsEventsListOptions(Integer pageSize, Long ma...
@SuppressWarnings("resource") @Test public void testClone() { try { CampaignStatisticsEventsListOptions campaignstatisticseventslistoptions1 = new CampaignStatisticsEventsListOptions(Integer.valueOf(-53), Long.valueOf(97), Order.getDefault(), "f8fa8bcc-2d09-4124-ae73-377122cd2fd1", null, null); CampaignStatisticsEvents...
CampaignStatisticsEventsListOptions extends ListOptions { @Override @SuppressWarnings("PMD.UselessOverridingMethod") public int hashCode() { return super.hashCode(); } @Internal CampaignStatisticsEventsListOptions(Integer pageSize, Long maxResults, Order order, String after, ...
@SuppressWarnings("resource") @Test public void testHashCode() { try { CampaignStatisticsEventsListOptions campaignstatisticseventslistoptions1 = new CampaignStatisticsEventsListOptions(Integer.valueOf(61), Long.valueOf(79), Order.getDefault(), "507e63f2-15b2-43cf-ace6-e0fc282f7bb4", null, null); CampaignStatisticsEven...
CampaignStatisticsEventsListOptions extends ListOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!super.equals(obj)) { return false; } if (!(obj instanceof CampaignStatisticsEventsListOptions)) { return false; } final CampaignStatisticsEven...
@SuppressWarnings("resource") @Test public void testEquals() { try { CampaignStatisticsEventsListOptions campaignstatisticseventslistoptions1 = new CampaignStatisticsEventsListOptions(Integer.valueOf(-16), Long.valueOf(48), Order.getDefault(), "06333ed0-196d-4767-a246-2744298821b6", null, null); CampaignStatisticsEvent...
FirmwareManifestListDao extends AbstractModelListDao<FirmwareManifest, FirmwareManifestListOptions> implements ModelListDao<FirmwareManifest, FirmwareManifestListOptions> { @Override @SuppressWarnings({ "resource", "unused" }) public FirmwareManifestListDao clone() { try { return new FirmwareManifestListDao().configure...
@SuppressWarnings("resource") @Test public void testClone() { try { FirmwareManifestListDao firmwaremanifestlistdao1 = new FirmwareManifestListDao(); FirmwareManifestListDao firmwaremanifestlistdao2 = firmwaremanifestlistdao1.clone(); assertNotNull(firmwaremanifestlistdao1); assertNotNull(firmwaremanifestlistdao2); ass...
CampaignStatisticsListOptions extends ListOptions { @Override public CampaignStatisticsListOptions clone() { final CampaignStatisticsListOptions opt = new CampaignStatisticsListOptions(); opt.setOptions(this); return opt; } @Internal CampaignStatisticsListOptions(Integer pageSize, Long maxResults, Order order, String ...
@SuppressWarnings("resource") @Test public void testClone() { try { CampaignStatisticsListOptions campaignstatisticslistoptions1 = new CampaignStatisticsListOptions(Integer.valueOf(122), Long.valueOf(-105), Order.getDefault(), "730ed9c6-df36-4ddb-8fdd-375d63faaf3c", null, null); CampaignStatisticsListOptions campaignst...
GenericAdapter { public static <T extends SdkModel, U> ListResponse<T> mapList(RespList<U> respList, Mapper<U, T> mapper) { if (respList == null || mapper == null) { return null; } final ListResponse<T> responseList = new ListResponse<>(TranslationUtils.toBool(respList.getHasMore(), false), TranslationUtils.toLong(resp...
@Test public void testMapListListOfUMapperOfUT() { List<String> list = new LinkedList<>(); list.add("1"); list.add(" 2 "); list.add(" 3"); list.add("4 "); list.add("5"); List<Integer> mappedList = GenericAdapter.mapList(list, new Mapper<String, Integer>() { @SuppressWarnings("boxing") @Override public Integer map(Strin...
CampaignStatisticsListOptions extends ListOptions { @Override @SuppressWarnings("PMD.UselessOverridingMethod") public int hashCode() { return super.hashCode(); } @Internal CampaignStatisticsListOptions(Integer pageSize, Long maxResults, Order order, String after, List<IncludeFi...
@SuppressWarnings("resource") @Test public void testHashCode() { try { CampaignStatisticsListOptions campaignstatisticslistoptions1 = new CampaignStatisticsListOptions(Integer.valueOf(-96), Long.valueOf(-7), Order.getDefault(), "0a022aa8-ba0e-410c-8627-e24fdfb11785", null, null); CampaignStatisticsListOptions campaigns...
CampaignStatisticsListOptions extends ListOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!super.equals(obj)) { return false; } if (!(obj instanceof CampaignStatisticsListOptions)) { return false; } final CampaignStatisticsListOptions othe...
@SuppressWarnings("resource") @Test public void testEquals() { try { CampaignStatisticsListOptions campaignstatisticslistoptions1 = new CampaignStatisticsListOptions(Integer.valueOf(4), Long.valueOf(-58), Order.getDefault(), "239ee3c7-1bd3-43a7-bfaa-0ce129625710", null, null); CampaignStatisticsListOptions campaignstat...
FirmwareManifestDao extends AbstractFirmwareManifestDao { @Override @SuppressWarnings({ "resource", "unused" }) public FirmwareManifestDao clone() { try { return new FirmwareManifestDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCloudException exception) { return nul...
@SuppressWarnings("resource") @Test public void testClone() { try { FirmwareManifestDao firmwaremanifestdao1 = new FirmwareManifestDao(); FirmwareManifestDao firmwaremanifestdao2 = firmwaremanifestdao1.clone(); assertNotNull(firmwaremanifestdao1); assertNotNull(firmwaremanifestdao2); assertNotSame(firmwaremanifestdao2,...
FirmwareImageDao extends AbstractFirmwareImageDao { @Override @SuppressWarnings({ "resource", "unused" }) public FirmwareImageDao clone() { try { return new FirmwareImageDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCloudException exception) { return null; } } Firmw...
@SuppressWarnings("resource") @Test public void testClone() { try { FirmwareImageDao firmwareimagedao1 = new FirmwareImageDao(); FirmwareImageDao firmwareimagedao2 = firmwareimagedao1.clone(); assertNotNull(firmwareimagedao1); assertNotNull(firmwareimagedao2); assertNotSame(firmwareimagedao2, firmwareimagedao1); assert...
UpdateCampaignDao extends AbstractModelDao<UpdateCampaign> implements CrudDao<UpdateCampaign> { @Override @SuppressWarnings({ "resource", "unused" }) public UpdateCampaignDao clone() { try { return new UpdateCampaignDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedClou...
@SuppressWarnings("resource") @Test public void testClone() { try { UpdateCampaignDao updatecampaigndao1 = new UpdateCampaignDao(); UpdateCampaignDao updatecampaigndao2 = updatecampaigndao1.clone(); assertNotNull(updatecampaigndao1); assertNotNull(updatecampaigndao2); assertNotSame(updatecampaigndao2, updatecampaigndao...
CampaignDeviceMetadataDao extends AbstractCampaignDeviceMetadataDao { @Override @SuppressWarnings({ "resource", "unused" }) public CampaignDeviceMetadataDao clone() { try { return new CampaignDeviceMetadataDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCloudException...
@SuppressWarnings("resource") @Test public void testClone() { try { CampaignDeviceMetadataDao campaigndevicemetadatadao1 = new CampaignDeviceMetadataDao(); CampaignDeviceMetadataDao campaigndevicemetadatadao2 = campaigndevicemetadatadao1.clone(); assertNotNull(campaigndevicemetadatadao1); assertNotNull(campaigndeviceme...
UpdateCampaignListDao extends AbstractModelListDao<UpdateCampaign, UpdateCampaignListOptions> implements ModelListDao<UpdateCampaign, UpdateCampaignListOptions> { @Override @SuppressWarnings({ "resource", "unused" }) public UpdateCampaignListDao clone() { try { return new UpdateCampaignListDao().configureAndGet(getModu...
@SuppressWarnings("resource") @Test public void testClone() { try { UpdateCampaignListDao updatecampaignlistdao1 = new UpdateCampaignListDao(); UpdateCampaignListDao updatecampaignlistdao2 = updatecampaignlistdao1.clone(); assertNotNull(updatecampaignlistdao1); assertNotNull(updatecampaignlistdao2); assertNotSame(updat...
CampaignDeviceMetadataListOptions extends ListOptions { @Override public CampaignDeviceMetadataListOptions clone() { final CampaignDeviceMetadataListOptions opt = new CampaignDeviceMetadataListOptions(); opt.setOptions(this); return opt; } @Internal CampaignDeviceMetadataListOptions(Integer pageSize, Long maxResults, ...
@SuppressWarnings("resource") @Test public void testClone() { try { CampaignDeviceMetadataListOptions campaigndevicemetadatalistoptions1 = new CampaignDeviceMetadataListOptions(Integer.valueOf(6), Long.valueOf(-75), Order.getDefault(), "368dc750-be6f-4fb3-8071-0514c104212f", null, null); CampaignDeviceMetadataListOptio...
CampaignDeviceMetadataListOptions extends ListOptions { @Override @SuppressWarnings("PMD.UselessOverridingMethod") public int hashCode() { return super.hashCode(); } @Internal CampaignDeviceMetadataListOptions(Integer pageSize, Long maxResults, Order order, String after, Li...
@SuppressWarnings("resource") @Test public void testHashCode() { try { CampaignDeviceMetadataListOptions campaigndevicemetadatalistoptions1 = new CampaignDeviceMetadataListOptions(Integer.valueOf(-123), Long.valueOf(80), Order.getDefault(), "25b31173-1954-4f3a-a534-23d22d210563", null, null); CampaignDeviceMetadataList...
CampaignDeviceMetadataListOptions extends ListOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!super.equals(obj)) { return false; } if (!(obj instanceof CampaignDeviceMetadataListOptions)) { return false; } final CampaignDeviceMetadataList...
@SuppressWarnings("resource") @Test public void testEquals() { try { CampaignDeviceMetadataListOptions campaigndevicemetadatalistoptions1 = new CampaignDeviceMetadataListOptions(Integer.valueOf(-17), Long.valueOf(-43), Order.getDefault(), "a13c3a90-59f7-48e1-bfde-2ec9badf975a", null, null); CampaignDeviceMetadataListOp...
CampaignStatisticsDao extends AbstractCampaignStatisticsDao { @Override @SuppressWarnings({ "resource", "unused" }) public CampaignStatisticsDao clone() { try { return new CampaignStatisticsDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCloudException exception) { re...
@SuppressWarnings("resource") @Test public void testClone() { try { CampaignStatisticsDao campaignstatisticsdao1 = new CampaignStatisticsDao(); CampaignStatisticsDao campaignstatisticsdao2 = campaignstatisticsdao1.clone(); assertNotNull(campaignstatisticsdao1); assertNotNull(campaignstatisticsdao2); assertNotSame(campa...
FirmwareImageListOptions extends ListOptions { @Override public FirmwareImageListOptions clone() { final FirmwareImageListOptions opt = new FirmwareImageListOptions(); opt.setOptions(this); return opt; } @Internal FirmwareImageListOptions(Integer pageSize, Long maxResults, Order order, String after, ...
@SuppressWarnings("resource") @Test public void testClone() { try { FirmwareImageListOptions firmwareimagelistoptions1 = new FirmwareImageListOptions(Integer.valueOf(62), Long.valueOf(-108), Order.getDefault(), "fe5ae079-64ba-4cd4-a2a3-25dae54320b4", null, null); FirmwareImageListOptions firmwareimagelistoptions2 = fir...
FirmwareImageListOptions extends ListOptions { @Override @SuppressWarnings("PMD.UselessOverridingMethod") public int hashCode() { return super.hashCode(); } @Internal FirmwareImageListOptions(Integer pageSize, Long maxResults, Order order, String after, List<IncludeField> include, F...
@SuppressWarnings("resource") @Test public void testHashCode() { try { FirmwareImageListOptions firmwareimagelistoptions1 = new FirmwareImageListOptions(Integer.valueOf(-22), Long.valueOf(84), Order.getDefault(), "b9b2b3df-e5c9-4c2b-a08b-95376a571406", null, null); FirmwareImageListOptions firmwareimagelistoptions2 = n...
FirmwareImageListOptions extends ListOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!super.equals(obj)) { return false; } if (!(obj instanceof FirmwareImageListOptions)) { return false; } final FirmwareImageListOptions other = (FirmwareIm...
@SuppressWarnings("resource") @Test public void testEquals() { try { FirmwareImageListOptions firmwareimagelistoptions1 = new FirmwareImageListOptions(Integer.valueOf(100), Long.valueOf(6), Order.getDefault(), "c75ea4e8-eaf2-4c5f-b106-aa7a74717d0d", null, null); FirmwareImageListOptions firmwareimagelistoptions2 = new ...
UpdateCampaignListOptions extends ListOptions { @Override public UpdateCampaignListOptions clone() { final UpdateCampaignListOptions opt = new UpdateCampaignListOptions(); opt.setOptions(this); return opt; } @Internal UpdateCampaignListOptions(Integer pageSize, Long maxResults, Order order, String after, ...
@SuppressWarnings("resource") @Test public void testClone() { try { UpdateCampaignListOptions updatecampaignlistoptions1 = new UpdateCampaignListOptions(Integer.valueOf(21), Long.valueOf(125), Order.getDefault(), "eb2bed7f-9586-41a6-90f4-7733c29fe0e5", null, null); UpdateCampaignListOptions updatecampaignlistoptions2 =...
UpdateCampaignListOptions extends ListOptions { @Override @SuppressWarnings("PMD.UselessOverridingMethod") public int hashCode() { return super.hashCode(); } @Internal UpdateCampaignListOptions(Integer pageSize, Long maxResults, Order order, String after, List<IncludeField> include...
@SuppressWarnings("resource") @Test public void testHashCode() { try { UpdateCampaignListOptions updatecampaignlistoptions1 = new UpdateCampaignListOptions(Integer.valueOf(47), Long.valueOf(-96), Order.getDefault(), "5298899b-2ce2-4b86-8f59-c99d20b5f99e", null, null); UpdateCampaignListOptions updatecampaignlistoptions...
UpdateCampaignListOptions extends ListOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!super.equals(obj)) { return false; } if (!(obj instanceof UpdateCampaignListOptions)) { return false; } final UpdateCampaignListOptions other = (UpdateC...
@SuppressWarnings("resource") @Test public void testEquals() { try { UpdateCampaignListOptions updatecampaignlistoptions1 = new UpdateCampaignListOptions(Integer.valueOf(-86), Long.valueOf(-45), Order.getDefault(), "e0acb5d5-47c4-481c-a578-9d23bb3603df", null, null); UpdateCampaignListOptions updatecampaignlistoptions2...
FirmwareImageListDao extends AbstractModelListDao<FirmwareImage, FirmwareImageListOptions> implements ModelListDao<FirmwareImage, FirmwareImageListOptions> { @Override @SuppressWarnings({ "resource", "unused" }) public FirmwareImageListDao clone() { try { return new FirmwareImageListDao().configureAndGet(getModuleOrThr...
@SuppressWarnings("resource") @Test public void testClone() { try { FirmwareImageListDao firmwareimagelistdao1 = new FirmwareImageListDao(); FirmwareImageListDao firmwareimagelistdao2 = firmwareimagelistdao1.clone(); assertNotNull(firmwareimagelistdao1); assertNotNull(firmwareimagelistdao2); assertNotSame(firmwareimage...
CampaignStatisticsEventsDao extends AbstractCampaignStatisticsEventsDao { @Override @SuppressWarnings({ "resource", "unused" }) public CampaignStatisticsEventsDao clone() { try { return new CampaignStatisticsEventsDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCloudE...
@SuppressWarnings("resource") @Test public void testClone() { try { CampaignStatisticsEventsDao campaignstatisticseventsdao1 = new CampaignStatisticsEventsDao(); CampaignStatisticsEventsDao campaignstatisticseventsdao2 = campaignstatisticseventsdao1.clone(); assertNotNull(campaignstatisticseventsdao1); assertNotNull(ca...
DeviceEventsDao extends AbstractModelDao<DeviceEvents> implements ReadDao<DeviceEvents> { @Override @SuppressWarnings({ "resource", "unused" }) public DeviceEventsDao clone() { try { return new DeviceEventsDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCloudException...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceEventsDao deviceeventsdao1 = new DeviceEventsDao(); DeviceEventsDao deviceeventsdao2 = deviceeventsdao1.clone(); assertNotNull(deviceeventsdao1); assertNotNull(deviceeventsdao2); assertNotSame(deviceeventsdao2, deviceeventsdao1); assertEquals(dev...
ApiUtils { public static void checkNotNull(SdkLogger logger, Object arg, String argName) throws MbedCloudException { if (arg == null && logger != null) { logger.throwSdkException(new IllegalArgumentException("Argument [" + argName + "] cannot be Null")); } } private ApiUtils(); static void checkNotNull(SdkLogger logge...
@SuppressWarnings("boxing") @Test public final void testCheckNotNull() { Integer test = null; SdkLogger logger = new SdkLogger(); try { ApiUtils.checkNotNull(logger, test, "test"); fail("Check has not worked"); } catch (MbedCloudException e) { assertTrue(true); assertTrue(ApiUtils.isCloudException(e)); assertTrue(ApiUt...
DeviceListOptions extends ListOptions { @Override public DeviceListOptions clone() { final DeviceListOptions opt = new DeviceListOptions(); opt.setOptions(this); return opt; } @Internal DeviceListOptions(Integer pageSize, Long maxResults, Order order, String after, List<IncludeField> include, ...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceListOptions devicelistoptions1 = new DeviceListOptions(Integer.valueOf(-17), Long.valueOf(108), Order.getDefault(), "946898d8-69ea-4ca1-88a0-5aa786dcbc91", null, null); DeviceListOptions devicelistoptions2 = devicelistoptions1.clone(); assertNotN...
DeviceListOptions extends ListOptions { @Override @SuppressWarnings("PMD.UselessOverridingMethod") public int hashCode() { return super.hashCode(); } @Internal DeviceListOptions(Integer pageSize, Long maxResults, Order order, String after, List<IncludeField> include, Filters filter); @Inte...
@SuppressWarnings("resource") @Test public void testHashCode() { try { DeviceListOptions devicelistoptions1 = new DeviceListOptions(Integer.valueOf(84), Long.valueOf(21), Order.getDefault(), "1186c83b-3cee-404c-bef3-091e3c0e6084", null, null); DeviceListOptions devicelistoptions2 = new DeviceListOptions(Integer.valueOf...
DeviceListOptions extends ListOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!super.equals(obj)) { return false; } if (!(obj instanceof DeviceListOptions)) { return false; } final DeviceListOptions other = (DeviceListOptions) obj; if (!ot...
@SuppressWarnings("resource") @Test public void testEquals() { try { DeviceListOptions devicelistoptions1 = new DeviceListOptions(Integer.valueOf(-27), Long.valueOf(20), Order.getDefault(), "706ec840-79d9-4fe4-9b4d-4b133b4212c4", null, null); DeviceListOptions devicelistoptions2 = new DeviceListOptions(Integer.valueOf(...
DeviceListDao extends AbstractModelListDao<Device, DeviceListOptions> implements ModelListDao<Device, DeviceListOptions> { @Override @SuppressWarnings({ "resource", "unused" }) public DeviceListDao clone() { try { return new DeviceListDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone())...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceListDao devicelistdao1 = new DeviceListDao(); DeviceListDao devicelistdao2 = devicelistdao1.clone(); assertNotNull(devicelistdao1); assertNotNull(devicelistdao2); assertNotSame(devicelistdao2, devicelistdao1); assertEquals(devicelistdao2, devicel...
DeviceEnrollmentListDao extends AbstractModelListDao<DeviceEnrollment, DeviceEnrollmentListOptions> implements ModelListDao<DeviceEnrollment, DeviceEnrollmentListOptions> { @Override @SuppressWarnings({ "resource", "unused" }) public DeviceEnrollmentListDao clone() { try { return new DeviceEnrollmentListDao().configure...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceEnrollmentListDao deviceenrollmentlistdao1 = new DeviceEnrollmentListDao(); DeviceEnrollmentListDao deviceenrollmentlistdao2 = deviceenrollmentlistdao1.clone(); assertNotNull(deviceenrollmentlistdao1); assertNotNull(deviceenrollmentlistdao2); ass...
DeviceEventsListOptions extends ListOptions { @Override public DeviceEventsListOptions clone() { final DeviceEventsListOptions opt = new DeviceEventsListOptions(); opt.setOptions(this); return opt; } @Internal DeviceEventsListOptions(Integer pageSize, Long maxResults, Order order, String after, ...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceEventsListOptions deviceeventslistoptions1 = new DeviceEventsListOptions(Integer.valueOf(-40), Long.valueOf(-89), Order.getDefault(), "9896a128-6a0a-4954-9794-bf46f8747326", null, null); DeviceEventsListOptions deviceeventslistoptions2 = deviceev...
DeviceEventsListOptions extends ListOptions { @Override @SuppressWarnings("PMD.UselessOverridingMethod") public int hashCode() { return super.hashCode(); } @Internal DeviceEventsListOptions(Integer pageSize, Long maxResults, Order order, String after, List<IncludeField> include, Filt...
@SuppressWarnings("resource") @Test public void testHashCode() { try { DeviceEventsListOptions deviceeventslistoptions1 = new DeviceEventsListOptions(Integer.valueOf(82), Long.valueOf(57), Order.getDefault(), "ad745755-6673-40cd-82a2-4b9abc62f304", null, null); DeviceEventsListOptions deviceeventslistoptions2 = new Dev...
DeviceEventsListOptions extends ListOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!super.equals(obj)) { return false; } if (!(obj instanceof DeviceEventsListOptions)) { return false; } final DeviceEventsListOptions other = (DeviceEventsL...
@SuppressWarnings("resource") @Test public void testEquals() { try { DeviceEventsListOptions deviceeventslistoptions1 = new DeviceEventsListOptions(Integer.valueOf(-72), Long.valueOf(-43), Order.getDefault(), "8b0b1d3a-afda-4201-b302-76a23a98f7fe", null, null); DeviceEventsListOptions deviceeventslistoptions2 = new Dev...
DeviceEnrollmentBulkCreateDao extends AbstractDeviceEnrollmentBulkCreateDao { @SuppressWarnings("resource") @Override public DeviceEnrollmentBulkCreateDao clone() { try { return new DeviceEnrollmentBulkCreateDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (@SuppressWarning...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceEnrollmentBulkCreateDao deviceenrollmentbulkcreatedao1 = new DeviceEnrollmentBulkCreateDao(); DeviceEnrollmentBulkCreateDao deviceenrollmentbulkcreatedao2 = deviceenrollmentbulkcreatedao1.clone(); assertNotNull(deviceenrollmentbulkcreatedao1); as...
DeviceEnrollmentDenialDao extends AbstractDeviceEnrollmentDenialDao { @Override @SuppressWarnings({ "resource", "unused" }) public DeviceEnrollmentDenialDao clone() { try { return new DeviceEnrollmentDenialDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCloudException...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceEnrollmentDenialDao deviceenrollmentdenialdao1 = new DeviceEnrollmentDenialDao(); DeviceEnrollmentDenialDao deviceenrollmentdenialdao2 = deviceenrollmentdenialdao1.clone(); assertNotNull(deviceenrollmentdenialdao1); assertNotNull(deviceenrollment...
ApiUtils { public static void checkModelValidity(SdkLogger logger, SdkModel model, String argName) throws MbedCloudException { final String errorMessage = SdkUtils.checkModelValidity(model, argName); if (errorMessage == null) { return; } logger.throwSdkException(new IllegalArgumentException(errorMessage)); } private A...
@SuppressWarnings("boxing") @Test public final void testCheckModelValidity() { SdkLogger logger = new SdkLogger(); ModelClass test = null; try { ApiUtils.checkModelValidity(logger, test, "test"); assertTrue(true); } catch (@SuppressWarnings("unused") MbedCloudException e) { fail("No exception should have been raised");...
DeviceGroupDao extends AbstractModelDao<DeviceGroup> implements CrudDao<DeviceGroup> { @Override @SuppressWarnings({ "resource", "unused" }) public DeviceGroupDao clone() { try { return new DeviceGroupDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCloudException exce...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceGroupDao devicegroupdao1 = new DeviceGroupDao(); DeviceGroupDao devicegroupdao2 = devicegroupdao1.clone(); assertNotNull(devicegroupdao1); assertNotNull(devicegroupdao2); assertNotSame(devicegroupdao2, devicegroupdao1); assertEquals(devicegroupda...
DeviceGroupListOptions extends ListOptions { @Override public DeviceGroupListOptions clone() { final DeviceGroupListOptions opt = new DeviceGroupListOptions(); opt.setOptions(this); return opt; } @Internal DeviceGroupListOptions(Integer pageSize, Long maxResults, Order order, String after, ...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceGroupListOptions devicegrouplistoptions1 = new DeviceGroupListOptions(Integer.valueOf(29), Long.valueOf(-50), Order.getDefault(), "3cf0757d-ce93-4c08-99fd-6fe2da04647b", null, null); DeviceGroupListOptions devicegrouplistoptions2 = devicegrouplis...
DeviceGroupListOptions extends ListOptions { @Override @SuppressWarnings("PMD.UselessOverridingMethod") public int hashCode() { return super.hashCode(); } @Internal DeviceGroupListOptions(Integer pageSize, Long maxResults, Order order, String after, List<IncludeField> include, Filters...
@SuppressWarnings("resource") @Test public void testHashCode() { try { DeviceGroupListOptions devicegrouplistoptions1 = new DeviceGroupListOptions(Integer.valueOf(43), Long.valueOf(-48), Order.getDefault(), "17ab952d-5e74-43d3-9051-8bf10cbf1b22", null, null); DeviceGroupListOptions devicegrouplistoptions2 = new DeviceG...
DeviceGroupListOptions extends ListOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!super.equals(obj)) { return false; } if (!(obj instanceof DeviceGroupListOptions)) { return false; } final DeviceGroupListOptions other = (DeviceGroupListO...
@SuppressWarnings("resource") @Test public void testEquals() { try { DeviceGroupListOptions devicegrouplistoptions1 = new DeviceGroupListOptions(Integer.valueOf(-24), Long.valueOf(-88), Order.getDefault(), "1c99a9f9-7700-4b37-8339-52717b44119c", null, null); DeviceGroupListOptions devicegrouplistoptions2 = new DeviceGr...
DeviceEnrollmentDenialListDao extends AbstractModelListDao<DeviceEnrollmentDenial, DeviceEnrollmentDenialListOptions> implements ModelListDao<DeviceEnrollmentDenial, Devi...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceEnrollmentDenialListDao deviceenrollmentdeniallistdao1 = new DeviceEnrollmentDenialListDao(); DeviceEnrollmentDenialListDao deviceenrollmentdeniallistdao2 = deviceenrollmentdeniallistdao1.clone(); assertNotNull(deviceenrollmentdeniallistdao1); as...
DeviceEnrollmentDao extends AbstractModelDao<DeviceEnrollment> implements CreateDao<DeviceEnrollment>, DeleteDao<DeviceEnrollment>, ReadDao<DeviceEnrollment> { @Override @SuppressWarnings({ "resource", "unused" }) public DeviceEnrollmentDao clone() { try { return new DeviceEnrollmentDao...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceEnrollmentDao deviceenrollmentdao1 = new DeviceEnrollmentDao(); DeviceEnrollmentDao deviceenrollmentdao2 = deviceenrollmentdao1.clone(); assertNotNull(deviceenrollmentdao1); assertNotNull(deviceenrollmentdao2); assertNotSame(deviceenrollmentdao2,...
DeviceEventsListDao extends AbstractModelListDao<DeviceEvents, DeviceEventsListOptions> implements ModelListDao<DeviceEvents, DeviceEventsListOptions> { @Override @SuppressWarnings({ "resource", "unused" }) public DeviceEventsListDao clone() { try { return new DeviceEventsListDao().configureAndGet(getModuleOrThrow() ==...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceEventsListDao deviceeventslistdao1 = new DeviceEventsListDao(); DeviceEventsListDao deviceeventslistdao2 = deviceeventslistdao1.clone(); assertNotNull(deviceeventslistdao1); assertNotNull(deviceeventslistdao2); assertNotSame(deviceeventslistdao2,...
DeviceEnrollmentDenialListOptions extends ListOptions { @Override public DeviceEnrollmentDenialListOptions clone() { final DeviceEnrollmentDenialListOptions opt = new DeviceEnrollmentDenialListOptions(); opt.setOptions(this); return opt; } @Internal DeviceEnrollmentDenialListOptions(Integer pageSize, Long maxResults, ...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceEnrollmentDenialListOptions deviceenrollmentdeniallistoptions1 = new DeviceEnrollmentDenialListOptions(Integer.valueOf(-109), Long.valueOf(-98), Order.getDefault(), "a3e205ca-b6b6-45b8-a778-8e6679c77be8", null, null); DeviceEnrollmentDenialListOp...
DeviceEnrollmentDenialListOptions extends ListOptions { @Override @SuppressWarnings("PMD.UselessOverridingMethod") public int hashCode() { return super.hashCode(); } @Internal DeviceEnrollmentDenialListOptions(Integer pageSize, Long maxResults, Order order, String after, Li...
@SuppressWarnings("resource") @Test public void testHashCode() { try { DeviceEnrollmentDenialListOptions deviceenrollmentdeniallistoptions1 = new DeviceEnrollmentDenialListOptions(Integer.valueOf(-112), Long.valueOf(35), Order.getDefault(), "2ab3e356-11f1-4fa5-966d-a4f68e2cc041", null, null); DeviceEnrollmentDenialList...
DeviceEnrollmentDenialListOptions extends ListOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!super.equals(obj)) { return false; } if (!(obj instanceof DeviceEnrollmentDenialListOptions)) { return false; } final DeviceEnrollmentDenialList...
@SuppressWarnings("resource") @Test public void testEquals() { try { DeviceEnrollmentDenialListOptions deviceenrollmentdeniallistoptions1 = new DeviceEnrollmentDenialListOptions(Integer.valueOf(-17), Long.valueOf(88), Order.getDefault(), "ee45108b-af62-408c-a753-8dbb4b592e5d", null, null); DeviceEnrollmentDenialListOpt...
ApiUtils { public static String convertSnakeToCamel(String stringToConvert, boolean capitalAtStart) { return SdkUtils.convertSnakeToCamel(stringToConvert, capitalAtStart); } private ApiUtils(); static void checkNotNull(SdkLogger logger, Object arg, String argName); static void checkModelValidity(SdkLogger logger, SdkM...
@Test public final void testConvertSnakeToCamel() { String testfunctionString = "this_is_a_function_name"; String testClassString = "this_is_a_class_name"; assertEquals("thisIsAFunctionName", ApiUtils.convertSnakeToCamel(testfunctionString, false)); assertEquals("ThisIsAClassName", ApiUtils.convertSnakeToCamel(testClas...
DeviceEnrollmentListOptions extends ListOptions { @Override public DeviceEnrollmentListOptions clone() { final DeviceEnrollmentListOptions opt = new DeviceEnrollmentListOptions(); opt.setOptions(this); return opt; } @Internal DeviceEnrollmentListOptions(Integer pageSize, Long maxResults, Order order, String after, ...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceEnrollmentListOptions deviceenrollmentlistoptions1 = new DeviceEnrollmentListOptions(Integer.valueOf(-101), Long.valueOf(126), Order.getDefault(), "ebb30e09-5650-4c47-b79c-4e0585db44ef", null, null); DeviceEnrollmentListOptions deviceenrollmentli...
DeviceEnrollmentListOptions extends ListOptions { @Override @SuppressWarnings("PMD.UselessOverridingMethod") public int hashCode() { return super.hashCode(); } @Internal DeviceEnrollmentListOptions(Integer pageSize, Long maxResults, Order order, String after, List<IncludeField> i...
@SuppressWarnings("resource") @Test public void testHashCode() { try { DeviceEnrollmentListOptions deviceenrollmentlistoptions1 = new DeviceEnrollmentListOptions(Integer.valueOf(62), Long.valueOf(-82), Order.getDefault(), "5a4aee78-89ab-46dd-aa20-2d301bf69576", null, null); DeviceEnrollmentListOptions deviceenrollmentl...
DeviceEnrollmentListOptions extends ListOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!super.equals(obj)) { return false; } if (!(obj instanceof DeviceEnrollmentListOptions)) { return false; } final DeviceEnrollmentListOptions other = (D...
@SuppressWarnings("resource") @Test public void testEquals() { try { DeviceEnrollmentListOptions deviceenrollmentlistoptions1 = new DeviceEnrollmentListOptions(Integer.valueOf(125), Long.valueOf(58), Order.getDefault(), "8722d407-24aa-440e-b6bf-ec0bcd746b5e", null, null); DeviceEnrollmentListOptions deviceenrollmentlis...
DeviceGroupListDao extends AbstractModelListDao<DeviceGroup, DeviceGroupListOptions> implements ModelListDao<DeviceGroup, DeviceGroupListOptions> { @Override @SuppressWarnings({ "resource", "unused" }) public DeviceGroupListDao clone() { try { return new DeviceGroupListDao().configureAndGet(getModuleOrThrow() == null ?...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceGroupListDao devicegrouplistdao1 = new DeviceGroupListDao(); DeviceGroupListDao devicegrouplistdao2 = devicegrouplistdao1.clone(); assertNotNull(devicegrouplistdao1); assertNotNull(devicegrouplistdao2); assertNotSame(devicegrouplistdao2, devicegr...
DeviceEnrollmentBulkDeleteDao extends AbstractDeviceEnrollmentBulkDeleteDao { @SuppressWarnings("resource") @Override public DeviceEnrollmentBulkDeleteDao clone() { try { return new DeviceEnrollmentBulkDeleteDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (@SuppressWarning...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceEnrollmentBulkDeleteDao deviceenrollmentbulkdeletedao1 = new DeviceEnrollmentBulkDeleteDao(); DeviceEnrollmentBulkDeleteDao deviceenrollmentbulkdeletedao2 = deviceenrollmentbulkdeletedao1.clone(); assertNotNull(deviceenrollmentbulkdeletedao1); as...
DeviceDao extends AbstractModelDao<Device> implements CrudDao<Device> { @Override @SuppressWarnings({ "resource", "unused" }) public DeviceDao clone() { try { return new DeviceDao().configureAndGet(getModuleOrThrow() == null ? null : getModuleOrThrow().clone()); } catch (MbedCloudException exception) { return null; } }...
@SuppressWarnings("resource") @Test public void testClone() { try { DeviceDao devicedao1 = new DeviceDao(); DeviceDao devicedao2 = devicedao1.clone(); assertNotNull(devicedao1); assertNotNull(devicedao2); assertNotSame(devicedao2, devicedao1); assertEquals(devicedao2, devicedao1); } catch (Exception exception) { fail(e...
TLVDecoder { public static List<?> decodeTlv(ByteBuffer buffer) throws DecodingException { if (buffer == null) { return null; } buffer.order(ByteOrder.BIG_ENDIAN); int position = buffer.position(); int limit = buffer.limit(); TILFields typeField = decodeTypeField(buffer); buffer.position(position); buffer.limit(limit);...
@Test public final void testSingleResourceTLVDecode() { byte[] response = { (byte) 0xC8, (byte) 0x00, (byte) 0x14, (byte) 0x4F, (byte) 0x70, (byte) 0x65, (byte) 0x6E, (byte) 0x20, (byte) 0x4D, (byte) 0x6F, (byte) 0x62, (byte) 0x69, (byte) 0x6C, (byte) 0x65, (byte) 0x20, (byte) 0x41, (byte) 0x6C, (byte) 0x6C, (byte) 0x6...
ApiUtils { public static String convertCamelToSnake(String stringToConvert) { return SdkUtils.convertCamelToSnake(stringToConvert); } private ApiUtils(); static void checkNotNull(SdkLogger logger, Object arg, String argName); static void checkModelValidity(SdkLogger logger, SdkModel model, String argName); static bool...
@Test public final void testConvertCamelToSnake() { String testfunctionString = "thisIsAFunctionName"; String testClassString = "ThisIsAClassName"; String testMalformedFunctionString = "Device_Event_retrieve"; assertEquals("this_is_a_function_name", ApiUtils.convertCamelToSnake(testfunctionString)); assertEquals("this_...
Base64Decoder { public static String decodeToUTF8(ByteBuffer input) { if (input == null) { return null; } return new String(decode(input).array(), StandardCharsets.UTF_8); } Base64Decoder(); static List<?> decodeBase64Lwm2m(ByteBuffer buffer, EncodingType contentType); static List<T> decodeBase64Lwm2m(ByteBuffer buffer...
@Test public void testDecodeString() { assertEquals("This is a test for decoding base64 encoded strings", Base64Decoder.decodeToUtf8("VGhpcyBpcyBhIHRlc3QgZm9yIGRlY29kaW5nIGJhc2U2NCBlbmNvZGVkIHN0cmluZ3M=")); }
SdkUtils { public static List<String> parseListString(String listString) { if (listString == null) { return null; } if (listString.isEmpty()) { return new ArrayList<>(); } final Matcher matcher = JSON_ARRAY_PATTERN.matcher(listString); String[] array = null; if (matcher.matches()) { final String aliasArray = matcher.gr...
@Test public void testParseListString() { assertNull(SdkUtils.parseListString(null)); assertArrayEquals(new ArrayList<>().toArray(), SdkUtils.parseListString("").toArray()); final List<String> list = Arrays.asList("1", "2", "3", "4"); final String csv = SdkUtils.joinList(list, ","); final String jsonArray = "[\"1\",\"2...
SdkUtils { public static String joinList(List<?> list, String separator) { if (list == null || list.isEmpty()) { return null; } final StringBuilder buffer = new StringBuilder(); boolean start = true; for (final Object element : list) { if (!start) { buffer.append(separator); } buffer.append(toSting(element)); start = f...
@Test public void testJoinList() { assertNull(SdkUtils.joinList(null, "")); assertNull(SdkUtils.joinList(new ArrayList<>(), "")); final List<String> list = Arrays.asList("1", "2", "3", "4"); final String separator = "+-/+_$£&^%!()(&^"; assertEquals(String.join(separator, list), SdkUtils.joinList(list, separator)); fina...
SdkUtils { public static boolean urlEquals(URL url1, URL url2) { if (url1 == null && url2 == null) { return true; } if (url1 == null || url2 == null) { return false; } if (url1.toString() == null) { return url2.toString() == null; } return url1.toString().equals(url2.toString()); } private SdkUtils(); static List<Stri...
@Test public void testUrlEquals() { try { assertTrue(SdkUtils.urlEquals(null, null)); URL url = new URL("http: assertFalse(SdkUtils.urlEquals(null, url)); assertFalse(SdkUtils.urlEquals(url, null)); assertTrue(SdkUtils.urlEquals(url, url)); assertTrue(SdkUtils.urlEquals(url, new URL("http: assertTrue(SdkUtils.urlEquals...
SdkUtils { public static String toHex(byte[] value) { if (value == null) { return null; } return Hex.encodeHexString(value); } private SdkUtils(); static List<String> parseListString(String listString); static String joinList(List<?> list, String separator); static boolean urlEquals(URL url1, URL url2); static int url...
@Test public void testHexArray() { assertNull(SdkUtils.toHex(null)); byte[] value = { (byte) 255, (byte) 255 }; assertEquals("ffff", SdkUtils.toHex(value)); }
SdkUtils { public static String convertSnakeToCamel(String stringToConvert, boolean capitalAtStart) { if (stringToConvert == null || stringToConvert.isEmpty()) { return stringToConvert; } final StringBuffer sb = new StringBuffer(); boolean start = true; final String[] stringElements = stringToConvert.replace(DOUBLE_UND...
@Test public final void testConvertSnakeToCamel() { String testfunctionString = "this_is_a_function_name"; String testClassString = "this_is_a_class_name"; assertEquals("thisIsAFunctionName", SdkUtils.convertSnakeToCamel(testfunctionString, false)); assertEquals("ThisIsAClassName", SdkUtils.convertSnakeToCamel(testClas...
SdkUtils { public static String convertCamelToSnake(String stringToConvert) { if (stringToConvert == null || stringToConvert.isEmpty()) { return stringToConvert; } return stringToConvert.trim().replaceAll("(.)(\\p{Upper})", "$1_$2") .replaceAll("(\\p{Upper})(\\p{Upper})", "$1_$2").replace(WHITE_SPACE, UNDERSCORE) .repl...
@Test public final void testConvertCamelToSnake() { String testfunctionString = "thisIsAFunctionName"; String testClassString = "ThisIsAClassName"; String testMalformedFunctionString = "Device_Event_retrieve"; assertEquals("this_is_a_function_name", SdkUtils.convertCamelToSnake(testfunctionString)); assertEquals("this_...
SdkUtils { public static CaseConverter getCaseConverter(CaseConversion conversion) { CaseConverter converter = null; switch (conversion) { case CAMEL_TO_SNAKE: converter = new CaseConverter() { @Override public String convert(String strToConvert, boolean capitalAtStart) { return convertCamelToSnake(strToConvert); } }; ...
@Test public final void testGetCaseConverter() { String testfunctionString = "thisIsAFunctionName"; String testClassString = "ThisIsAClassName"; String tempText = SdkUtils.getCaseConverter(CaseConversion.CAMEL_TO_SNAKE).convert(testfunctionString, false); assertNotNull(tempText); assertNotEquals(testfunctionString, tem...
SdkUtils { public static String describeRequiredFields(SdkModel model) { return generateModelInstanceRequiredFieldsMessage(model, listRequiredFields(model), "model", model == null ? SdkModel.class.getSimpleName() : model.getClass().getSimpleName()).toString(); } private SdkUtils(); static List<String> parseListString(...
@Test public final void testRequiredFieldMessage() { ModelTestClass model = new ModelTestClass(); String message = SdkUtils.describeRequiredFields(model); assertNotNull(message); assertTrue(message.contains("fieldRequired")); assertTrue(message.contains("setFieldRequired")); assertFalse(message.contains("fieldNotRequir...
ApiUtils { public static String normalisePath(String path) { if (path != null && !path.isEmpty() && path.charAt(0) == '/') { return path.substring(1); } return path; } private ApiUtils(); static void checkNotNull(SdkLogger logger, Object arg, String argName); static void checkModelValidity(SdkLogger logger, SdkModel m...
@Test public final void testNormalisePath() { assertNull(ApiUtils.normalisePath(null)); assertTrue(ApiUtils.normalisePath("").isEmpty()); assertTrue(ApiUtils.normalisePath("/").isEmpty()); String path = "test/path"; assertEquals(path, ApiUtils.normalisePath(path)); String path2 = "/" + path; assertEquals(path, ApiUtils...
SdkUtils { public static String checkModelValidity(SdkModel model, String argName) { if (model == null) { return null; } if (model.isValid()) { return null; } final List<Field> missingFields = determineMissingFields(model); final StringBuilder errorBuilder = missingFields.isEmpty() ? SdkUtils.generateInvalidModelInstan...
@Test public final void testCheckModelValidity() { ModelTestClass model = new ModelTestClass(); String message = SdkUtils.checkModelValidity(model, "some model"); assertNotNull(message); assertTrue(message.contains("fieldRequired")); assertTrue(message.contains("setFieldRequired")); assertFalse(message.contains("fieldN...
SdkUtils { public static String getFileExtension(String fileName) { if (fileName == null || fileName.trim().endsWith(EXTENSION_SEPARATOR)) { return EMPTY_STRING; } final int i = fileName.lastIndexOf('.'); if (i < 0) { return EMPTY_STRING; } final StringBuilder builder = new StringBuilder(); final String shorterFilename...
@Test public void testGetFileExtension() { String filePath = "201806-0157528bb84102420a01321400000000-activedevices.098052628912094123.gz"; assertEquals("gz", SdkUtils.getFileExtension(filePath)); assertTrue(SdkUtils.hasExtension(filePath)); filePath = "C:\\Users\\adrcab01\\AppData\\Local\\Temp\\201806-0157528bb8410242...
SdkUtils { public static String getFileNameWithoutExtension(String fileName) { if (fileName == null) { return EMPTY_STRING; } return fileName.trim().replace(EXTENSION_SEPARATOR + getFileExtension(fileName), EMPTY_STRING); } private SdkUtils(); static List<String> parseListString(String listString); static String joinL...
@Test public void testGetFileNameWithoutExtension() { String filePath = "201806-0157528bb84102420a01321400000000-activedevices.098052628912094123.gz"; assertEquals("201806-0157528bb84102420a01321400000000-activedevices.098052628912094123", SdkUtils.getFileNameWithoutExtension(filePath)); filePath = "201806-0157528bb841...
Error implements SdkModel { @Override public Error clone() { return new Error(object, code, type, message, requestId, fields); } Error(); Error(int code, String type, String message, String requestId); Error(String object, int code, String type, String message, String requestId, List<Field> fields); String getObject(...
@Test public void testClone() { Error error = new Error(205, "some type", "some message", "requestId_10"); Error clone = error.clone(); assertNotSame(error, clone); assertEquals(error, clone); }
DataFile implements SdkModel { public String getContentType() { return contentType; } DataFile(); DataFile(String contentType, File file); DataFile(File file); DataFile(String filePath); @Override String getId(); @PerformsNoOperation @Internal @Override void setId(String id); String getContentType(); @Required void ...
@Test public void checkContentType() { DataFile file = new DataFile(new File("test.csv")); assertEquals(DataFile.CSV_FILE_MEDIA_TYPE, file.getContentType()); file = new DataFile(new File("test.txt")); assertEquals(DataFile.TEXT_FILE_MEDIA_TYPE, file.getContentType()); file = new DataFile(new File("test.png")); assertEq...
TimePeriod implements Cloneable, Serializable { @Override public String toString() { if (unit == null || duration == 0) { setTimePeriod(DEFAULT_DURATION, DEFAULT_UNIT); } final StringBuilder builder = new StringBuilder(); switch (unit) { case DAYS: toStringAsDays(builder); break; case HOURS: toStringAsHours(builder); b...
@Test public void testToString() { TimePeriod period = new TimePeriod(); assertEquals("1d", period.toString()); period.setDuration(3); period.setUnit(TimeUnit.MINUTES); assertEquals("3m", period.toString()); period.setDuration(100); period.setUnit(TimeUnit.HOURS); assertEquals("100h", period.toString()); period.setDura...
TimePeriod implements Cloneable, Serializable { public void fromString(String value) { setTimePeriod(DEFAULT_DURATION, DEFAULT_UNIT); if (value == null || value.isEmpty()) { return; } final Matcher matcher = STRING_PATTERN.matcher(value); if (matcher.matches()) { setTimePeriod(Long.parseLong(matcher.group(1)), getUnitF...
@Test public void testFromString() { TimePeriod period = new TimePeriod(); assertEquals("1d", period.toString()); period.fromString("3m"); assertEquals(TimeUnit.MINUTES, period.getUnit()); assertEquals(3, period.getDuration()); period = new TimePeriod("100h"); assertEquals(TimeUnit.HOURS, period.getUnit()); assertEqual...
TimePeriod implements Cloneable, Serializable { @Override public TimePeriod clone() { return new TimePeriod(unit, duration); } TimePeriod(TimeUnit unit, long duration); TimePeriod(long duration); TimePeriod(); TimePeriod(String value); static TimePeriod newTimePeriod(long duration); static TimePeriod newTimePeriod(S...
@Test public void testClone() { final TimePeriod p = new TimePeriod("1000n"); final TimePeriod clone = p.clone(); assertNotSame(p, clone); assertEquals(p, clone); assertEquals(TimeUnit.NANOSECONDS, clone.getUnit()); }
UuidGenerator { public static String generate() { return UUID.randomUUID().toString(); } private UuidGenerator(); static String generate(); }
@Test public void testGenerate() { final String uuid1 = UuidGenerator.generate(); final String uuid2 = UuidGenerator.generate(); assertNotNull(uuid1); assertNotNull(uuid2); assertFalse(uuid1.isEmpty()); assertFalse(uuid2.isEmpty()); assertNotEquals(uuid2, uuid1); }
Websocket implements SdkModel { @Override public Websocket clone() { return new Websocket(id, queueSize, status); } @Internal Websocket(String id, int queueSize, WebsocketStatus status); Websocket(); @Override String getId(); @Override void setId(String id); int getQueueSize(); WebsocketStatus getStatus(); @Override ...
@Test public void testClone() { Websocket model = new Websocket("anID", 100, WebsocketStatus.DISCONNECTED); Websocket clone = model.clone(); assertNotSame(model, clone); assertEquals(model, clone); }
ApiUtils { public static String normaliseResourcePath(String resourcePath) { if (resourcePath != null && (resourcePath.isEmpty() || resourcePath.charAt(0) != '/')) { return "/" + resourcePath; } return resourcePath; } private ApiUtils(); static void checkNotNull(SdkLogger logger, Object arg, String argName); static vo...
@Test public final void testNormaliseResourcePath() { assertNull(ApiUtils.normaliseResourcePath(null)); assertTrue(ApiUtils.normaliseResourcePath("").equals("/")); assertTrue(ApiUtils.normaliseResourcePath("/").equals("/")); String path = "test/path"; assertNotEquals(path, ApiUtils.normaliseResourcePath(path)); String ...
Presubscription implements SdkModel { @Override public Presubscription clone() { return new Presubscription(deviceId, deviceType, resourcePaths); } Presubscription(String deviceId, String deviceType, List<String> resourcePaths); Presubscription(Device device, List<String> resourcePaths); Presubscription(Resource reso...
@Test public void testClone() { Presubscription model = new Presubscription(new Resource("deviceId", "resourcePath")); Presubscription clone = model.clone(); assertNotSame(model, clone); assertEquals(model, clone); }
Subscription implements SdkModel { @Override public Subscription clone() { return new Subscription(deviceId, resourcePaths); } Subscription(String deviceId, List<String> resourcePaths); Subscription(Resource resource); Subscription(); String getDeviceId(); void setDeviceId(String deviceId); List<String> getResourcePa...
@Test public void testClone() { Subscription model = new Subscription(new Resource("deviceId", "resourcePath")); Subscription clone = model.clone(); assertNotSame(model, clone); assertEquals(model, clone); }
Resource implements SdkModel { @Override public Resource clone() { return new Resource(deviceId, path, resourceType, contentType, observable, interfaceDescription); } @Internal Resource(String deviceId, String path, String resourceType, String contentType, boolean observable, String interfaceDescri...
@Test public void testClone() { Resource model = new Resource("deviceId", "resourcePath"); Resource clone = model.clone(); assertNotSame(model, clone); assertEquals(model, clone); }
Webhook implements SdkModel { @Override public Webhook clone() { return new Webhook(url, headers); } Webhook(URL url, Map<String, String> headers); Webhook(); Webhook(URL url); @Internal @Override String getId(); @PerformsNoOperation @Internal @Override void setId(String id); URL getUrl(); @Required void setUrl(URL u...
@Test public void testClone() { try { Webhook model = new Webhook(new URL("http: Webhook clone = model.clone(); assertNotSame(model, clone); assertEquals(model, clone); } catch (MalformedURLException exception) { exception.printStackTrace(); fail(exception.getMessage()); } }
CertificateIssuerConfig implements SdkModel { @Override public CertificateIssuerConfig clone() { return new CertificateIssuerConfig(this); } @Internal CertificateIssuerConfig(String certificateIssuerId, Date createdAt, String id, String reference, Date updatedAt); @Internal Certific...
@SuppressWarnings("resource") @Test public void testClone() { try { CertificateIssuerConfig certificateissuerconfig1 = new CertificateIssuerConfig("412591b4-5c5a-46e4-8239-130a76e959e4", new Date(1574704662122L), "bb3de966-6e76-43fc-a114-816f65fd551f", "d5d860e3-27c8-49e8-a338-6c54e45e4540", new Date(1574704661418L)); ...
CertificateIssuerConfig implements SdkModel { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((certificateIssuerId == null) ? 0 : certificateIssuerId.hashCode()); result = prime * result + ((createdAt == null) ? 0 : createdAt.hashCode()); result = prime * result + ((id...
@SuppressWarnings("resource") @Test public void testHashCode() { try { CertificateIssuerConfig certificateissuerconfig1 = new CertificateIssuerConfig("a5b43081-d1ee-4bca-94c7-2a74f48169d1", new Date(1574704661163L), "624b3117-3ff8-47fb-8b31-8a1673e0a55b", "01545ad0-67d5-4777-bb39-5a79af09624d", new Date(1574704662978L)...
CertificateIssuerConfig implements SdkModel { @Override public boolean isValid() { return isCertificateIssuerIdValid() && isReferenceValid(); } @Internal CertificateIssuerConfig(String certificateIssuerId, Date createdAt, String id, String reference, Date updatedAt); @Internal Certi...
@SuppressWarnings("resource") @Test public void testIsValid() { CertificateIssuerConfig certificateissuerconfig = new CertificateIssuerConfig("f3fa6ede-a0d4-4a4c-977a-f8deb40dbdab", new Date(1574704660298L), "fb3dec18-4eec-4602-b3ec-6a1c14af04a2", "3974be8a-4cf9-4d92-a593-498e5462dc16", new Date(1574704666372L)); asser...
CertificateIssuerConfig implements SdkModel { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CertificateIssuerConfig)) { return false; } final CertificateIssuerConfig other = (CertificateIssuerConfig) obj; if (!other.canEqual(this)...
@SuppressWarnings("resource") @Test public void testEquals() { try { CertificateIssuerConfig certificateissuerconfig1 = new CertificateIssuerConfig("de5d1426-f07c-470e-8a31-12b313b42e87", new Date(1574704668418L), "f39efa45-0e76-4b4d-b825-79d063f6e4f8", "884e7479-4647-47a8-8e46-d25b382aeab1", new Date(1574704669104L));...
VerificationResponse implements SdkModel { @Override public VerificationResponse clone() { return new VerificationResponse(this); } @Internal VerificationResponse(String message, boolean successful); @Internal VerificationResponse(VerificationResponse verificationResponse); VerificationResponse(); @Override @Interna...
@SuppressWarnings("resource") @Test public void testClone() { try { VerificationResponse verificationresponse1 = new VerificationResponse("4465074a-b3b8-42ed-91f8-840a03e44330", true); VerificationResponse verificationresponse2 = verificationresponse1.clone(); assertNotNull(verificationresponse1); assertNotNull(verific...
VerificationResponse implements SdkModel { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((message == null) ? 0 : message.hashCode()); result = prime * result + Objects.hashCode(Boolean.valueOf(successful)); return result; } @Internal VerificationResponse(String mess...
@SuppressWarnings("resource") @Test public void testHashCode() { try { VerificationResponse verificationresponse1 = new VerificationResponse("f3b1e7c0-d8a1-440f-8b21-435987f1e30e", true); VerificationResponse verificationresponse2 = new VerificationResponse("f3b1e7c0-d8a1-440f-8b21-435987f1e30e", true); assertNotNull(v...
ApiUtils { public static boolean comparePaths(String path1, String path2) { final String normalisedPath1 = normalisePath(path1); final String normalisedPath2 = normalisePath(path2); if (normalisedPath1 == null) { return normalisedPath2 == null; } return normalisedPath1.equals(normalisedPath2); } private ApiUtils(); st...
@Test public final void testComparePaths() { assertTrue(ApiUtils.comparePaths(null, null)); assertFalse(ApiUtils.comparePaths(null, "")); assertFalse(ApiUtils.comparePaths("", null)); assertTrue(ApiUtils.comparePaths("/test/1", "test/1")); assertTrue(ApiUtils.comparePaths("test/2", "/test/2")); }
TranslationUtils { public static DateTime toDateTime(Date date) { return moveToUtc(date); } private TranslationUtils(); static Date toDate(DateTime date); static Date toDate(LocalDate ldate); static Date toDate(Calendar date); static Date toDate(Number timestamp); static Date toDate(Number timestamp, TimeUnit unit); s...
@Test public void testToDateTime() { DateTime time = new DateTime(1000); assertEquals(time.withZone(DateTimeZone.UTC), TranslationUtils.toDateTime(new Date(1000))); }