}
/**
- * Find device by cloud user uuid except kind standard
+ * Find device by cloud user uuid except mode standard
* @param uuid
* @return response
*/
- public static Response findDeviceByCloudUserUuidExceptKindStandard(String uuid) {
- Response resp = given().when().get(RestAssured.baseURI + "/dsm/restapi/device/" + uuid + "/byCloudUserUuidNotStandardKind");
+ public static Response findDeviceByCloudUserUuidExceptModeStandard(String uuid) {
+ Response resp = given().when().get(RestAssured.baseURI + "/dsm/restapi/device/" + uuid + "/byCloudUserUuidNotStandard");
resp.then().log().all();
return resp;
}
registerHubDevice(uuid);
Thread.sleep(TIMEOUT);
//rest
- Response response = Rest.findDeviceByCloudUserUuidExceptKindStandard(uuid);
+ Response response = Rest.findDeviceByCloudUserUuidExceptModeStandard(uuid);
String body = response.getBody().asString();
assertTrue(body.contains(DEVICE_DUID_HUB));
assertFalse(body.contains(DEVICE_DUID));
assertTrue(MQPublisherAPI.deviceUnRegistrationInDSM(DEVICE_DUID2, DEVICE_UNREGISTER_ACTION));
}
- private void checkfindByCloudUserUuidExceptKindStandard(String uuid) {
- log("checkfindByCloudUserUuidExceptModelStandard");
- Response resp = Rest.findDeviceByCloudUserUuidExceptKindStandard(uuid);
+ private void checkfindByCloudUserUuidExceptModeStandard(String uuid) {
+ log("checkfindByCloudUserUuidExceptModeStandard");
+ Response resp = Rest.findDeviceByCloudUserUuidExceptModeStandard(uuid);
final int size = 1;
checkResponseSize(resp, size);
}
registerDevices(uuid);
Thread.sleep(TIMEOUT);
- checkfindByCloudUserUuidExceptKindStandard(uuid);
+ checkfindByCloudUserUuidExceptModeStandard(uuid);
unregisterDevices();
deleteIoTUser(uuid);
private String parentUuid;
@Column
- private String kind;
+ private String mode;
/**
* Policy ID (FK)
*/
*/
public Device() {
this.parentUuid = "";
- this.kind = "";
+ this.mode = "";
}
/**
* @param parentUuid the parent uuid
*/
public Device(String uuid, String name, String type, String model, Integer status, Policy policy, User user,
- String parentUuid, String kind) {
+ String parentUuid, String mode) {
super();
this.uuid = uuid;
this.name = name;
this.policy = policy;
this.user = user;
this.parentUuid = (parentUuid == null) ? "" : parentUuid;
- this.kind = (kind == null) ? "" : kind;
+ this.mode = (mode == null) ? "" : mode;
}
/**
* @param parentUuid the parent uuid
*/
public Device(String uuid, String name, String type, String model, Integer status, Policy policy, User user,
- boolean removed, String parentUuid, String kind) {
+ boolean removed, String parentUuid, String mode) {
super();
this.uuid = uuid;
this.name = name;
this.user = user;
this.removed = removed;
this.parentUuid = (parentUuid == null) ? "" : parentUuid;
- this.kind = (kind == null) ? "" : kind;
+ this.mode = (mode == null) ? "" : mode;
}
/**
return parentUuid;
}
- /**
- * Gets kind.
- *
- * @return the kind
- */
- public String getKind() {
- return kind;
+
+ public String getMode() {
+ return mode;
}
/**
this.parentUuid = (parentUuid == null) ? "" : parentUuid;
}
- /**
- * Sets kind.
- *
- * @param kind the kind
- */
- public void setKind(String kind) {
- this.kind = kind;
+
+ public void setMode(String mode) {
+ this.mode = mode;
}
@Override
return "Device [id=" + id + ", uuid=" + uuid + ", name=" + name + ", type=" + type + ", model=" + model
+ ", status=" + status + ", removed=" + removed + ", parentUuid=" + parentUuid + ", policy=" + policy
+ ", user=" + user
- + ", kind=" + kind
+ + ", mode=" + mode
+ ", agents=" + agents + ", reports=" + reports + "]";
}
List<Device> findByUserAndRemovedOrderByIdAsc(User user, boolean removed);
/**
- * Find by user and model is not list.
- *
- * @param user the user
- * @param model the model
- * @return the list
- */
- List<Device> findByUserAndModelNotLike(User user, String model);
-
- /**
- * Find by user and kind is not list.
+ * Find by user and mode is not list.
*
* @param user the user
- * @param kind the kind
+ * @param mode the mode
* @return the list
*/
- List<Device> findByUserAndKindIsNot(User user, String kind);
+ List<Device> findByUserAndModeIsNot(User user, String mode);
}
* @param route the route
* @return {@link Device}
*/
- Device init(String uuid, String name, String type, String model, int status, User user, String route, String kind);
+ Device init(String uuid, String name, String type, String model, int status, User user, String route, String mode);
/**
* Remove all devices
*/
void markNotRemoved(Set<Device> devices);
- List<Device> findByUserAndModelIsNot(User user, String model);
-
- List<Device> findByUserAndKindIsNot(User user, String kind);
+ List<Device> findByUserAndModeIsNot(User user, String mode);
}
}
@Override
- public Device init(String uuid, String name, String type, String model, int status, User user, String parentUuid, String kind) {
+ public Device init(String uuid, String name, String type, String model, int status, User user, String parentUuid, String mode) {
if (name.isEmpty() || uuid.isEmpty() || type.isEmpty() || model.isEmpty()) {
throw new IllegalArgumentException("Cannot create device with empty fields");
}
Policy policy = policyService.initPolicy(type);
- Device device = new Device(uuid, name, type, model, status, policy, user, parentUuid, kind);
+ Device device = new Device(uuid, name, type, model, status, policy, user, parentUuid, mode);
return save(device);
}
}
@Override
- public List<Device> findByUserAndModelIsNot(User user, String model) {
- return deviceRepository.findByUserAndModelNotLike(user, model);
- }
-
- @Override
- public List<Device> findByUserAndKindIsNot(User user, String kind) {
- return deviceRepository.findByUserAndKindIsNot(user, kind);
+ public List<Device> findByUserAndModeIsNot(User user, String mode) {
+ return deviceRepository.findByUserAndModeIsNot(user, mode);
}
}
Policy policy = policyService.initPolicy(TYPE);
User user = userService.findByUsername("admin");
String parentUuid = "parentId";
- String kind = "kind";
- return deviceService.save(new Device("uuid", "name", TYPE, "model", 1, policy, user, parentUuid, kind));
+ String mode = "mode";
+ return deviceService.save(new Device("uuid", "name", TYPE, "model", 1, policy, user, parentUuid, mode));
}
/**
public List<Device> createAndSaveDevices(boolean offline) {
User user = userService.findByUsername("admin");
String parentUuid = "parentId";
- String kind = "kind";
+ String mode = "mode";
List<Device> devices = new ArrayList<>();
for (int i = 0; i < DEVICES_COUNT; i++) {
devices.add(deviceService.save(
new Device("uuid" + i, "name" + i, TYPE, "model" + i, offline ? 0 : 1,
- policyService.initPolicy(TYPE), user, false, parentUuid, kind)));
+ policyService.initPolicy(TYPE), user, false, parentUuid, mode)));
}
return devices;
.withPrefabValues(Agent.class, new Agent(null, NAME1, new Policy("test")), new Agent("uuid", NAME2, new Policy()))
.withPrefabValues(Agent.class, new Agent("uuid", NAME1, new Policy("test")), new Agent(null, NAME2, new Policy()))
.withPrefabValues(Device.class,
- new Device("uuid1", NAME1, "tv", "model1", 1, new Policy(), new User(), "parentUuid", "kind"),
- new Device("uuid2", NAME2, "tv", "model2", 1, new Policy(), new User(), "parentUuid", "kind"))
+ new Device("uuid1", NAME1, "tv", "model1", 1, new Policy(), new User(), "parentUuid", "mode"),
+ new Device("uuid2", NAME2, "tv", "model2", 1, new Policy(), new User(), "parentUuid", "mode"))
.usingGetClass().verify();
forClass(Policy.class).usingGetClass().verify();
device.getReports();
device.setRemoved(true);
device.isRemoved();
- assertEquals("Device [id=null, uuid=null, name=null, type=null, model=null, status=null, removed=true, parentUuid=, policy=null, user=null, kind=, agents=null, reports=null]", device
+ assertEquals("Device [id=null, uuid=null, name=null, type=null, model=null, status=null, removed=true, parentUuid=, policy=null, user=null, mode=, agents=null, reports=null]", device
.toString());
new Device(null, null, null, null, null, null, null, null, null);
*/
@Test
public void testDeviceConstructor() {
- Device device = new Device(uuid, name, type, model, status, policy, user, "route", "kind");
+ Device device = new Device(uuid, name, type, model, status, policy, user, "route", "mode");
assertEquals(uuid, device.getUuid());
assertEquals(name, device.getName());
*/
@Test
public void testSetters() {
- Device device = new Device("uuid", "name", "type", "model", 0, policy, user, "route", "kind");
+ Device device = new Device("uuid", "name", "type", "model", 0, policy, user, "route", "mode");
device.setUuid(uuid);
device.setName(name);
String type = "type";
String model = "model";
Integer status = 0;
- Device device = new Device(uuid, name, type, model, status, policy, user, "parentUuid", "kind");
+ Device device = new Device(uuid, name, type, model, status, policy, user, "parentUuid", "mode");
assertNull(device.getId());
device = deviceRepository.save(device);
assertNotNull(device.getId());
String type = "type";
String model = "model";
Integer status = 0;
- Device device = new Device(uuid, name, type, model, status, policy, user, "parentUuid", "kind");
+ Device device = new Device(uuid, name, type, model, status, policy, user, "parentUuid", "mode");
device = deviceRepository.save(device);
assertNotNull(device);
device = deviceRepository.findByUuid(uuid);
User user = userService.getUserByEmail("admin@samsung.com");
Device device1 = new Device("uuid1", "name1", TYPE, "model", 1, policyService
- .initPolicy(TYPE), user, "parentUuid", "kind");
+ .initPolicy(TYPE), user, "parentUuid", "mode");
device1.setAgents(createAgents(device1));
Device device2 = new Device("uuid2", "name2", TYPE, "model", 1, policyService
- .initPolicy(TYPE), user, "parentUuid", "kind");
+ .initPolicy(TYPE), user, "parentUuid", "mode");
deviceService.save(device1);
deviceService.save(device2);
User user = userService.getUserByEmail("admin@samsung.com");
assertEquals(2, agentService.count());
Policy policy = policyService.initPolicy("tv");
- Device device = new Device("uuid1222222", "name1", "tv", "model", 1, policy, user, "parentUuid", "kind");
+ Device device = new Device("uuid1222222", "name1", "tv", "model", 1, policy, user, "parentUuid", "mode");
deviceService.save(device);
agentService.init(initUuid, "init-name1111", device);
assertEquals(AGENT_COUNT, agentService.count());
private static final String IN_EXISTENT_UUID = "in-existent-uuid";
- private static final String KIND = "standard";
+ private static final String MODE = "standard";
private User user;
@Before
public void before() {
user = userService.getUserByEmail("admin@samsung.com");
- Device device = new Device(DEVICE_UUID, NAME, TYPE, MODEL, 1, policyService.initPolicy(TYPE), user, PARENT_UUID, KIND);
+ Device device = new Device(DEVICE_UUID, NAME, TYPE, MODEL, 1, policyService.initPolicy(TYPE), user, PARENT_UUID, MODE);
device.setReports(createReports(device));
device.setAgents(createAgents(device));
deviceService.save(device);
deviceService.save(new Device(DEVICE_UUID_WITHOUT_AGENTS, "name2", TYPE, MODEL, 1, policyService
- .initPolicy(TYPE), user, PARENT_UUID, KIND));
+ .initPolicy(TYPE), user, PARENT_UUID, MODE));
// Alone agent. No device.
agentService.save(new Agent("789", "agent3", policyService.initPolicy(TYPE)));
@Test
public void testSave() {
Policy policy = policyService.initPolicy(TYPE);
- Device newDevice = new Device(NEWUUID, NEWNAME, NEWTYPE, NEWMODEL, 0, policy, user, PARENT_UUID, KIND);
+ Device newDevice = new Device(NEWUUID, NEWNAME, NEWTYPE, NEWMODEL, 0, policy, user, PARENT_UUID, MODE);
Device savedDevice = deviceService.save(newDevice);
public void testRemove() {
Policy policy = policyService.initPolicy(TYPE);
Device newDevice = deviceService
- .save(new Device(NEWUUID, NEWNAME, NEWTYPE, NEWMODEL, 0, policy, user, false, PARENT_UUID, KIND));
+ .save(new Device(NEWUUID, NEWNAME, NEWTYPE, NEWMODEL, 0, policy, user, false, PARENT_UUID, MODE));
deviceService.remove(deviceService.findById(newDevice.getId()));
assertNull(deviceService.findById(newDevice.getId()));
}
@Test
public void testInit() throws Exception {
String route = ROUTE;
- String kind = KIND;
+ String mode = MODE;
String initUuid = "inituuid";
assertEquals(2, deviceService.count());
- deviceService.init(initUuid, "initname", "inittype", "initmodel", 0, user, route, kind);
+ deviceService.init(initUuid, "initname", "inittype", "initmodel", 0, user, route, mode);
assertEquals(DEVICE_COUNT, deviceService.count());
Device initedDevice = deviceService.findByUUID(initUuid);
@Test
public void testSameInit() throws Exception {
String route = ROUTE;
- String kind = KIND;
+ String mode = MODE;
String initUuid = "init-uuid";
assertEquals(2, deviceService.count());
- deviceService.init(initUuid, "init-name", "init-type", "init-model", 0, user, route, kind);
+ deviceService.init(initUuid, "init-name", "init-type", "init-model", 0, user, route, mode);
assertEquals(DEVICE_COUNT, deviceService.count());
Device initializedDevice = deviceService.findByUUID(initUuid);
assertNotNull(initializedDevice.getPolicy());
try {
- deviceService.init(initUuid, "duplicate-name", "duplicate-type", "duplicate-model", 0, user, route, kind);
+ deviceService.init(initUuid, "duplicate-name", "duplicate-type", "duplicate-model", 0, user, route, mode);
fail();
} catch (Exception e) {
*/
@Test(expected = Exception.class)
public void testDeviceNameIsEmpty() throws Exception {
- deviceService.init(DEVICE_UUID, "", TYPE, MODEL, 0, new User(), ROUTE, KIND);
+ deviceService.init(DEVICE_UUID, "", TYPE, MODEL, 0, new User(), ROUTE, MODE);
}
/**
*/
@Test(expected = Exception.class)
public void testDeviceUuidIsEmpty() throws Exception {
- deviceService.init("", NAME, TYPE, MODEL, 0, new User(), ROUTE, KIND);
+ deviceService.init("", NAME, TYPE, MODEL, 0, new User(), ROUTE, MODE);
}
/**
*/
@Test(expected = Exception.class)
public void testDeviceTypeIsEmpty() throws Exception {
- deviceService.init(DEVICE_UUID, NAME, "", MODEL, 0, new User(), ROUTE, KIND);
+ deviceService.init(DEVICE_UUID, NAME, "", MODEL, 0, new User(), ROUTE, MODE);
}
/**
*/
@Test(expected = Exception.class)
public void testDeviceModelIsEmpty() throws Exception {
- deviceService.init(DEVICE_UUID, NAME, TYPE, "", 0, new User(), ROUTE, KIND);
+ deviceService.init(DEVICE_UUID, NAME, TYPE, "", 0, new User(), ROUTE, MODE);
}
}
\ No newline at end of file
public void init() {
user = userService.getUserByEmail("admin@samsung.com");
Device dvc = new Device("deviceuuid", "name", "type", "model", 0, policyService
- .initPolicy(TYPE), user, "parentUuid", "kind");
+ .initPolicy(TYPE), user, "parentUuid", "mode");
List<Agent> agents = new ArrayList<>();
policy1 = policyService.initPolicy(TYPE);
Agent agent1 = new Agent("agent1uuid", "name1", policy1);
assertNull(policyService.findById(policy.getId()));
policy = policyService.initPolicy(TYPE);
Device newDevice = deviceService
- .save(new Device("newuuid", "name", "type", "model", 0, policy, user, "parentUuid", "kind"));
+ .save(new Device("newuuid", "name", "type", "model", 0, policy, user, "parentUuid", "mode"));
Policy findingPolicy = policyService.findByDeviceId(newDevice.getId());
assertNotNull(findingPolicy);
policyService.remove(findingPolicy);
private static final String ADMIN = "admin";
- private static final String KIND = "kind";
+ private static final String MODE = "mode";
@Autowired
private ReportService reportService;
Policy policy = policyService.initPolicy(TYPE);
User user = userService.findByUsername(ADMIN);
- Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, STATUS, policy, user, PARENT_UUID, KIND));
+ Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, STATUS, policy, user, PARENT_UUID, MODE));
ReportType reportType = reportTypeService.findByName(ReportType.Type.SMACK.toString());
reportService.save(new Report(reportType, SMACK_REPORT, DATE, STATUS, device));
List<Report> reports = reportService.findReportsByType(reportType);
Policy policy = policyService.initPolicy(TYPE);
User user = userService.findByUsername(ADMIN);
- Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, STATUS, policy, user, PARENT_UUID, KIND));
+ Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, STATUS, policy, user, PARENT_UUID, MODE));
ReportType reportType = reportTypeService.findByName(ReportType.Type.SMACK.toString());
reportService.save(new Report(reportType, SMACK_REPORT, DATE, STATUS, device));
List<Report> reports = reportService.findReportsByResult(STATUS);
Policy policy = policyService.initPolicy(TYPE);
User user = userService.findByUsername(ADMIN);
- Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, STATUS, policy, user, PARENT_UUID, KIND));
+ Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, STATUS, policy, user, PARENT_UUID, MODE));
ReportType reportType = reportTypeService.findByName(ReportType.Type.SMACK.toString());
reportService.save(new Report(reportType, SMACK_REPORT, DATE, STATUS, device));
List<Report> reports = reportService.findReportsByDateBetween(new Date(), new Date());
User user = userService.findByUsername(ADMIN);
Policy policy = policyService.initPolicy(TYPE);
Integer status = 1;
- long deviceId = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, status, policy, user, PARENT_ID, KIND))
+ long deviceId = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, status, policy, user, PARENT_ID, MODE))
.getId();
Report saved = reportService.save(deviceId, DAC, DATE, status, report);
Policy policy = policyService.initPolicy(TYPE);
User user = userService.findByUsername(ADMIN);
- Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, STATUS, policy, user, PARENT_UUID, KIND));
+ Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, STATUS, policy, user, PARENT_UUID, MODE));
ReportType type1 = reportTypeService.findByName(DAC);
for (int i = 0; i < REPORT_COUNT; i++) {
Policy policy = policyService.initPolicy(TYPE);
User user = userService.findByUsername(ADMIN);
int status = 1;
- Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, status, policy, user, PARENT_UUID, KIND));
+ Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, status, policy, user, PARENT_UUID, MODE));
ReportType type = reportTypeService.findByName(DAC);
Report report = reportService.save(new Report(type, "report", DATE, status, device));
return Params.create(device, report);
public void testGetDeviceReportTypes() {
Policy policy = policyService.initPolicy(TYPE);
User user = userService.findByUsername(ADMIN);
- Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, STATUS, policy, user, PARENT_UUID, KIND));
+ Device device = deviceService.save(new Device(UUID, NAME, TYPE, MODEL, STATUS, policy, user, PARENT_UUID, MODE));
ReportType type1 = reportTypeService.findByName(DAC);
ReportType type2 = reportTypeService.findByName(SMACK);
ReportType type3 = reportTypeService.findByName("syscall");
}
/**
- * Find by cloud user uuid except model standard response entity.
+ * Find by cloud user uuid except mode standard response entity.
*
* @param iotCloudUserUuId the iot cloud user uu id
* @return the response entity
*/
@Deprecated
@RequestMapping(value = "/{iotCloudUserUuId}/byCloudUserUuidNotStandard")
- public ResponseEntity<List<RestDevice>> findByCloudUserUuidExceptModelStandard(@PathVariable String iotCloudUserUuId) {
+ public ResponseEntity<List<RestDevice>> findByCloudUserUuidExceptModeStandard(@PathVariable String iotCloudUserUuId) {
User user = ofNullable(iotCloudService.findAssociatedUserByUuid(iotCloudUserUuId))
.orElseThrow(IotCloudAssociatedUserNotExists::new);
- return new ResponseEntity<>(deviceConverter.convert(deviceService.findByUserAndKindIsNot(user, "standard")), OK);
+ return new ResponseEntity<>(deviceConverter.convert(deviceService.findByUserAndModeIsNot(user, "standard")), OK);
}
- @RequestMapping(value = "/{iotCloudUserUuId}/byCloudUserUuidNotStandardKind")
- public ResponseEntity<List<RestDevice>> findByCloudUserUuidExceptKindStandard(@PathVariable String iotCloudUserUuId) {
- User user = ofNullable(iotCloudService.findAssociatedUserByUuid(iotCloudUserUuId))
- .orElseThrow(IotCloudAssociatedUserNotExists::new);
- return new ResponseEntity<>(deviceConverter.convert(deviceService.findByUserAndKindIsNot(user, "standard")), OK);
- }
-
-
}
PolicyConfig.PolicyGroup.Policy[] policies = {
new PolicyConfig.PolicyGroup.Policy(NAME, 1, new String[] { "as" }) };
- Device device = new Device(UUID, NAME, "type", "model", 1, new Policy(), new User(), "parentUuid", "kind");
+ Device device = new Device(UUID, NAME, "type", "model", 1, new Policy(), new User(), "parentUuid", "mode");
device.setId(1L);
ViewPolicyGroup viewPolicyGroup1 = new ViewPolicyGroup(new PolicyConfig.PolicyGroup(NAME, policies));
}
private static void viewDevice() {
- Device device = new Device("uuid", NAME, "type", "model", 1, new Policy(), new User(), "parentUuid", "kind");
+ Device device = new Device("uuid", NAME, "type", "model", 1, new Policy(), new User(), "parentUuid", "mode");
device.setId(1L);
ViewDevice viewDevice = new ViewDevice(device);
deviceStatusView.setStatus("status");
deviceStatusView.setStatusText("status text");
- Device device = new Device(UUID, NAME, "type", "model", 1, new Policy(), new User(), "parentUuid", "kind");
+ Device device = new Device(UUID, NAME, "type", "model", 1, new Policy(), new User(), "parentUuid", "mode");
device.setId(1L);
PolicyConfig.PolicyGroup.Policy[] policies = {
*/
@Test
public void getViewDevicesList() {
- Device device = new Device("uuid", "name", "tv", "model", 1, new Policy(), new User(), "parentUuid", "kind");
+ Device device = new Device("uuid", "name", "tv", "model", 1, new Policy(), new User(), "parentUuid", "mode");
device.setId(1L);
List<Device> devices = new ArrayList<>();
private static final String PARENT_UUID = "parentUuid";
- private static final String KIND = "kind";
+ private static final String MODE = "mode";
private static final String ROOT_URL = "/restapi";
// Device with agent
Device device = new Device("1234", "s8", "phone", "samsung s8 edge", 1, policyService
- .initPolicy("phone"), user, PARENT_UUID, KIND);
+ .initPolicy("phone"), user, PARENT_UUID, MODE);
List<Agent> agents = new ArrayList<>();
Agent agent = new Agent("5678", "name1", policyService.initPolicy("phone"));
devices.add(deviceService.save(device));
devices.add(deviceService.save(new Device("1235", "s4", "phone", "samsung s7 edge", 1, policyService
- .initPolicy("phone"), user, PARENT_UUID, KIND)));
+ .initPolicy("phone"), user, PARENT_UUID, MODE)));
devices.add(deviceService
.save(new Device("1236", "airconditioner samsung", "airconditioner", "AR12JSFSRWK", 1, policyService
- .initPolicy("airconditioner"), user, false, PARENT_UUID, KIND)));
+ .initPolicy("airconditioner"), user, false, PARENT_UUID, MODE)));
devices.add(deviceService
.save(new Device("1237", "vacuum cleaner samsung", "vacuum cleaner", "FY128192JJJ", 1, policyService
- .initPolicy("vacuum cleaner"), user, true, PARENT_UUID, KIND)));
+ .initPolicy("vacuum cleaner"), user, true, PARENT_UUID, MODE)));
// User without devices
userService.save(new User("another", "another@samsung.com", false, new Date(), roleService.findById(1L)));
public void before() {
User user = userService.getUserByEmail("admin@samsung.com");
policy = policyService.initPolicy("phone");
- Device device = new Device("1234", "s8", "phone", "samsung s8 edge", 1, policy, user, "parentUuid", "kind");
+ Device device = new Device("1234", "s8", "phone", "samsung s8 edge", 1, policy, user, "parentUuid", "mode");
List<Agent> agents = new ArrayList<>();
agent = new Agent("5678", "name1", policyService.initPolicy("phone"));
agent.setDevice(device);
User user = userService.findByUsername("admin");
Device device = new Device("1234", "s4", "phone", "samsung s7 edge", 1, policyService
- .initPolicy("phone"), user, "parentUuid", "kind");
+ .initPolicy("phone"), user, "parentUuid", "mode");
deviceService.save(device);
Device deviceForAudit = new Device("4321", "s4", "phone", "samsung s7 edge", 1, policyService
- .initPolicy("phone"), user, "parentUuid", "kind");
+ .initPolicy("phone"), user, "parentUuid", "mode");
deviceService.save(deviceForAudit);
ReportType reportType = reportTypeRepository.findByType(ReportType.Type.DAC.toString());
public void reportByDeviceUUIDOkForAuditTrail() throws Exception {
User user = userService.findByUsername("admin");
Device deviceForAuditTrail = new Device("111111111", "s4", "phone", "samsung s7 edge", 1, policyService
- .initPolicy("phone"), user, "parentUuid", "kind");
+ .initPolicy("phone"), user, "parentUuid", "mode");
deviceService.save(deviceForAuditTrail);
// SMACK
saveSmackReports(deviceForAuditTrail);
@Test
public void testExtractorDelete() throws Exception {
String route = "route";
- String kind = "kind";
+ String mode = "mode";
Policy policy = policyService.initPolicy(TYPE);
policy = policyService.save(policy);
User user = userService.getUserByEmail("admin@samsung.com");
- Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, route, kind);
+ Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, route, mode);
deviceService.save(device);
Cbor<HashMap<String, String>> cbor = new Cbor<>();
HashMap<String, String> map = new HashMap<>();
@Test
public void testExtractorUnregistrated() throws Exception {
String route = "route";
- String kind = "kind";
+ String mode = "mode";
Policy policy = policyService.initPolicy(TYPE);
policy = policyService.save(policy);
User user = userService.getUserByEmail("admin@samsung.com");
- Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, route, kind);
+ Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, route, mode);
deviceService.save(device);
Cbor<HashMap<String, String>> cbor = new Cbor<>();
HashMap<String, String> map = new HashMap<>();
@EnableAutoConfiguration
public class PolicyPostDataExtractorTest {
- private static final String KIND = "kind";
+ private static final String MODE = "mode";
private static final String ROUTE = "route";
private static final String ADMIN_EMAIL = "admin@samsung.com";
private static final String DUID = "testuuid";
public void testExtractorWithoutAgent() {
Policy policy = policyService.initPolicy(TYPE);
User user = userService.getUserByEmail(ADMIN_EMAIL);
- Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, ROUTE, KIND);
+ Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, ROUTE, MODE);
deviceService.save(device);
assertNotNull(deviceService.findByUUID(DUID));
Cbor<HashMap<String, String>> cbor = new Cbor<>();
String testAgentName = "Test Agent";
Policy policy = policyService.initPolicy(TYPE);
User user = userService.getUserByEmail(ADMIN_EMAIL);
- Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, ROUTE, KIND);
+ Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, ROUTE, MODE);
deviceService.save(device);
agentService.init(testAgentUuid, testAgentName, device);
assertNotNull(deviceService.findByUUID(DUID));
public void testExtractorWithException() throws Exception {
Policy policy = policyService.initPolicy(TYPE);
User user = userService.getUserByEmail(ADMIN_EMAIL);
- Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, ROUTE, KIND);
+ Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, ROUTE, MODE);
deviceService.save(device);
assertNotNull(deviceService.findByUUID(DUID));
Cbor<HashMap<String, String>> cbor = new Cbor<>();
public void testExtractorWithEmptyAgent() throws Exception {
Policy policy = policyService.initPolicy(TYPE);
User user = userService.getUserByEmail(ADMIN_EMAIL);
- Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, ROUTE, KIND);
+ Device device = new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, ROUTE, MODE);
deviceService.save(device);
assertNotNull(deviceService.findByUUID(DUID));
Cbor<HashMap<String, String>> cbor = new Cbor<>();
@Test
public void testExtractor() throws Exception {
String route = "route";
- String kind = "kind";
+ String mode = "mode";
Policy policy = policyService.initPolicy(TYPE);
User user = userService.getUserByEmail("admin@samsung.com");
- Device device = deviceService.save(new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, route, kind));
+ Device device = deviceService.save(new Device(DUID, NAME, TYPE, MODEL, STATUS, policy, user, route, mode));
assertNotNull(deviceService.findByUUID(DUID));
Cbor<HashMap<String, String>> cbor = new Cbor<>();
HashMap<String, String> map = new HashMap<>();