@RunWith(PowerMockRunner.class)
public class JU_TypedCode {
- TypedCode typedCode;
- @Mock
- RouteReport routeReportMock;
-
- @Before
- public void setUp(){
- typedCode = new TypedCode();
- }
-
- @Test
- public void testFirst(){
- String returnVal = typedCode.first();
- assertNull(returnVal);
- }
-
- @Test
- public void testAdd() {
- HttpCode<?, ?> code = mock(HttpCode.class);
- typedCode.add(code , "test", "test1", "test2");
- }
-
- @Test
- public void testPrep() throws IOException, ServletException, ClassNotFoundException {
- Trans trans = mock(Trans.class);
- TimeTaken time = new TimeTaken("yell", 2) {
- @Override
- public void output(StringBuilder sb) {
- // TODO Auto-generated method stub
- }
- };
- when(trans.start(";na=me;,prop", 8)).thenReturn(time);
- HttpCode<?, ?> code = mock(HttpCode.class);
- code.pathParam(null, null);
- code.isAuthorized(null); //Testing httpcode, currently not working
- code.no_cache();
- code.toString();
-
- typedCode.add(code , "");
- typedCode.prep(null , "q");
-
- typedCode.add(code , "t");
- typedCode.prep(trans , null);
-
- typedCode.add(code , "t");
- typedCode.prep(trans , "");
-
- typedCode.add(code, "POST /authn/validate application/CredRequest+json;charset=utf-8;version=2.0,application/json;version=2.0,*/*");
- //typedCode.prep(trans , "POST /authn/validate application/CredRequest+json;charset=utf-8;version=2.0,application/json;version=2.0,*/*");
- }
-
- @Test
- public void testRelatedTo() {
- HttpCode<?, ?> code = mock(HttpCode.class);
- StringBuilder sb = new StringBuilder();
- typedCode.relatedTo(code, sb);
- }
+ TypedCode typedCode;
+ @Mock
+ RouteReport routeReportMock;
+
+ @Before
+ public void setUp(){
+ typedCode = new TypedCode();
+ }
+
+ @Test
+ public void testFirst(){
+ String returnVal = typedCode.first();
+ assertNull(returnVal);
+ }
+
+ @Test
+ public void testAdd() {
+ HttpCode<?, ?> code = mock(HttpCode.class);
+ typedCode.add(code , "test", "test1", "test2");
+ }
+
+ @Test
+ public void testPrep() throws IOException, ServletException, ClassNotFoundException {
+ Trans trans = mock(Trans.class);
+ TimeTaken time = new TimeTaken("yell", 2) {
+ @Override
+ public void output(StringBuilder sb) {
+ // TODO Auto-generated method stub
+ }
+ };
+ when(trans.start(";na=me;,prop", 8)).thenReturn(time);
+ HttpCode<?, ?> code = mock(HttpCode.class);
+ code.pathParam(null, null);
+ code.isAuthorized(null); //Testing httpcode, currently not working
+ code.no_cache();
+ code.toString();
+
+ typedCode.add(code , "");
+ typedCode.prep(null , "q");
+
+ typedCode.add(code , "t");
+ typedCode.prep(trans , null);
+
+ typedCode.add(code , "t");
+ typedCode.prep(trans , "");
+
+ typedCode.add(code, "POST /authn/validate application/CredRequest+json;charset=utf-8;version=2.0,application/json;version=2.0,*/*");
+ //typedCode.prep(trans , "POST /authn/validate application/CredRequest+json;charset=utf-8;version=2.0,application/json;version=2.0,*/*");
+ }
+
+ @Test
+ public void testRelatedTo() {
+ HttpCode<?, ?> code = mock(HttpCode.class);
+ StringBuilder sb = new StringBuilder();
+ typedCode.relatedTo(code, sb);
+ }
}