GeneratorContext mockGeneratorContext = mock(GeneratorContext.class);
when(mockResourceContext.getGeneratorContext()).thenReturn(mockGeneratorContext);
when(mockGeneratorContext.tryCreateResource(
testLogger, "cssResource/com.test.Bundle.cssMethod.cssmap")).thenReturn(mockOutputStream);
when(mockGeneratorContext.commitResource(testLogger, mockOutputStream)).thenThrow(
new UnableToCompleteException());
JMethod method = mock(JMethod.class);
JClassType bundleType = mock(JClassType.class);
when(method.getEnclosingType()).thenReturn(bundleType);