A seven month old puppy is still a puppy. Your expectations that he will attack or protect are very unreasonable, and your little test may have caused a lot of trauma, that I hope won't have any long-term effects.
GSDs are slow to mature, around 18 to 24 months, and in some lines of GSDs, known
for solid nerve and strong protection instinct, it may be as late as 3 or 4 years old before mental maturity kicks in! Protection comes from a place of inner strenght and quiet confidence. A seven month old that barks at every noise and random strangers walking by, minding their own business is not being protective/territorial, but fearful. Might have made you feel better to know that his bark was acting as a deterent, but I feel sorry for young dogs growing up in a constant state of fear, feeling threatened by every little thing.
Think of a child puppy as still a child, (since you are a Dad, that should come easy for you,
, ) Children should grow up carefree, feeling safe and secure in the knowledge that Mom and Dad will protect them. Once that child is an adult, then the positive upbringing will give them a sense of inner confidence where they know they can face and deal with threats. The 8 year old will hide behind the parents if some punks approach and start harassing,is depending on the parents to keep him safe. The same child at 20 years old will stand in front of others and stare down the punks, and stay calm and confident as the threat escalates, only fighting if there is absolutely no other choice.
A puppy's mind develops along the same way. As someone who is involved in protection sports, seven month olds are never subjected to actual threat pressure in training, it is all just a fun game of tug at that age, setting a foundation for required skills. It is only once the dog is mature that they are pushed to get their protection instinct out.
Not all dogs have that inborn strength to be protective either, police dogs, personal protection dogs, dogs doing protection sports often come from specific lines that have been bred for generation after generation to have the nerve strength to stand up to a threat and not back down. If you did not get your dog from a breeder that actually works and tests their breeding dogs fro this trait, there is a lower likelyhood that they will protect.
So apologize to your puppy for putting him through this, and hope that he forgives you. His physical presence should be all the deterrent you'll ever need. I mean, what person in their right mind would go and still jump the fence with a barking GSD on the other side?
Just enjoy him, let him grow up feeling safe and secure and unthreated, adjust your expectations to his development level. If you are interested in having a dog that will protect for real, look for a trainer and have him evaluated, and get into some training. I don't recommend sending him away for training, too many horror stories. If you want a protection dog, then you and your wife need to be protection dog handlers, so you have to be involved in the training yourself.