* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
- * *
+ * *
* * http://www.apache.org/licenses/LICENSE-2.0
- * *
+ * *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
private final String b64encoded = "VXNlcjpwYXNz";
private Field content_field;
-
+
@Before
public void setup() throws NoSuchFieldException {
content_field = ConfigPrincipal.class.getDeclaredField("content");
@Test
public void testConfigPrincipalStringString() throws IOException, IllegalArgumentException, IllegalAccessException {
ConfigPrincipal p = new ConfigPrincipal(name, pass);
-
+
assertThat(p.getName(), is(name));
assertThat(p.toString(), is(name));
assertThat(p.getCred(), is(pass.getBytes()));
@Test
public void testConfigPrincipalStringByteArray() throws IOException, IllegalArgumentException, IllegalAccessException {
ConfigPrincipal p = new ConfigPrincipal(name, pass.getBytes());
-
+
assertThat(p.getName(), is(name));
assertThat(p.toString(), is(name));
assertThat(p.getCred(), is(pass.getBytes()));
// One more time for coverage purposes
assertThat(p.getAsBasicAuthHeader(), is("Basic " + b64encoded));
}
-
+
}