• 713-270-4000
  • FAQ / Contact
  • hcss.com
HCSS Career Center

HCSS Career Center

  • About
    • Perks
    • What We Do
    • Blog
    • FAQ / Contact
  • View Openings

Winnie Tu

Kevin Thomas, Mr. 10,000, is Awarded Support Belt Champion

Blog, Featured, Tech Support Posted: October 21, 2019

Studying the human behavior of successful people, Malcolm Gladwell proposes in his book, Outliers, that 10,000 hours of practicing your craft is the magic number for achieving great success.  Gladwell adds that his case studies are not singularly dependent on the 10,000 hours alone. The quality of learning, and the unique and extraordinary opportunities seized, coupled with the 10,000 hours are what his book claims made the Beatles the music legends that they are, and the same reason that Bill Gates and Bill Joy are considered fathers of today’s technological world.  Even if we don’t buy into the notion that exactly 10,000 hours = success, what we can digest from this idea of practicing something in monstrous quantity is that ultimately: success takes time, intentional focus, and a willingness to respond to opportunities in extraordinarily high quantity to become a true expert at something. In HCSS Support, we have a milestone for support technicians that have answered and helped 10,000 support calls from our customers.

Kevin Thomas is one of the few Support Technicians to have reached that 10,000 marker. He began supporting HCSS customers in 2014, and he reached that goal back in February of this year. This milestone is highly respected in the support department for several reasons: 1) It means that he has a relationship with many HCSS customers that trust him to give quick and sound advice, 2) No support tech gets to this number alone, so his ability to collaborate well with others and willingness to take full advantage to answer every phone call, chat, e-mail and face-to-face interaction that has crossed his path proves his dedication, 3) Every case he has logged has presented Kevin with the opportunity to verify that there is a documented article of the case resolution in our support library that is shared with our customers.

Kevin’s contribution to the support library is actually part of the reason that he was awarded the Support Belt Champion. As a department, we give this award for exceptional acts of service to our customers. His contribution, on top of his regular duties, has been the creation of helpful articles on the subject of our new Employee App. To add to this, Kevin maintains long days in the office to help other support techs when they are in need. He will even go as far as making himself accessible to others when it is outside his office hours. While we do not normally make a practice of showing favoritism of the Dallas Mavericks over our hometown Houston Rockets, we will make the exception for Kevin, who is a die hard Mavericks fan. His consistent exceptionalism, concerted effort to continually create helpful content for HCSS customers, and his steady accumulation over that 10,000 mark has earned him the titles of Support Belt Champion, HCSS Support Expert, and the respectful moniker from his peers as the Dirk Nowitzki of HCSS Support.

Summer Internship Program

Blog, Featured, Interns Posted: September 13, 2019

Every summer at HCSS, approximately 20 interns are hired to work during their summer break from universities around the country. An internship at HCSS is not an ordinary one: there is no getting coffee for others or spending hours filing papers. An internship at HCSS is extraordinary: working on real work just like the other employees, a full agenda of career developing classes and workshops, and experiencing the unique company culture with fun activities alongside other interns and coworkers.
Even though HCSS is a tech company, the summer was full of opportunity in many facets of the technology industry, from marketing to software development to product management and strategy. All of the interns had one major thing in common through their differing career paths and aspirations: diving into the construction industry for the first time.
We asked the interns what they thought about working in technology for the construction industry, all of them agreeing that it was full of learning opportunities and had a lot more in store than they expected it to.

“What is interesting about working in the construction (software) industry?”

“When people tend to think of the construction industry, software isn’t the first place their mind tends to go to. It’s interesting to witness and actually be a part of something that makes the infrastructure we use more efficient.” – Aleena Khan, Software Development Intern, University of Houston

