RSpec error: Factory not registered after migrate from FactoryGirl to FactoryBot - factory-bot

After migrate the factory FactoryGirl to FactoryBot, using the quick migration instructions, I got errors in my tests in RSpec regarding to factory registration.
ArgumentError:
Factory not registered: user

After digging a lot, I found the solution here.
Include the following code in spec_helper.rb
config.before(:all) do
FactoryBot.reload
end

Related

Keycloak Userstorage SPI: Provider not found?

What are the requirments to make the Keycloak 17.0.0 find the provider?
[error]: Build step org.keycloak.quarkus.deployment.KeycloakProcessor#configureProviders threw an exception: java.util.ServiceConfigurationError: org.keycloak.storage.UserStorageProviderFactory: Provider my.own.package.UserStorageProviderFactoryImpl not found
If I clone the project from baeldung and I start the keycloak, it works. It finds the provider. (https://www.baeldung.com/java-keycloak-custom-user-providers)
As I see the followings have to happen to make it work:
have a class that implements the UserStorageProviderFactory interface:
public class UserStorageProviderFactoryImpl implements UserStorageProviderFactory<MyImplementation> {}
create the META-INF and services folders and create the org.keycloak.storage.UserStorageProviderFactory file that contains the path to given factory:
mvn clean package --> copy jar to Keycloak/providers and should work
What do I miss? What is extra in the baeldung project that make it work while my project is not found when I start the keycloak?
https://www.keycloak.org/docs/latest/server_development/index.html#_user-storage-spi
Your class should be name SomethingUserStorageProviderFactory without the word 'impl'. Your provider class should have the same pattern name, for example, SomethingUserStorageProvider.
Official documentation gives more interesting information’s (https://www.keycloak.org/docs/latest/server_development/#_providers) and if you take a look at baeldung's code, he due the same pattern name.

ZF3 - Class 'Zend\Json\Json' not found

In zf3 while trying to use JsonModel I get error
Fatal error: Uncaught Error: Class 'Zend\Json\Json' not found in
\vendor\zendframework\zend-view\src\Model\JsonModel.php:
You probably didn't include zendframework/zend-json. You can do this by running this in your terminal:
$ composer require zendframework/zend-json
zend-json, as many other components, is a suggested package when zend-view is installed. But since there are many more suggested packages you might have missed that message.

Where is AddJsonFile extenstion method for Autofac 4.0

In the Autofac documentation, they provide a brief example of injecting a component via a service...
However, I'm unable to locate the extension method AddJsonFile ..
The provided snippet is:
var config = new ConfigurationBuilder();
config.AddJsonFile("autofac.json");
Bonus: How to find a extension method when the "Using" statements are not provided!
Found the answer on here in a comment after scrolling down. They are located Nuget Package:
Microsoft.Extensions.Configuration.XML -or- Microsoft.Extensions.Configuration.Json

Zend tool project provider creation error

Trying to create a provider using the ProjectProvider using the following code:
zf create project-provider testng actionName
I receive the following error:
No node was found to append to.
found out that zfproject.xml doesn't have <projectProvidersDirectory enabled="false">
just add it to the projectDirectory node

jacocoData missing with EclEmma & AbstractTransactionalJUnit4SpringContextTests

I've been trying to use EclEmma 2.1.0.201202261248 to measure integration test coverage for DAOs. Unfortunately, any test which extends AbstractTransactionalJUnit4SpringContextTests (that is, anything which actually uses part of the spring framework) throws the following exception:
07:35:11 ERROR [main] (ASMLogger.java:72) - Exception thrown < findByFilter > exception message could not resolve property: $jacocoData of: com.asentria.asm.persistence.krp.ProductData with params :: DataFilter{SerialNum:66,KeyNum:1967,Index1:1,Index2:2,HasPendingValue:null,OrderByDesc:null,OrderByAsc:null,Class:class com.asentria.asm.filter.ProductDataFilter}
org.hibernate.QueryException: could not resolve property: $jacocoData of: com.asentria.asm.persistence.krp.ProductData
at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:81)
at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:75)
at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassPropertyTableNumber(AbstractEntityPersister.java:1468)
...
We have an odd combination of persistence -- 1 spring-managed context which uses Hibernate directly, and one JPA-compliant context which is not managed by spring, but which also uses Hibernate for the implementation.
I know EclEmma is injecting the jacocoData field, but I have no idea how to correct the problem.
I'd be grateful for any suggestions, including ideas how how to even troubleshoot this.
Try to exclude all problem packages in Preferences
Java/Code Coverage/Excludes
I can successfully run tests with com.arjuna.* added to this setting.