### Question:
MagentoGraphqlClient { public static MagentoGraphqlClient create(Resource resource) { PageManager pageManager = resource.adaptTo(PageManager.class); return create(resource, pageManager != null ? pageManager.getContainingPage(resource) : null); } private  MagentoGraphqlClient(Resource resource, Page page); static MagentoGraphqlClient create(Resource resource); static MagentoGraphqlClient create(Resource resource, Page page); GraphqlResponse<Query, Error> execute(String query); GraphqlResponse<Query, Error> execute(String query, HttpMethod httpMethod); static final String STORE_CODE_PROPERTY; static final String CONFIGURATION_NAME; }### Answer:
@Test public void testMagentoStorePropertyWithConfigBuilder() { Page pageWithConfig = Mockito.spy(context.pageManager().getPage(PAGE_A)); Resource pageResource = Mockito.spy(pageWithConfig.adaptTo(Resource.class)); when(pageWithConfig.adaptTo(Resource.class)).thenReturn(pageResource); when(pageResource.adaptTo(GraphqlClient.class)).thenReturn(graphqlClient); when(pageResource.adaptTo(ComponentsConfiguration.class)).thenReturn(MOCK_CONFIGURATION_OBJECT); MagentoGraphqlClient client = MagentoGraphqlClient.create(pageWithConfig.adaptTo(Resource.class), pageWithConfig); Assert.assertNotNull("GraphQL client created successfully", client); executeAndCheck(true, client); }
@Test public void testError() { Resource resource = Mockito.spy(context.resourceResolver().getResource("/content/pageG")); MagentoGraphqlClient client = MagentoGraphqlClient.create(resource); Assert.assertNull(client); }