“Society has groomed the current generation to connect all computer science jobs to large, popular tech companies, like Google, Microsoft, and Facebook. When I first got into coding in high school, I too gave into this misconception and failed to see the major implications technology can have in countless other industries. However, with a bit more technical and life experience, my eyes were opened to all of the lives that can be changed with coding. With this perspective in mind, in high school, I published an Adopt-A-Spot app to help clean up my campus and even help Hurricane Harvey victims. Because of this experience, I was especially excited to join the Android team at HCSS and continue to impact others through technology. I started working here just over a month ago and have spent most of my time working on the HCSS Field app and its exciting features. Specifically, I helped run data migrations for more efficient database access. One thing I love about my job is that I get to see the results of my hard work in two aspects. First, it’s always satisfying seeing something you code come to life on the phone you’re holding in your hand. Especially in the modern day in which phones take up such a considerable amount of our lives, I have such a greater appreciation for everything that goes into an app. However, I can also take pride in the fact that the Android team’s work will help the thousands of workers in the construction industry that use our apps.” – Prashanth Pai, Software Development Intern, Rice University

“I find developing software to overcome performance bottlenecks by automating existing processes to be the most interesting aspect about working in the construction software industry.” – William Zhao, Software Development Intern, Texas A&M University

“For me, the most interesting part about working in the construction software industry is understanding how the needs of the construction industry shape the various software aspects/products we create.” – Shreya Vaidya, Software Development Intern, Cornell University

“The coolest thing to me about the construction software industry is the variance of topics I deal with. Not only am I working on projects most software companies deal with (i.e. website design, app development), but I also get to apply it to a field I didn’t know much about (construction). Construction is even cooler than I imagined, and it’s nice to know that I am making a group of worker’s jobs easier and more streamlined with the products I work on. Construction is important – it builds the literal foundations of our society, and I’m happy to be able to help improve it. Plus, I now know the simple difference between vertical construction and horizontal construction, haha.” – Dylan Theriot, Software Development Intern, Texas A&M University

 

“What will you take away from working in this industry?”

“Since this is my first actual internship related to the software development field, pretty much everything I’ve learned is going to be a take away – from industry standards, to code syntax.” – Aleena Khan, Software Development Intern, University of Houston

“My biggest takeaway from my internship so far is that a computer screen really shouldn’t be seen a wall that restricts developers from engaging with software users. Rather, it’s a door into the everyday, ordinary lives of the common person, and we as leaders in technology have the rare opportunity of making those lives extraordinary.”  -Prashanth Pai, Software Development Intern, Rice University

“Learning more about building focused, practical products to effectively target
a niche market.” – William Zhao, Software Development Intern, Texas A&M University

“I will take away a much better understanding of consumer needs and the careful balance that comes with optimizing for company-related factors while simultaneously ensuring that we exceed customer expectations.” – Shreya Vaidya, Software Development Intern, Cornell University

“It is so important to understand your customers and the problems they face, not the problems you think they are facing. That’s one of the many things HCSS does really well – they understand their customers. And the success of HCSS is a testament to this. It’s crazy to think a bunch of people who are often coding behind a desk can understand and help ease the problems of workers out in the field. Even with no experience in the construction industry, I can understand the impact of HCSS’ products on the field. That clarity as a software company and the extremes HCSS goes to for a customer focused company are really admirable, and they are what I will take away the most from working in this industry.” – Dylan Theriot, Software Development Intern, Texas A&M University

We wish all of our interns the best of luck in their future endeavors and hope that they had a great experience spending their summer at HCSS, making friends, bonding with teamwork, gaining invaluable experience, and building the foundation to their careers.

 

Outstanding Women in Support: Maleeha Ali Commits to Providing Exceptionally Helpful Service

Blog, Featured, Tech Support Posted: August 9, 2019

HCSS has developed metrics to measure every aspect of our support department. We track how many calls are answered, the length of each case from the time the call starts to the time the resolution is communicated, and we even track responses measuring the quality of our service to our customers.

We measure these things because we are constantly looking to improve the service we provide to our customers. One metric that every support analyst looks at is:
“Who is closing the highest number of cases while maintaining the highest customer satisfaction scores?”
This past month, Maleeha Ali, Support Team Lead, had the highest number of closed cases. Upon reviewing the past 12 months, her name appears 10 times in the number one spot over the other 55 support analysts that answer calls . I want to spend some time introducing the person that probably answered your last HCSS support call, and maybe you’ll have something in common to talk about the next time she is on the other line.

