Hide PostgreSQL user in OSX Yosemite

If you install Postgres from enterprisedb.com then you’ll have a PostgreSQL user created that shows up in your login screen. It’s not the end of the world but is mildly irritating so here’s how to hide the account from the GUI:

sudo dscl . create /Users/postgres IsHidden 1

Note that /Users/postgres is not the home folder of the user but simply the path /Users/ followed by the user’s shortname. I tried pointing the tool to the users home folder with no luck.

Thanks to Apple Support for this answer. http://support.apple.com/en-us/HT203998

Advertisements

Groovy / Spring / Spring Security / Gmock : Last method called on mock already has a non-fixed count set

I banged my head against the wall for quite a while trying to figure this error out in my Groovy Junit tests:

Request processing failed; nested exception is java.lang.IllegalStateException: Last method called on mock already has a non-fixed count set.

I’m using Spring 4.0 with Spring Security 3.2.5 and thought maybe it was something to do with my test setup.  It turns out to be pretty straightforward.  I hadn’t wrapped my test in a play closure.  So going from this:

def r = mockMvc.perform(get("/...")).andExpect(status().isOk()).andReturn()

to this:

play {
  def r = mockMvc.perform(get("/...")).andExpect(status().isOk()).andReturn()
}

solved my problem.