assertTrue(contextBuilder instanceof JPQLSelectSingleContextBuilder);
}
private GetEntitySetUriInfo getUriInfo() throws EdmException {
GetEntitySetUriInfo getEntitySetView = EasyMock.createMock(GetEntitySetUriInfo.class);
EdmEntitySet edmEntitySet = EasyMock.createMock(EdmEntitySet.class);
EdmEntityType edmEntityType = EasyMock.createMock(EdmEntityType.class);
EasyMock.expect(edmEntityType.getMapping()).andStubReturn(null);
EasyMock.expect(edmEntityType.getName()).andStubReturn("SOItem");
EasyMock.replay(edmEntityType);
OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class);
EasyMock.expect(getEntitySetView.getTargetEntitySet()).andStubReturn(edmEntitySet);
EdmEntitySet startEdmEntitySet = EasyMock.createMock(EdmEntitySet.class);
EdmEntityType startEdmEntityType = EasyMock.createMock(EdmEntityType.class);
EasyMock.expect(startEdmEntityType.getMapping()).andStubReturn(null);
EasyMock.expect(startEdmEntityType.getName()).andStubReturn("SOHeader");
EasyMock.expect(startEdmEntitySet.getEntityType()).andStubReturn(startEdmEntityType);
EasyMock.expect(getEntitySetView.getStartEntitySet()).andStubReturn(startEdmEntitySet);
EasyMock.replay(startEdmEntityType, startEdmEntitySet);
EasyMock.expect(getEntitySetView.getOrderBy()).andStubReturn(orderByExpression);
EasyMock.expect(getEntitySetView.getSelect()).andStubReturn(null);
EasyMock.expect(getEntitySetView.getFilter()).andStubReturn(null);
List<NavigationSegment> navigationSegments = new ArrayList<NavigationSegment>();
EasyMock.expect(getEntitySetView.getNavigationSegments()).andStubReturn(navigationSegments);
KeyPredicate keyPredicate = EasyMock.createMock(KeyPredicate.class);
EdmProperty kpProperty = EasyMock.createMock(EdmProperty.class);
EdmSimpleType edmType = EasyMock.createMock(EdmSimpleType.class);
EdmMapping edmMapping = EasyMock.createMock(EdmMapping.class);
EasyMock.expect(edmMapping.getInternalName()).andStubReturn("Field1");
EasyMock.expect(keyPredicate.getLiteral()).andStubReturn("1");
try {
EasyMock.expect(kpProperty.getName()).andStubReturn("Field1");
EasyMock.expect(kpProperty.getType()).andStubReturn(edmType);
EasyMock.expect(kpProperty.getMapping()).andStubReturn(edmMapping);
} catch (EdmException e2) {
fail("this should not happen");
}
EasyMock.expect(keyPredicate.getProperty()).andStubReturn(kpProperty);
EasyMock.replay(edmMapping, edmType, kpProperty, keyPredicate);
List<KeyPredicate> keyPredicates = new ArrayList<KeyPredicate>();
keyPredicates.add(keyPredicate);
EasyMock.expect(getEntitySetView.getKeyPredicates()).andStubReturn(keyPredicates);
EasyMock.replay(getEntitySetView);
EasyMock.expect(edmEntitySet.getEntityType()).andStubReturn(edmEntityType);
EasyMock.replay(edmEntitySet);
return getEntitySetView;
}