Maleeha Ali was born in Saudi Arabia, and at six months old, Maleeha and her family emigrated to the United States. Maleeha’s father graduated from the University of Houston, and took a job as a programmer for one of the largest oil and gas companies worldwide. She observed her dad intently, as a child, and she developed a sense of what it would take to be successful in a world where you are the minority. “He would go to work early, come home late, and at times he would continue to work from home to finish the job. To be the best, sometimes you have to make sacrifices,” says Maleeha.

Maleeha’s dad taught her that in order to achieve the American Dream, as an immigrant, you have to work twice as hard. He taught her that she should stand out as the best employee, and the rewards will reveal themselves later in life. He also taught her to have the highest amount of respect for her teachers because continued education and knowledge holds the key to success. She followed in his footsteps at the University of Houston, and she graduated with a degree in Management Information Systems.

At HCSS, she thrives. Her work ethic and constant drive to learn allows her to be the best person for the job every time a support call comes through. As one of four women in our support department, and the only female team lead, she is paving the way for women in HCSS support. It was not easy at first, knowing that there had not been a female in support for the past 4 years. “When I first began answering calls, I had a fear that people weren’t going to want to listen to me because I was a girl. I thought they would think I was a secretary, and many did at first. When I was asked to transfer to support, I would respond, “I am support.” It is one of my motivations to provide the best service they have experienced. Our client’s are great, and I quickly gained that confidence.” As a support analyst, she has the heart of a teacher, maintains positive intent with every interaction, and she can stand toe-to-toe with anyone with regards to knowledge, humor, and professionalism.

To this day, she remains involved in recruiting and mentoring graduating seniors from her alma mater, the University of Houston’s college of Management Information Systems. This effort has led to some of our best new support analysts.
I asked her what she thought it would take for a new support analyst to be successful in this department. Maleeha responded, “It is easy to immerse yourself into the construction industry at HCSS. There are many opportunities to engage and learn from our customers. Seize those opportunities. The difference between HCSS support and others is that we are consultants rather than just problem solvers. Each of our customers may use the software differently, and our job is to understand their needs, and help them make the program work for them. When we troubleshoot, we listen to the symptoms, and look deeper for the root cause of the problem before we consider it solved.”

“I love what I do – I get to help our customers with their problems, and help new techs be the best that they can be,” says Maleeha. “I have a passion for teaching, mentoring, and managing. In support, I am the only girl in leadership, and I am taking the highest number of calls right now because I want to be the best. Maybe we should hire more girls.”

To sum up Maleeha’s advice to prospective support hires and new techs:

  • Assume positive intent
  • Be confident in your ability, and seek opportunities to grow your knowledge
  • Do not be shy/ Do not be afraid to speak out
  • Be willing to learn
  • Leave room for improvement
  • Ask good questions
  • Love what you do or do something else

Our Customer Success Portal gives an inside look at the stories of our Support and Success family and why they love what they do. Read more here!

HCSS Takes Canada

Blog, Featured Posted: July 3, 2019

Run. Eat. Sleep. Repeat.

That was the motto for 12 HCSS employees who embarked on an amazing trip to Canada this summer. HCSS sent 12 running enthusiasts, dubbed team “HCSS Fast Track” to the 2019 Reebok Ragnar Relay, a race spanning 200 miles around beautiful Lake Ontario and finishing at Niagara Falls.

HCSS Takes Canada

The runners split evenly into two vans and alternated run shifts, or “legs,” for 26 hours straight — no stopping. However, the amazing scenery, cool temperatures, and friendly Canadians made up for the physical torture of running three different times in one day. Some of the participants were new to running, while some have been running for years.

HCSS Takes Canada

In addition to the race, the HCSS athletes also visited customers in Canada. Since they were a mix of developers, IT and human resources, it was a very unique opportunity to interact with customers face-to-face and get an inside look on how HCSS software is used in real-life scenarios and projects.

HCSS Takes Canada

HCSS Takes Canada

Jonathon Hinchley, a developer for HCSS Safety, said he usually doesn’t get to interact with customers since he is usually just writing code or fixing bugs.

“After attending UGM 2019 and getting the opportunity to visit some of our wonderful Canadian customers, I’ve realized one of the hidden perks of HCSS: interacting with customers,” Hinchley said. “As a developer, this offers a rare opportunity to hear how our customers use the products we build and improve workflows to better suit their needs. On our trip to Canada, I got to meet Robert [Camerini, estimator] from Soncin and talk about some of the suggestions their safety manager had for the safety product I work on.”

