예제 #1
0
 @Test
 public void registerProfileServiceTest() throws IOException {
   byte[] profile = baseAvroConverter.encode(ENDPOINT_PROFILE);
   RegisterProfileRequest request =
       new RegisterProfileRequest(
           application.getApplicationToken(), ENDPOINT_KEY, sdkToken, profile);
   EndpointProfileDto dto = profileService.registerProfile(request);
   Assert.assertNotNull(dto);
   Assert.assertNotNull(dto.getId());
   Assert.assertTrue(Arrays.equals(ENDPOINT_KEY, dto.getEndpointKey()));
   Assert.assertTrue(
       Arrays.equals(
           EndpointObjectHash.fromSha1(ENDPOINT_KEY).getData(), dto.getEndpointKeyHash()));
   Assert.assertEquals(
       baseAvroConverter.encodeToJson(ENDPOINT_PROFILE),
       dto.getClientProfileBody().replaceAll(" ", ""));
   Assert.assertTrue(
       Arrays.equals(EndpointObjectHash.fromSha1(profile).getData(), dto.getProfileHash()));
 }