Package com.alu.e3.data.model

Examples of com.alu.e3.data.model.AuthDetail


  public void testAddTwiceAuthSameToken() {

    // Add a new Auth
    Auth auth = new Auth();
    auth.setId("id2");
    auth.setAuthDetail(new AuthDetail());
    auth.getAuthDetail().setUsername("username");
    auth.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth.getAuthDetail().setAuthKeyValue("authKey");
    dataManager.addAuth(auth);

    Auth auth2 = new Auth();
    auth2.setId("id3");
    auth2.setAuthDetail(new AuthDetail());
    auth2.getAuthDetail().setUsername("username");
    auth2.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth2.getAuthDetail().setAuthKeyValue("authKey");

    boolean wasException = false;
View Full Code Here


  public void testAddTwiceAuthSameIP() {

    // Add a new Auth
    Auth auth = new Auth();
    auth.setId("id2");
    auth.setAuthDetail(new AuthDetail());
    auth.getAuthDetail().setType(NBAuthType.IP_WHITE_LIST);
    auth.getAuthDetail().getWhiteListedIps().add("12.34.56.78");
    dataManager.addAuth(auth);

    Auth auth2 = new Auth();
    auth2.setId("id3");
    auth2.setAuthDetail(new AuthDetail());
    auth2.getAuthDetail().setType(NBAuthType.IP_WHITE_LIST);
    auth2.getAuthDetail().getWhiteListedIps().add("12.34.56.78");

    boolean wasException = false;
    try
    {
      dataManager.addAuth(auth2);
    }
    catch (Exception e)
    {
      wasException = true;
    }

    assertTrue("Second auth with same API key was refused", wasException);

    // cleanup for next test
    dataManager.removeAuth(auth.getId());



    // Add a new Auth
    auth = new Auth();
    auth.setId("id2");
    auth.setAuthDetail(new AuthDetail());
    auth.getAuthDetail().setType(NBAuthType.IP_WHITE_LIST);
    auth.getAuthDetail().getWhiteListedIps().add("12.34.56.78");
    dataManager.addAuth(auth);

    auth2 = new Auth();
    auth2.setId("id3");
    auth2.setAuthDetail(new AuthDetail());
    auth2.getAuthDetail().setType(NBAuthType.IP_WHITE_LIST);
    auth2.getAuthDetail().getWhiteListedIps().add("112.34.56.78");
    dataManager.addAuth(auth2);

    auth2.getAuthDetail().getWhiteListedIps().clear();
View Full Code Here

  public void testGetAllAuth() {

    // Add a new Auth
    Auth auth = new Auth();
    auth.setId("id1");
    auth.setAuthDetail(new AuthDetail());
    auth.getAuthDetail().setUsername("username1");
    auth.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth.getAuthDetail().setAuthKeyValue("authKey1");
    dataManager.addAuth(auth);

    Auth auth2 = new Auth();
    auth2.setId("id2");
    auth2.setAuthDetail(new AuthDetail());
    auth2.getAuthDetail().setUsername("username");
    auth2.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth2.getAuthDetail().setAuthKeyValue("authKey2");
    dataManager.addAuth(auth2);
View Full Code Here

    // Add a new Auth
    Auth auth = new Auth();
    auth.setId("id2");
    auth.setStatus(StatusType.ACTIVE);
    auth.setAuthDetail(new AuthDetail());
    auth.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth.getAuthDetail().setAuthKeyValue("authKey10");
    dataManager.addAuth(auth);

    // Add a new Policy
View Full Code Here

    // Add a new Auth
    Auth auth = new Auth();
    auth.setId("id52");
    auth.setStatus(StatusType.ACTIVE);
    auth.setAuthDetail(new AuthDetail());
    auth.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth.getAuthDetail().setAuthKeyValue("authKey20");
    dataManager.addAuth(auth);

    // Add a new Policy
View Full Code Here

    // Add a new Auth
    Auth auth = new Auth();
    auth.setId("id62");
    auth.setStatus(StatusType.ACTIVE);
    auth.setAuthDetail(new AuthDetail());
    auth.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth.getAuthDetail().setAuthKeyValue("authKey30");
    dataManager.addAuth(auth);

    // Add a new Policy
View Full Code Here

    // Add a new Auth
    Auth auth = new Auth();
    auth.setId("id31");
    auth.setStatus(StatusType.ACTIVE);
    AuthDetail detail = new AuthDetail();
    auth.setAuthDetail(detail);
    auth.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth.getAuthDetail().setAuthKeyValue("authKey31");
    dataManager.addAuth(auth);

    // Add a new Auth
    Auth auth2 = new Auth();
    auth2.setId("id32");
    auth2.setStatus(StatusType.ACTIVE);
    AuthDetail detail2 = new AuthDetail();
    auth2.setAuthDetail(detail2);
    auth2.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth2.getAuthDetail().setAuthKeyValue("authKey32");
    dataManager.addAuth(auth2);

    // Add a new Auth
    Auth auth3 = new Auth();
    auth3.setId("id33");
    auth3.setStatus(StatusType.ACTIVE);
    AuthDetail detail3 = new AuthDetail();
    auth3.setAuthDetail(detail3);
    auth3.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth3.getAuthDetail().setAuthKeyValue("authKey33");
    dataManager.addAuth(auth3);

    // Add a new Auth
    Auth auth4 = new Auth();
    auth4.setId("id34");
    auth4.setStatus(StatusType.ACTIVE);
    AuthDetail detail4 = new AuthDetail();
    auth4.setAuthDetail(detail4);
    auth4.getAuthDetail().setType(NBAuthType.BASIC);
    auth4.getAuthDetail().setUsername("user1");
    auth4.getAuthDetail().setPassword(new byte[]{'p', 'a', 's', 's', '1'});
    dataManager.addAuth(auth4);
View Full Code Here

    // Add a new Auth
    Auth auth = new Auth();
    auth.setId("authId1");
    auth.setStatus(StatusType.ACTIVE);
    auth.setAuthDetail(new AuthDetail());
    auth.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth.getAuthDetail().setAuthKeyValue("authKey");
    dataManager.addAuth(auth);

    // Add a new Policy
View Full Code Here

    // Prepare Auths
    Auth auth = new Auth();
    auth.setId("authId1");
    auth.setStatus(StatusType.ACTIVE);
    auth.setAuthDetail(new AuthDetail());
    auth.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth.getAuthDetail().setAuthKeyValue("authKey1");
    dataManager.addAuth(auth);

    Auth auth2 = new Auth();
    auth2.setId("authId2");
    auth2.setStatus(StatusType.ACTIVE);
    auth2.setAuthDetail(new AuthDetail());
    auth2.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth2.getAuthDetail().setAuthKeyValue("authKey2");
    dataManager.addAuth(auth2);

    // Add a new Policy
View Full Code Here

    // Prepare Auths
    Auth auth = new Auth();
    auth.setId("authId1");
    auth.setStatus(StatusType.ACTIVE);
    auth.setAuthDetail(new AuthDetail());
    auth.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth.getAuthDetail().setAuthKeyValue("authKey1");
    dataManager.addAuth(auth);

    Auth auth2 = new Auth();
    auth2.setId("authId2");
    auth2.setStatus(StatusType.ACTIVE);
    auth2.setAuthDetail(new AuthDetail());
    auth2.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth2.getAuthDetail().setAuthKeyValue("authKey2");
    dataManager.addAuth(auth2);

    Auth auth3 = new Auth();
    auth3.setId("authId3");
    auth3.setStatus(StatusType.ACTIVE);
    auth3.setAuthDetail(new AuthDetail());
    auth3.getAuthDetail().setType(NBAuthType.AUTHKEY);
    auth3.getAuthDetail().setAuthKeyValue("authKey3");
    dataManager.addAuth(auth3);

    // Add a new Policy
View Full Code Here

TOP

Related Classes of com.alu.e3.data.model.AuthDetail

Copyright © 2018 www.massapicom. 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.