55import es .upv .i3m .grycap .im .auth .credential .DummyCredential ;
66import es .upv .i3m .grycap .im .auth .credential .im .ImCredential .ImUsernamePasswordCredential ;
77import es .upv .i3m .grycap .im .auth .credential .occi .OcciCredential ;
8+ import es .upv .i3m .grycap .im .auth .credential .opennebula .OpenNebulaTokenCredential ;
9+ import es .upv .i3m .grycap .im .auth .credential .opennebula .OpenNebulaUserPwdCredential ;
810import es .upv .i3m .grycap .im .auth .credential .openstack .OpenstackAuthVersion ;
911import es .upv .i3m .grycap .im .auth .credential .openstack .OpenstackCredential ;
1012import es .upv .i3m .grycap .im .auth .credential .vmrc .VmrcCredential ;
@@ -28,6 +30,10 @@ public class AuthorizationHeaderTest extends ImTestWatcher {
2830 "id = ost ; type = OpenStack ; username = usr ; password = pwd ; host = host ; service_region = region" ;
2931 private static final String OCCI_CREDS =
3032 "id = occi ; type = OCCI ; host = host ; proxy = proxy" ;
33+ private static final String ONE_UP_CREDS =
34+ "id = one ; type = OpenNebula ; username = usr ; password = pwd ; host = host" ;
35+ private static final String ONE_TK_CREDS =
36+ " id = one ; type = OpenNebula ; token = token ; host = host" ;
3137
3238 private static AuthorizationHeader ah ;
3339
@@ -74,6 +80,22 @@ public void testOpenStackCredentials() throws ImClientException {
7480 Assert .assertEquals (OST_CREDS , ah .serialize ());
7581 }
7682
83+ @ Test
84+ public void testOpenNebulaUserPassCredentials () throws ImClientException {
85+ Credential <?> cred = OpenNebulaUserPwdCredential .getBuilder ().withId ("one" )
86+ .withUsername ("usr" ).withPassword ("pwd" ).withHost ("host" ).build ();
87+ ah .addCredential (cred );
88+ Assert .assertEquals (ONE_UP_CREDS , ah .serialize ());
89+ }
90+
91+ @ Test
92+ public void testOpenNebulaTokenCredentials () throws ImClientException {
93+ Credential <?> cred = OpenNebulaTokenCredential .getBuilder ().withId ("one" )
94+ .withToken ("token" ).withHost ("host" ).build ();
95+ ah .addCredential (cred );
96+ Assert .assertEquals (ONE_TK_CREDS , ah .serialize ());
97+ }
98+
7799 @ Test
78100 public void testOcciCredentials () throws ImClientException {
79101 Credential <?> cred = OcciCredential .getBuilder ().withId ("occi" )
0 commit comments