Soncin builds bridges and other infrastructure, such as the Humble River Bridge in Toronto, which Hinchley had the chance to test out during his second leg of the Ragnar Relay.

HCSS Takes Canada

HeavyJob developer Andrew Schmees said engaging with customers and hearing about the unique challenges facing their business is always fascinating.

“Bugs, APIs, and release schedules make up the bulk of our focus but are typically far from our customers’ minds as they worry about the day-to-day of staying in the black, managing equipment, and whether HeavyJob can integrate with their accounting system (spoiler: almost always). The shift in perspective is refreshing and a great reminder of the tangible effect our hard work accomplishes.”

Technicore proved a perfect example of bringing value when six HCSS employees met with founder and CEO Tony DiMillo, who was discussing purchasing HeavyJob with one of his other employees.

“We spent an hour of facetime with Tony, and over that time, through answering questions he had and connecting some dots on how our software can solve some of his main problems, he turned from being real skeptical to wanting HeavyJob,” said HCSS Software Development Manager Brenton Morneau. “Exactly one week to the day later they signed off on purchasing HeavyJob. It was an amazing accomplishment, as none of the six HCSS employees in the room with Tony were salespeople.”

This trip to Canada offered a lot of unique experiences for employees of the tech and construction industries — exploring a new country, running around one of the world’s wonders, and visiting the direct users of the fruit of everyday efforts at HCSS. There are few things that would top this experience.

HCSS Takes Canada

An Ode to UGM 2019

Featured, More Posted: February 18, 2019

“I always get to where I’m going by walking away from where I’ve been.”

-Winnie the Pooh

 

As I collect my stack of hotel notepads full of scribbled to-do items and names, and hurriedly shove my worn pile of brightly colored HCSS daily uniforms into my luggage, I can’t help but feel odd that today is the last day of our User’s Group Meeting for 2019.  

I have been with HCSS for almost 7 years, and at some point I have had the pleasure of being on the front-line support for every product that we have developed. I have an emotional connection with the people that call into support because I encounter the struggles that lead to the wins, whether big or small; and together we work through the problems that may even require the company to rethink how we programmed it.  

So for me, the User’s Group Meeting is more than a collection of minds coming together to learn about HCSS products.  It is much more than providing personal support and attention that you can’t find anywhere else. And, to me, it is instrumentally more than just picking the brains of these brilliant engineers, foremen, IT, accountants, and executives to design better more useful features.  

To me, this is a place I get to see my friends.  

This is the place I get to see familiar faces, shake hands, and catch up on our lives.   

I am grateful for these past 6 days of predawn mornings, late nights, and in-between hustle from classroom to classroom that I get to spend serving our customers.  It is no small feat, and the production that goes on behind the scene is what I would compare to operating 170 in-sync rowers on a 7th century BC Roman Trireme.  For perspective, the entire year, beginning with the day UGM ends, is how long it takes to plan this event.  It is an ongoing negotiation that continues even while the event is happening.

The feeling across the board, once the dust settles, and we load the movers with three-floors worth of convention supplies and material is that we are proud to have such amazing customers.  From their perspectives, and the insight they have to offer, to their willingness to help us design user interfaces and define workflows, we have come to this conclusion: We have the best of the best partners in any industry.  

If you have a moment, I would encourage you to explore the many online resources that we have been creating and improving over the past few years to provide more than just phone support.  Here are several to get you started:

  • We have an online chat, in case you do not have the time or ability to get to a phone;
  • We have every knowledge article that our own support uses to help troubleshoot issues in a standardized help library that we build daily as we encounter new business problems;
  • We have a free Academy site that will help you onboard your new hires and get your company learning new features at the same time;
  • We have a community portal that you can ask others in your industry how they do it;
  • We have an ideas portal that directly connects to the Product Managers where you can get notifications on your ideas, vote other users’ ideas, and engage in some lively conversation with users and PMs (Adam – HeavyJob, Greg – HeavyBid, Kyle – Equipment360, Stacey – HCSS Safety, Rateb – HCSS Plans, Addison – everything else);   

