- CredRequest cr = credRequest1();
- final String fqi = "bob@people.onap.org";
- when(trans.user()).thenReturn(fqi);
- when(org.isValidPassword(trans, cr.getId(),cr.getPassword())).thenReturn("");
- when(org.isValidCred(trans, cr.getId())).thenReturn(true);
- when(org.canHaveMultipleCreds(cr.getId())).thenReturn(true);
- when(org.getIdentity(trans, cr.getId())).thenReturn(orgIdentity);
- when(orgIdentity.isFound()).thenReturn(true);
- final String ns = "org.onap.sample";
- whenRole(trans,fqi,ns,"owner",false, 100);
- whenRole(trans,fqi,ns,"admin",true, 100);
- when(question.nsDAO().read(trans, ns)).thenReturn(Result.ok(nsData(ns)));
- when(question.credDAO().readID(trans, cr.getId())).thenReturn(Result.ok(emptyList(CredDAO.Data.class)));
- when(question.credDAO().create(any(AuthzTrans.class), any(CredDAO.Data.class) )).thenReturn(Result.ok(credDataFound(cr,100)));
- when(question.credDAO().readNS(trans, ns)).thenReturn(Result.ok(listOf(credDataFound(cr,100))));
- Result<?> result = acsi.createUserCred(trans,cr);
- // Admins may not do FIRST Creds
- Assert.assertEquals(Result.ERR_Denied,result.status);
+ CredRequest cr = credRequest1();
+ final String fqi = "bob@people.onap.org";
+ when(trans.user()).thenReturn(fqi);
+ when(org.isValidPassword(trans, cr.getId(),cr.getPassword())).thenReturn("");
+ when(org.isValidCred(trans, cr.getId())).thenReturn(true);
+ when(org.canHaveMultipleCreds(cr.getId())).thenReturn(true);
+ when(org.getIdentity(trans, cr.getId())).thenReturn(orgIdentity);
+ when(orgIdentity.isFound()).thenReturn(true);
+ final String ns = "org.onap.sample";
+ whenRole(trans,fqi,ns,"owner",false, 100);
+ whenRole(trans,fqi,ns,"admin",true, 100);
+ when(question.nsDAO().read(trans, ns)).thenReturn(Result.ok(nsData(ns)));
+ when(question.credDAO().readID(trans, cr.getId())).thenReturn(Result.ok(emptyList(CredDAO.Data.class)));
+ when(question.credDAO().create(any(AuthzTrans.class), any(CredDAO.Data.class) )).thenReturn(Result.ok(credDataFound(cr,100)));
+ when(question.credDAO().readNS(trans, ns)).thenReturn(Result.ok(listOf(credDataFound(cr,100))));
+ Result<?> result = acsi.createUserCred(trans,cr);
+ // Admins may not do FIRST Creds
+ Assert.assertEquals(Result.ERR_Denied,result.status);