Search in sources :

Example 6 with KeyValueBasedPcrDAOImpl

use of com.wso2telco.core.pcrservice.dao.impl.KeyValueBasedPcrDAOImpl in project core-util by WSO2Telco.

the class KeyValueBasedPcrDAOImplTest method testcheckIsRelated.

@Test
public void testcheckIsRelated() throws PCRException {
    KeyValueBasedPcrDAOImpl keyValueBasedPcrDAOImpl = new KeyValueBasedPcrDAOImpl();
    assertTrue(keyValueBasedPcrDAOImpl.checkIsRelated("s1", "a1"));
}
Also used : KeyValueBasedPcrDAOImpl(com.wso2telco.core.pcrservice.dao.impl.KeyValueBasedPcrDAOImpl) Test(org.junit.Test)

Example 7 with KeyValueBasedPcrDAOImpl

use of com.wso2telco.core.pcrservice.dao.impl.KeyValueBasedPcrDAOImpl in project core-util by WSO2Telco.

the class KeyValueBasedPcrDAOImplTest method testgetExistingPCR.

@Test
public void testgetExistingPCR() throws PCRException {
    KeyValueBasedPcrDAOImpl keyValueBasedPcrDAOImpl = new KeyValueBasedPcrDAOImpl();
    RequestDTO requestDTO = new RequestDTO("u1", "a1", "s1");
    assertEquals(keyValueBasedPcrDAOImpl.getExistingPCR(requestDTO), "p1");
}
Also used : RequestDTO(com.wso2telco.core.pcrservice.model.RequestDTO) KeyValueBasedPcrDAOImpl(com.wso2telco.core.pcrservice.dao.impl.KeyValueBasedPcrDAOImpl) Test(org.junit.Test)

Example 8 with KeyValueBasedPcrDAOImpl

use of com.wso2telco.core.pcrservice.dao.impl.KeyValueBasedPcrDAOImpl in project core-util by WSO2Telco.

the class KeyValueBasedPcrDAOImplTest method testgetAppIdListForUserSectorCombination.

@Test
public void testgetAppIdListForUserSectorCombination() throws PCRException {
    KeyValueBasedPcrDAOImpl keyValueBasedPcrDAOImpl = new KeyValueBasedPcrDAOImpl();
    List<String> list = keyValueBasedPcrDAOImpl.getAppIdListForUserSectorCombination("u2", "s2");
    // assertNull(list);
    assertTrue(list.isEmpty());
// assertEquals(list.get(0),"a1");
// assertEquals(list.get(1), "a2");
}
Also used : KeyValueBasedPcrDAOImpl(com.wso2telco.core.pcrservice.dao.impl.KeyValueBasedPcrDAOImpl) Test(org.junit.Test)

Example 9 with KeyValueBasedPcrDAOImpl

use of com.wso2telco.core.pcrservice.dao.impl.KeyValueBasedPcrDAOImpl in project core-util by WSO2Telco.

the class KeyValueBasedPcrDAOImplTest method testcheckApplicationExists.

@Test
public void testcheckApplicationExists() throws PCRException {
    KeyValueBasedPcrDAOImpl keyValueBasedPcrDAOImpl = new KeyValueBasedPcrDAOImpl();
    assertTrue(keyValueBasedPcrDAOImpl.checkApplicationExists("s1", "a1"));
}
Also used : KeyValueBasedPcrDAOImpl(com.wso2telco.core.pcrservice.dao.impl.KeyValueBasedPcrDAOImpl) Test(org.junit.Test)

Example 10 with KeyValueBasedPcrDAOImpl

use of com.wso2telco.core.pcrservice.dao.impl.KeyValueBasedPcrDAOImpl in project core-util by WSO2Telco.

the class UUIDPCRService method createAndPersistNewPcr.

private void createAndPersistNewPcr(RequestDTO requestDTO, String pcr) throws PCRException {
    KeyValueBasedPcrDAOImpl keyValueBasedPcrDAO = new KeyValueBasedPcrDAOImpl();
    keyValueBasedPcrDAO.createNewPcrEntry(requestDTO, pcr);
}
Also used : KeyValueBasedPcrDAOImpl(com.wso2telco.core.pcrservice.dao.impl.KeyValueBasedPcrDAOImpl)

Aggregations

KeyValueBasedPcrDAOImpl (com.wso2telco.core.pcrservice.dao.impl.KeyValueBasedPcrDAOImpl)12 Test (org.junit.Test)7 RequestDTO (com.wso2telco.core.pcrservice.model.RequestDTO)3 PCRException (com.wso2telco.core.pcrservice.exception.PCRException)2 UUID (java.util.UUID)1 OAuthConsumerAppDTO (org.wso2.carbon.identity.oauth.stub.dto.OAuthConsumerAppDTO)1