Our singular goal that every employee has when they enter the HCSS campus has always been this: to help our customers dramatically improve their business.  Being able to work for our clients is definitely an honor that I am reminded of at every User’s Group Meeting.  And as I sit here, at the last breakfast of the convention, I have a feeling of sadness as I will miss my friends. However, the hopeful reminder hits me that I have so much work to do, and I’ll see them again at UGM 2020.

If you ever need anything, or want to share your story, please feel free to drop me an email or say, “hi.”  I’ll be here for you: daniel.chee@hcss.com

I took a few photos while I was running between classes that I wanted to share with you:








262 Club

Blog, Featured, More Posted: January 29, 2019

For nearly 98 years, 26.2 miles (42.195 kilometers) has been the IAAF gold standard to define a marathon. For anyone who proudly badges their car with a plainly cryptic 262 sticker, it represents an elite club, and zen-like way of living. Avoid the sedentary, raise awareness or money, get fit, build friendships, find inspiration, inspire… these are just a few of the word bubbles that I see when I watch marathoners race by the crowds of supporters, friends, and families that line both sides of the 26.2 mile stretch.

At HCSS, the racing sub culture is alive and thriving. The company provides each employee with a $1000 wellness fund that can be used towards entering events and races. With a company average age of 37, our health risk factors are low compared to other companies. HCSS Employees and family members have submitted over 840 registrations for racing events in 2018 alone. A large majority of those were at HCSS sponsored races like Run for the Rose, Run Over Cancer, and Impact a Hero .

This past weekend we had 11 finishers of the Chevron Houston Marathon in downtown Houston. We are proud of our HCSS family that wakes up early in the morning to train every day, and has the courage to sign up for that 26.2 mile personal journey. Congratulations!

 

Credit: Photography by Daniel Chee

Using a Private NuGet Feed with VS for Mac

Blog, Development Posted: January 24, 2019

Visual Studio for Mac is a decent Integrated Development Environment (IDE) for writing .NET on a Mac. One area in which it has trouble is authenticating against a private NuGet feed. (For example, your company might host some common internal libraries). Attempting to configure a private NuGet feed using the Visual Studio for Mac IDE results in an endless authorization failure loop. See:

  1. https://developercommunity.visualstudio.com/content/problem/270269/vs-for-mac-repeatedly-ask-for-credentials-when-upd.html
  2. https://developercommunity.visualstudio.com/content/problem/120242/nuget-will-not-work-with-private-repos-401-errors.html

The solution is hidden away in a Microsoft document. In short, you must use NuGet V2 Application Programming Interface (API) feeds and a personal access token when accessing private NuGet feeds on a Mac.

First, select security from your Visual Studio online portal.

Then, you want to create a new Personal Access Token (PAT) with read-only packaging scope.

With your PAT, open a terminal and run the following command:


$ nuget sources add -name {your feed name} -source {your feed URL} 
-username {anything} -password {your PAT}

Make sure your feed URL is using NuGet V2. For example:

  • Nuget v3 url: https://mynugeturl.org/nuget/v3/index.json
  • Nuget v2 url: https://mynugeturl.org/nuget/v2

Now, after restarting Visual Studio, you’ll be able to restore packages from your private NuGet feed. Voila!

Find Your Calling

Blog, Featured, Tech Support Posted: November 30, 2018

How does one find their calling? I might not be able to tell you what your calling is, but I can tell you how I found mine in hopes that it helps you find yours. Hello, my name is Melody Hollis and I am a Learning Manager here at HCSS. My journey has been a unique one, to say the least.

I was hired two weeks before graduating with my undergrad in Digital Media from the University of Houston – Go Coogs! When I graduated, I wasn’t exactly sure what I wanted to do with my degree, but I knew I was good at and enjoyed interface design. When I started at HCSS, I was a Digital Marketing Specialist and worked in the Marketing department. HCSS was in the process of closing a pretty substantial deal with a large customer, Skanska. One of the concerns Skanska had was being able to implement and train thousands of employees through our traditional, in-person training methods. They told us that they would prefer to train only a handful of their employees. They planned to then create their own e-learning modules to put in their LMS (Learning Management System) to train the remainder of their employes.

