Examples of APIKey


Examples of com.denimgroup.threadfix.data.entities.APIKey

    apiKeyDao.saveOrUpdate(apiKey);
  }

  @Override
  public APIKey createAPIKey(String note, boolean restricted) {
    APIKey key = new APIKey();
   
    String editedNote = note;
   
    if (editedNote != null && editedNote.length() > 255)
      editedNote = editedNote.substring(0, 254);
   
    String keyString = generateNewSecureRandomKey();
   
    if (keyString != null && keyString.length() > 50)
      keyString = keyString.substring(0, 49);
   
    key.setNote(editedNote);
    key.setIsRestrictedKey(restricted);
    key.setApiKey(keyString);
   
    return key;
  }
View Full Code Here

Examples of com.wordnik.swagger.model.ApiKey

        this.keyname = keyname;
    }

    @Override
    public ApiKey toSwaggerModel() {
        return new ApiKey(keyname, passAs);
    }
View Full Code Here

Examples of hibernate.APIKey

   */
  public static APIKey createNewKey(int userId, String companyName)
  {
    Random randomGenerator = new Random();
        int apiKey = showRandomInteger(10000000,99999999,randomGenerator);
        APIKey newAPIKey = new APIKey();
        newAPIKey.setCompanyName(companyName);
        newAPIKey.setUserId(userId);
        newAPIKey.setApiKey(apiKey);
    return newAPIKey;
  }
View Full Code Here

Examples of lv.odylab.evemanage.domain.eve.ApiKey

    }

    @Test
    public void testSynchronizeCreateApiKey_NoKeyCharacters_NoDetachedCharacters() throws EveApiException {
        Key<User> userKey = new Key<User>(User.class, 1);
        ApiKey apiKey = new ApiKey();
        when(characterDao.getAllWithoutApiKey(userKey)).thenReturn(new ArrayList<Character>());
        eveSynchronizationService.synchronizeCreateApiKey(apiKey, userKey);
        verify(characterSynchronizationService).synchronizeUpdateCharacters(characterListCaptor.capture(), eq(userKey));
        assertEquals(0, characterListCaptor.getValue().size());
    }
View Full Code Here

Examples of lv.odylab.evemanage.domain.eve.ApiKey

    }

    @Test
    public void testSynchronizeCreateApiKey_NoKeyCharacter_TwoDetachedCharacters() throws EveApiException {
        Key<User> userKey = new Key<User>(User.class, 1);
        ApiKey apiKey = new ApiKey();
        ArrayList<Character> characters = new ArrayList<Character>();
        Character character1 = new Character();
        character1.setCharacterID(1L);
        Character character2 = new Character();
        character2.setCharacterID(2L);
View Full Code Here

Examples of lv.odylab.evemanage.domain.eve.ApiKey

    }

    @Test
    public void testSynchronizeCreateApiKey_OneKeyCharacter_NoDetachedCharacters() throws EveApiException {
        Key<User> userKey = new Key<User>(User.class, 1);
        ApiKey apiKey = new ApiKey();
        List<ApiKeyCharacterInfo> apiKeyCharacterInfos = new ArrayList<ApiKeyCharacterInfo>();
        ApiKeyCharacterInfo apiKeyCharacterInfo = new ApiKeyCharacterInfo();
        apiKeyCharacterInfo.setCharacterID(1L);
        apiKeyCharacterInfos.add(apiKeyCharacterInfo);
        apiKey.setCharacterInfos(apiKeyCharacterInfos);

        when(characterDao.getAllWithoutApiKey(userKey)).thenReturn(new ArrayList<Character>());
        eveSynchronizationService.synchronizeCreateApiKey(apiKey, userKey);

        verify(characterDao, never()).put(any(Character.class), eq(userKey));
View Full Code Here

Examples of lv.odylab.evemanage.domain.eve.ApiKey

    }

    @Test
    public void testSynchronizeCreateApiKey_OneKeyCharacter_OneMatchingDetachedCharacter() throws EveApiException {
        Key<User> userKey = new Key<User>(User.class, 1);
        ApiKey apiKey = new ApiKey();
        apiKey.setId(1L);
        List<ApiKeyCharacterInfo> apiKeyCharacterInfos = new ArrayList<ApiKeyCharacterInfo>();
        ApiKeyCharacterInfo apiKeyCharacterInfo = new ApiKeyCharacterInfo();
        apiKeyCharacterInfo.setCharacterID(2L);
        apiKeyCharacterInfos.add(apiKeyCharacterInfo);
        apiKey.setCharacterInfos(apiKeyCharacterInfos);
        ArrayList<Character> characters = new ArrayList<Character>();
        Character character = new Character();
        character.setCharacterID(2L);
        characters.add(character);
View Full Code Here

Examples of lv.odylab.evemanage.domain.eve.ApiKey

    }

    @Test
    public void testSynchronizeCreateApiKey_OneKeyCharacter_OneNotMatchingDetachedCharacter() throws EveApiException {
        Key<User> userKey = new Key<User>(User.class, 1);
        ApiKey apiKey = new ApiKey();
        List<ApiKeyCharacterInfo> apiKeyCharacterInfos = new ArrayList<ApiKeyCharacterInfo>();
        ApiKeyCharacterInfo apiKeyCharacterInfo = new ApiKeyCharacterInfo();
        apiKeyCharacterInfo.setCharacterID(2L);
        apiKeyCharacterInfos.add(apiKeyCharacterInfo);
        apiKey.setCharacterInfos(apiKeyCharacterInfos);
        ArrayList<Character> characters = new ArrayList<Character>();
        Character character = new Character();
        character.setCharacterID(3L);
        characters.add(character);
View Full Code Here

Examples of lv.odylab.evemanage.domain.eve.ApiKey

    @Test
    public void testSynchronizeDeleteApiKey_OneCharacter_OtherKey() {
        Key<User> userKey = new Key<User>(User.class, 1);
        Key<ApiKey> apiKeyKey = new Key<ApiKey>(ApiKey.class, 1);
        List<ApiKey> otherApiKeys = new ArrayList<ApiKey>();
        ApiKey otherApiKey = new ApiKey();
        otherApiKey.setId(2L);
        List<ApiKeyCharacterInfo> apiKeyCharacterInfos = new ArrayList<ApiKeyCharacterInfo>();
        ApiKeyCharacterInfo apiKeyCharacterInfo = new ApiKeyCharacterInfo();
        apiKeyCharacterInfo.setCharacterID(1L);
        apiKeyCharacterInfos.add(apiKeyCharacterInfo);
        otherApiKey.setCharacterInfos(apiKeyCharacterInfos);
        otherApiKeys.add(otherApiKey);

        ArrayList<Character> characters = new ArrayList<Character>();
        Character character = new Character();
        character.setApiKey(apiKeyKey);
View Full Code Here

Examples of lv.odylab.evemanage.domain.eve.ApiKey

        for (int i = 0; i < 500; i++) {
            User user = new User();
            userDao.put(user);
            Key<User> userKey = new Key<User>(User.class, user.getId());
            for (int j = 0; j < 10; j++) {
                ApiKey apiKey = new ApiKey();
                apiKey.setUser(userKey);
                apiKeyDao.putWithoutChecks(apiKey);
            }
        }

        startApiKeyUpdateCronServlet.doGet(null, null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.