This was the first time I had ever heard of an LMS. We realized that we too should have an LMS and that we should utilize it to train new and existing customers. The project was given to me because everyone else had too much on their plate and designing an interface like that was something I knew I could knock out of the park. My managers and I believed this would be a small side project. Little did we know, it would take off and become what it is today.

We started by offering a series of webinars covering specific features. We found that most of our users were accessing the recorded versions of these webinars rather than attending them live. I took that information and pushed for us to start creating “pre-recorded” content. The more I worked on the HCSS Academy, the more I fell in love with this new found passion for learning. In March of 2017, I was moved out of Marketing and started building out my team in the Support Department. I realized that I had the technical know how from my Digital Media degree, but I was missing instructional design experience. So, I started pursuing a MS in Instructional Design for Online Learning.

Through my classes I learned so much about the brain and how it reacts to learning. I found learning psychology fascinating! I soaked up as much as I could, as quickly as I could. Now, a little over a year and a half later, I have completed my Master’s, I am teaching classes at the University of Houston and I am the supervisor of two amazing employees – Chloe Lall and Elizabeth Martinez.

If it wasn’t for HCSS, I wouldn’t be the person I am today. I wouldn’t know anything about instructional design or learning management systems. HCSS has helped me find my true passion, pay for my MS, gave me a boost in confidence and helped developed my leadership skills. I have been given the unique opportunity to shape what my career will look like. If it wasn’t for the ownership thinking, the ability to take risks, learn from my mistakes, and the support my managers and executives have given me, the HCSS Academy wouldn’t exist today.

When promoting HCSS as a “Best Place” to work, it is easy to talk about the awards, the benefits, the toys, slide, etc. But, what really makes HCSS one of a kind is the people and the opportunities you will come to know from working here. So, if I can give you one piece of advice for how to find your calling it would be this: Surround yourself with people who care about you and will build you up, never stop growing, and don’t be afraid to take risks. After all, “the best parts of life are right on the other side of fear” (Will Smith).

 

Credit: Photography by Melody Hollis

How to Bypass the [Authorize] Attribute when Running an Integration Test

Blog, Development Posted: November 29, 2018

Integration tests need to be reliable. If you’re hitting your actual identity provider with an [Authorize] attribute, your tests will fail if that server ever goes down or makes backwards-incompatible changes. The purpose of an integration test in ASP.NET is to test your application pipeline; not the availability of an external server. Here’s how to bypass the [Authorize] attribute and inject your own claims for use in integration tests.

Normally, OAuth (json web token) authentication is implemented like this:

Startup.cs


        public void ConfigureServices(IServiceCollection services)
        {
            services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
                    .AddJwtBearer(options =>
                    {
                        options.Authority = MyAuthority;
                        options.Audience = MyAudience;
                    });

The trick to bypassing [Authorize] (and eventually injecting mocks) is to have override-able startup. I break up ConfigureServices into 3 sections: ConfigureAuth, ConfigureAppInsights, and ConfigureDependencies.


        /// 
        /// Configures authentication for the web app.  This is abstracted out 
        /// so that we can override the authentication middleware for an
        /// integration test, and thus, don't have a dependency on the
        /// identity server for the test.
        /// 
        protected virtual void ConfigureAuth(IServiceCollection services)
        {

        /// 
        /// Configures app insights for the web app.  Under test, we probably
        /// don't want real telemtery, so provide the option to turn it off.
        /// 
        protected virtual void ConfigureAppInsights(IServiceCollection services)
        {

        /// 
        /// Configures dependencies for the web app.  Under test, we likely
        /// want to use mocks, so this provides a convenient way to register
        /// different implementations.  Additionally or alternatively, calling
        /// services.addSingleton multiple times, when resolved, returns the
        /// last registered instance.
        /// 
        protected virtual void ConfigureDependencies(IServiceCollection services)
        {

        /// 
        /// Set up dependency injection, configuration bindings, etc.
        /// 
        public void ConfigureServices(IServiceCollection services)
        {
            this.ConfigureAuth(services);
            this.ConfigureAppInsights(services);
            this.ConfigureDependencies(services);

Then we need to write custom authentication middleware that will pass any authentication attempt and inject any claims we care about. Here’s the source for a “LocalAuthHandler” that injects a custom UserId claim.

https://gist.github.com/michaeltnguyen/718f801fba2fdf370e2e8c5a5e763e08

Now we need to make the asp net core authentication middleware use our custom auth handler.


        /// 
        /// For instrumented tests, causes the authorization middleware to
        /// bypass identity server and use the LocalAuthenticationHandler to
        /// authorize requests and inject a default company id claim.
        /// 
        public static AuthenticationBuilder AddLocalAuthentication(this IServiceCollection services)
        {
            return services.AddAuthentication(options =>
            {
                options.DefaultAuthenticateScheme = LocalAuthenticationHandler.AuthScheme;
                options.DefaultChallengeScheme = LocalAuthenticationHandler.AuthScheme;
            }).AddScheme(
                LocalAuthenticationHandler.AuthScheme, _ => { });
        }

And here’s what an overridden startup might look like:

https://gist.github.com/michaeltnguyen/f4f36e1d92661b60fa1183bc5cb8760b

And now you can write integration tests that run through the whole http application pipeline.

One problem here is that the controller is still hitting the actual database, so there’s still an external dependency that can cause the test to fail. (mocks to the rescue!) We added a ConfigureDependencies method to our startup class, so now we have a way to inject mocks crafted specifically for the integration tests.



        protected override void ConfigureDependencies(IServiceCollection services)
        {
            services.AddSingleton(new Mock(MockBehavior.Strict).Object);
        }

Moq provides a method Mock.Get(T object) to retrieve the underlying mock. We use this extension method just for syntactic sugar



        /// 
        /// Retrieves a Mocked service for an integration test.  The type
        /// must be registered in LocalAuthStartup.ConfigureDependencies, or
        /// this call will throw an exception.
        /// 
        /// The mock service.
        public static Mock GetMockService(this IServiceProvider provider)
            where T : class
        {
            return Mock.Get(provider.GetService());
        }

So a full blown integration test with local authentication and injected database mocks looks like:



    protected IServiceProvider ServiceProvider { get; }

    protected HttpClient Client { get; }

    public LocalAuthControllerTest()
    {
        var webhost = new WebHostBuilder().UseStartup();
        var server = new TestServer(webhost);

        Client = server.CreateClient();
        ServiceProvider = server.Host.Services;
    }

[Fact]
        public async Task TestClaimedQuantityReport_ReturnsExpectedJson()
        {
            var dbManager = ServiceProvider.GetMockService();
            // set up mock here
            var result = await Client.GetAsync("/api/v1/employee?name=bob");
            var body = await result.Content.ReadAsStringAsync();
            var expectedResponse = File.ReadAllText("Responses/employees.json");

            Assert.Equal(HttpStatusCode.OK, result.StatusCode);
            Assert.True(JToken.DeepEquals(JToken.Parse(body), JToken.Parse(expectedResponse)));
            
            dbManager.VerifyAll();
        }

Tada! Now you have 100% reliable integration tests that run through the entire HTTP application pipeline without hitting network at all!

How To Mock a Content Provider

Blog, Development Posted: July 23, 2018

Content Providers are one of the four primary components of an Android application. If you’re an Android developer, you’re probably more familiar with the other three: Activity, Service, Broadcast Receiver). Content Providers are used for sharing data between applications. If you’re querying information about the user’s contacts, that comes from the Contacts Provider. If you’re picking an image from the user’s gallery, you’re getting a Content URI back from a separate Content Provider.

A Content Resolver is used to resolve that Content URI into useful information: a cursor containing contact information or an input stream representing a gallery image, e.g., via contentResolver.query(Uri) or contentResolver.openInputStream(Uri).

When testing an Android application, it can be helpful to use a mock Content Resolver instead of the real thing — e.g., to simulate contacts or gallery images on the device without actually adding them. This is doubly useful when testing on an emulator, which does not come preloaded with any contacts or images.

This is quite challenging for a few reasons (and also assumes that you are familiar with Dagger2 and Mockito):

Content Resolvers are acquired via context.getContentResolver(). This means that in order for your activity/service/broadcast receiver to use a mock, you have to have dependency injection set up. In addition, you can never call getContentResolver(), because this will always return the system’s actual Content Resolver.
Content Resolver methods are final, which means they cannot be mocked. Instead, we have to use a mock content resolver, which requires a bit of additional setup. (Content Resolvers are responsible for routing calls between the various Content Providers on the system, and so a mock Content Resolver needs to define a routing map of its own.)
You might also be using CursorLoader to perform queries asynchronously and to observe content URIs. Behind the scenes, CursorLoader calls context.getContentResolver(), which, as explained above, bypasses any mock that you’ve created.

With that disclaimer out of the way, here’s how create and use a mock content resolver for testing:

Write a Dagger Content Provider module. In production, the actual Content Resolver is used, but this provides us the flexibility to inject a mock under test.


@Module
public final class ContentProviderModule {

  @Provides
  ContentResolver provideContentResolver(Context context) {
    return context.getContentResolver();
  }
}

For the test, write a mock Content Resolver. There are a few tricks involved here.

First, a mock Content Provider must be written. (Remember, a Content Resolver is responsible for routing between one or more Content Providers. So in order to use mock Content Resolver, we must also have some mock Content Providers).

Second, Content Providers have some internal workings (such as the Transport class used for IPC) which still need to work with our mock. So we can either subclass Content Provider for each test (which is annoying), or we can use Mockito and a Delegating wrapper to ensure that the transport mechanisms are intact (which is better).

public class MockContentProviderWrapper extends ContentProvider {

private final ContentProvider mMockProvider;

public MockContentProviderWrapper(ContentProvider mock, String authority, Context context) {
mMockProvider = mock;
ProviderInfo info = new ProviderInfo();
info.authority = authority;
attachInfo(context, info);
}

@Override
public boolean onCreate() {
return false;
}

@Nullable
@Override
public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection,
@Nullable String[] selectionArgs, @Nullable String sortOrder) {
return mMockProvider.query(uri, projection, selection, selectionArgs, sortOrder);
}
}

Now we can use Mockito and inject a mock Content Resolver.

@Module
class MockContentProviderModule {

@Singleton
@Provides
ContentResolver provideContentResolver(ContentProvider provider, Context context) {
MockContentResolver mockResolver = new MockContentResolver();
MockContentProviderWrapper wrapper = new MockContentProviderWrapper(provider,
MyContract.CONTENT_AUTHORITY, context);
mockResolver.addProvider(MyContract.CONTENT_AUTHORITY, wrapper);
return mockResolver;
}

@Singleton
@Provides
ContentProvider provideMyProvider() {
return mock(ContentProvider.class);
}

And your test might look like this:

@Test
public void ensureEmptyView_visibleWhenNoData() {
when(mMockProvider.query(…))
.thenReturn(new MatrixCursor(new String[0]));

mTestRule.launchActivity(new Intent());

onView(withId(R.id.my_empty_view)).check(ViewAssertions.matches(
withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
}

If you’re using CursorLoader, you need to take an additional step. Because CursorLoader calls context.getContentResolver() and we can’t easily modify that class, we need to use a Context Wrapper whose getContentResolver() method returns our mock. This is left as an exercise for the reader.

Phew! That is a ton of work just to be able to write tests. We recommend this technique only if you have to interact with system-level Content Providers (such as the Contacts Provider). If you’re writing your own Content Providers and don’t have to share data with other apps, we recommend taking a look at the new Android architecture components, like Room.

« Previous Page
Next Page »

Primary Sidebar

Janmy - HCSS

I love that HCSS encourages continuous learning, which helps me not only be a better UXer but also a 'jill-of-all-trades.' Additionally, if I see a need to improve our processes or products, I'm encouraged to explore solutions to proactively achieve that."

Janmy S.
UX Designer

Footer

About

We’re giving construction a little tech shakeup! Our software solutions have been helping construction companies work smarter since 1986. Today, we’re the known industry leader, serving thousands of contractors across the nation. We’re always growing and looking for more talent as we continue to innovate, refine, and expand our products, year after year.

Connect

  • LinkedIn
  • TikTok
  • Instagram

Contact

  • 713-270-4000
  • recruiting@hcss.com

© 2025 Heavy Construction Systems Specialists LLC (HCSS Careers) • Sitemap • Privacy Policy • Terms of Service